I have c++ project on Visual Studio 2010. I have a file A.h which has the prototypes of some functions and A.cpp file has the definitions of these functions. Also, main.cpp file includes the main method and includes the A.h. Everything is in global namespace without any classes. After I clean the project and build it gives me "error LNK2019: unresolved external symbol" for the functions defined in A.h and referenced in main.cpp. Then I add some space to a file(to make sure visual studio will compile because of the change), then compile and the errors disappear. How can I fix this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I sometimes find that the precompiled headers get out of sync, so I normally turn off that option.
It's in Projects->Properties->Configuration Properties->C/C++->Precompiled Headers-> Create/Use Precompiled Header.