好吧,所以我一直使用gcc
编译器。这是我用这个IDE的第一个项目。我的项目是组织这样的:Visual C++错误LNK2019
main.cpp
包括a.h
a.c
包括a.h
并实现在a.h
声明的方法。当我编译它,我得到如下:
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl destroyPlayer(struct player *)" ([email protected]@[email protected]@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl drawPlayer(struct player *)" ([email protected]@[email protected]@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl movePlayer(struct player *,int *)" ([email protected]@[email protected]@[email protected]) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "struct player * __cdecl createPlayer(int,int)" ([email protected]@[email protected]@[email protected]) referenced in function _main
这些都是a.h
中的函数。使用GCC命令行我可以将它们一起编译。所有文件都被添加到项目中。我错过了什么吗?
对不起,不是一个笨蛋。 –