问题
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:
- Select your Project on the Solutions explorer.
- From menu, select Project->Properties->Configuration Properties->VC++ Directories
- 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"
- Check if there are executable files under "C:\Program Files (x86)\Windows Kits\8.1\bin"
- If none, then there could be folders under "C:\Program Files (x86)\Windows Kits\8.1\bin"
- Go to "C:\Program Files (x86)\Windows Kits\8.1\bin\x86" and check if "RC.exe" exist
- If "RC.exe" exist then go back to Step 1, Step 2.
- On "Executable Directories", change "$(WindowsSdkDir)\bin" to "$(WindowsSdkDir)\bin\x86"
- Click "Apply" then "Ok" button.
- Rebuild your project and that should solve your problem.
来源:https://stackoverflow.com/questions/10729777/build-issues-with-visual-studio-11