错误 C1047:使用比其他对象更旧的编译器创建的对象文件

2022-01-05 00:00:00 visual-studio-2008 c++

我有一个项目,我正在 Windows 7 上的 Visual Studio 2008 SP1 中以 C++ 发布模式构建,当我构建它时,我不断收到:

I have a project that I'm building in C++ in Release mode in Visual Studio 2008 SP1 on Windows 7 and when I build it I keep getting:

致命错误 C1047:对象或库文件'.Releasefoobar.obj'是用较旧的编译器创建的比其他物体;重建旧的对象和库.

fatal error C1047: The object or library file '.Releasefoobar.obj' was created with an older compiler than other objects; rebuild old objects and libraries.

链接时发生错误.

我尝试删除特定的目标文件并重新构建,但这并不能解决问题.我也试过吹掉整个发布构建文件夹并重建,但这也没有解决它.有什么想法吗?

I've tried deleting the specific object file and rebuilding but that doesn't fix it. I've also tried blowing away the whole release build folder and rebuilding but that also didn't fix it. Any ideas?

推荐答案

我建议重新安装 VS 2008 SP1.在此期间您是否安装了不同的 VS(例如 VS Express)?已知这会干扰现有的 VS 安装.

I would suggest reinstalling VS 2008 SP1. Have you installed a different VS (e.g. VS Express) in the meantime? This is known to cause interference with an existing VS installation.

您可以尝试通过从 Visual Studio 命令提示符运行 cl.exelink.exe 来检查编译器和链接器版本.

You could try checking the compiler and linker versions by running cl.exe and link.exe from the Visual Studio command prompt.

相关文章