I have an existing project that builds just fine.
I need to add a function. When I add it to an existing file the project builds fine.
When I add it to a new file, the output shows the file is compiled, but the linker can’t find it.
Does anyone have any idea where to look to fix this?
I’m sure it’s a minor issue in the setup but I can’t find it despite looking for a couple of hours.
The linker error:
ld: error: undefined symbol: main_vm(int, char**)
>>> referenced by native-lib.cpp:41
The new function in .h file:
int main_vm(int argc, char **argv);
The new header in .cfile:
int main_vm(int argc, char **argv){
// empty
}
CMakeLists.txt:
set(HEADER_FILES
atom.h. // the project builds when the function is added here.
vmstart.h // the linker error shows up when the function definiton is added here.
)
set(SOURCE_FILES
atom.c // the project builds when the function implementation is added here.
vmstart.c // the linker error shows up when the function implementation is added here.
)
Thanks in advance.