Excuse my ignorance, I need to define something (for example, a function) that can be referenced by another file, without including its code, like this in Lua:
-- main.lua
;print(require './func');
-- func.lua
;return function()
print 'Hello';
end;
This is possibly duplicate of a question, but I don't find it... When I compile my code, the compiler lets this error in my eyes...
Well, my codes are:
//////////////// main.cpp ////////////////
#include "test.h"
int main() {
test();
return 0;
}
//////////////// test.h ////////////////
#ifndef INC_TEST
#define INC_TEST
void *test();
#endif /* INC_TEST */
//////////////// test.cpp ////////////////
#include <iostream>
#include "test.h"
using namespace std;
void *test() {
cout << "Hello World!" << endl;
}
I compile it like g++ main.cpp -o as3c.exe.