Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Found a lot on this error already, but my case does not get matched with any yet.

I am building a solution (having many projects) in debug mode, and one of them is throwing this error, I am using VS2010 and language is C++, .net version 4.0, earlier this project was compiled in vs2008 and then VS2010, and it was all ok, now I got a new machine which has just VS2010 installed and now facing this error.

main thing to notice is: Properties settings: 1) Project Configuration->General->/CLR is chosen 2) In C++->General-> No CLR support

I am having these settings since past, it's running all fine in my old machine in VS2010 only in the same debug mode.



If I turn on /Clr support in both the settings, general and c++-> general both, I got another error: error C2855: command-line option '/clr' inconsistent with precompiled header I deleted .pch file,and recreated it, even then, this error persists.

What to do?
Posted
Comments
Philippe Mori 20-Nov-13 18:40pm    
You also have to check if you have per file settings...

Regarding the second problem with the precompiled header, it looks like your Stdafx.cpp is compiled without the /clr option. You either need to switch it on there as well (possibly leading to problems with other classes); or set the Precompiled Header option (in C/C++ - Precompiled Headers) to Not Using Precompiled headers and not include Stdafx.h in your .cpp file.

I don't know why it worked on the old machine.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900