我不得不使用预处理器,所以我改变了:
Configuration Properties -> C++ -> Preprocessor -> Preprocess to a
File -> Yes
得到错误:
Error 1 error LNK1104: cannot open file 'Debug\asnreal.obj'
这个问题的解决方法:
I had to add quotes around the path to my .lib file in
Project->Properties->Configuration Properties->Linker->Input->Additional Dependencies .
我不明白.lib是什么文件?它在哪里?在我的项目中,它不是。我需要在Additional Dependencies 中指定什么?我试图在引号中添加调试我的项目的路径,但没有任何反应。
编译器输出 .obj
文件或预处理文件。当您启用预处理器输出时,您实际上禁用了 .obj
文件的输出。
VS 不考虑这一点并启动链接器。由于您没有输出 .obj
文件,因此链接器无法找到它。
当您有一个旧的 .obj
文件并且源代码中的更改生成新的预处理输出但不进入链接的可执行文件时,您可能会遇到更多麻烦。
我是一名优秀的程序员,十分优秀!