Visual Studio not compiling specific file

风流意气都作罢 提交于 2019-12-23 23:58:29

问题


I am working on an OpenGL game in C++ and am using Visual Studio 2013 for it. Until now everything worked fine but since about 3 days, one of my files is no longer compiled when I change it. The strange thing is, it is really just related to this one single file. Every other file works as expected. So if I change something in said file (it is a .h file with implementation in it) Visual Studio doesn't care. Even if I write some unexecutable statement in it, he lines it in red but doesn't bother anyway thus will just use an old, pre-compiled version. If I delete the "build-Debug" folder, he compiles the file again and it works as it should. Any ideas how to solve this problem?

I also realised that the "build-Debug" folder, contains no .obj file for all the header files with implementation in it. Maybe it has something to do with it?

Also, my general building properties are okay, like always compile when files change and such stuff.


回答1:


I eventually solved the problem myself by just splitting the file into a seperate .h and .cpp file. While this was not my intention after all I could not find another solution for this problem. Thus it must have had something to do with being part of another .obj file and maybe with some include order or something similar.



来源:https://stackoverflow.com/questions/36406699/visual-studio-not-compiling-specific-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!