Obscure bug of the minute...

I'm working on porting an old MS C++ to Managed C++, and then perhaps on to c#.  So, I open the old .dsw project in VS.NET 2003, and whammo!  Instant project conversion, right?
Well, sorta.  As soon as I set the project to compile with managed extensions (It Just Works, right?), i get the following compiler error:

Command line error D2016 : '/RTC1' and '/clr' command-line options are incompatible

It should be simple enough to go into the project settings and turn off the RTC1 option, right?

So, I do so, and everything should work great.  I hit the build button again, and no dice.  My new friend good ol' D2016 pops back up.  Didn't I turn this option off?

Fortunately, VC++ 7.1 generates a really cool BuildLog.htm, and I take a gander.  Hmm...  According to the BuildLog, the /RTC1 switch is still set on each of my .cpp files.  A quick Google Search confirms my suspicions that this is indeed an IDE Bug. So, I go into the compiler settings on every single .cpp file, and turn off the /RTC1 option.

Simple enough, really, if you know where to look.  A few log files later, and a few minutes on google solves about 80% of a developer's problems.  A shout over the cube wall solves another 10%.  A healthy dose of blood, sweat, and tears (and a curse or two) slays the remainder of the bugs.

I'd guess that every developer runs into several of these problems each day, and dispatches them rather quickly.  I'd also say that it's things like this that will prevent the 'expert systems' from putting programmers out of jobs.  There will always have to be 'experts' on the expert systems.  Someone's got to know how to run these things. 
---
Prologue:  I do have an associate, however, who absolutely refuses to read any reference books or do any google searches. Most of the time he shouts the question 'over the wall' as soon as it pops into his mind.  He's kinda like the NetBEUI of programmers.  Good for small projects, but chatters a lot.

12 Comments

  • Luckily the "cube wall" is now intercontinental for this particular associate. :)

  • hey Jerry!

    Just came up on the same thing and you're the first answer to come up on Google. Superb!



    Roy

  • Thanks for the help. I looked at this for a while before finding your comment via Google. You just helped me past the first VS.NET bug that slowed me down. It only took me about 5 hours to hit the first bug; not good. Anyway, thanks for the tip!

  • Thank you. I've been searching about this for an hour, and finally found your solution. You'd think MSDN would've posted something!

  • A quicker way to do it is:

    - Open you AppName.vcproj file

    - Search and replace all

    BasicRuntimeChecks="3"

    With

    BasicRuntimeChecks="0"

    - the "3" might be a different value, so just locate one first, and check if it's a 1, 2,3 or 4. then search and replace accordingly, as long as it ends up being a 0 you're fine.

  • you really hit the nail on the head. VS.NET 2003 has the exact same problem. Your solution came up on google first time and that was the exact problem. Great job! Saved me a good half hour.

  • I'll repeat the thanks for lots of screwing around saved. Total fix time about 10 minutes - thanks again.

  • The fixes suggested worked great. I chose to change the AppName.vcproj file by searching and replacing all

    BasicRuntimeChecks="3"

    With

    BasicRuntimeChecks="0"



    I wish I found this fix two hours ago. Thanks again

  • I wish I found this fix 6 work hours ago. Thanks!

  • I ran across this too and found a short cut to do the same.

    I selected all the cpp files in my project(ctrl+select) and chose properties. Then I set them to Inherit from the project...

  • ok great answer but what about subsequently....



    '/ZI' and '/clr' command-line options are incompatible

  • You'll find that several options are incompatible - just remove them from the project settings, and you'll be fine!

Comments have been disabled for this content.