Okay, So I have always used the gcc compiler. This is my first project with this IDE. My project is organised like this:
main.cpp which includes a.h
a.c which includes a.h and implements the methods declared in a.h
When I compiled it I get the following:
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl destroyPlayer(struct player *)" (?destroyPlayer@@YAXPAUplayer@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl drawPlayer(struct player *)" (?drawPlayer@@YAXPAUplayer@@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl movePlayer(struct player *,int *)" (?movePlayer@@YAXPAUplayer@@PAH@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "struct player * __cdecl createPlayer(int,int)" (?createPlayer@@YAPAUplayer@@HH@Z) referenced in function _main
These are all the functions in a.h. With the GCC command line I could compile them together. All files are added to the project. Am I missing something?
I believe Visual Studio automatically compiles
.cfiles as C files, so name mangling could play a part in this. Try renaminga.ctoa.cppand see if it helps.