fatal error LNK1104

浪子不回头ぞ 提交于 2021-02-16 07:24:49

问题


When I compile my code in visual studio c++ 2008 I get the following error:

fatal error LNK1104: cannot open file 'C:\Users\...\Documents\Visual Studio         
2008\Projects\...\Debug\....exe

I just copied my code from another project in visual studio C++ and pasted it in this project again in VS C++. Can it cause this error?


回答1:


This can happen because, for example, the executable is currently executing or opened by another program, or because you don't have the right permissions for that directory.




回答2:


open TASK MANAGER and see if the process of the .exe is running in background even after closing it. if yes, then kill the process and then try to run it again.




回答3:


This can happen if you have turned on preprocessor output, e.g. in Properties | C/C++ | Preprocessor | Preprocess to a File == YES. Creating a preprocessor output file (of file type .i) is mutually exclusive to creating an object file (of time .obj).




回答4:


In my case it was caused by the "Incremental Linking" option of the projects (Visual Studio 2015). Maybe because the files were also dependencies of other projects from the same solution, not sure...



来源:https://stackoverflow.com/questions/12031285/fatal-error-lnk1104

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