Build issues with Visual Studio 11

梦想的初衷 提交于 2019-12-11 02:45:29

问题


I am building a simple program on VS 11 Professional beta edition.

#include <iostream>
int main(){
    std::cout << "Hello World" << std::endl;
}

But I am getting RC errors.

1>------ Build started: Project: Stephen, Configuration: Debug Win32 ------
1>Build started 5/23/2012 8:31:30 PM.
1>InitializeBuildStatus:
1>  Touching "Debug\Stephen.unsuccessfulbuild".
1>ClCompile:
1>  Source.cpp
1>RC : fatal error RC1106: invalid option: -ologo
1>  
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.67
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

If I just compile the source file alone (i.e., not building the project), it compiles. I googled on this error but didn't find much useful information. I have seen the compiler and linker properties. No, where -ologo option is seen. I amn't sure where this invalid option is coming from.

I have VS 2005, 2010 installed on my system. Does this has anything to do with this error ? Any help is aprreciated.


回答1:


Go to project -> Properties -> Configuration Properties -> General. Change the platform toolset to the correct toolset you are using. Or just change Suppress Startup Banner to 'no'.




回答2:


If you are migrating your sourcecode from 32-bit to 64-bit platform and you encounter this error during build, do the following:

  1. Select your Project on the Solutions explorer.
  2. From menu, select Project->Properties->Configuration Properties->VC++ Directories
  3. On "Executable Directories", check if "$(WindowsSdkDir)\bin" exist - Check first what is "WindowsSdkDir" by clicking the down arror->edit->click "Macros" button and see where it is pointing... Usually it is in "C:\Program Files (x86)\Windows Kits\8.1\bin"
  4. Check if there are executable files under "C:\Program Files (x86)\Windows Kits\8.1\bin"
  5. If none, then there could be folders under "C:\Program Files (x86)\Windows Kits\8.1\bin"
  6. Go to "C:\Program Files (x86)\Windows Kits\8.1\bin\x86" and check if "RC.exe" exist
  7. If "RC.exe" exist then go back to Step 1, Step 2.
  8. On "Executable Directories", change "$(WindowsSdkDir)\bin" to "$(WindowsSdkDir)\bin\x86"
  9. Click "Apply" then "Ok" button.
  10. Rebuild your project and that should solve your problem.


来源:https://stackoverflow.com/questions/10729777/build-issues-with-visual-studio-11

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