Author Topic: VC 2008 and SDL  (Read 3525 times)

jhp

  • Guest
VC 2008 and SDL
« on: January 11, 2008, 01:56:32 pm »
Hi Everyone!

I've just received a laptop with Vista on it and decided to transfer my C++ learning over to it. As I read that there are problems with MinGW and Vista, I thought I'd put VC 2008 on there and set CodeBlocks up as my IDE.

After reading through the forums I can't find much on VC 2008, and am wondering if I'm wasting my time installing this thing? Although I've had some console apps compiling fine, whenever I try to use SDL I'm getting some odd errors, like

Code
defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library.

Using NODEFAULTLIB doesn't help either, it just throws up more errors.

Previously I used MinGW and all worked OK, does anyone know what I should do to get SDL up and running with VC 2008 or should I just save myself the hassle?  :)

TIA

jhp

Offline Mc.Michael

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: VC 2008 and SDL
« Reply #1 on: January 11, 2008, 02:50:28 pm »
Try add to linker options:


/NODEFAULTLIB:msvcrt.lib

And compile your project with static C/C++ runtime ( /MT or /MTd )
« Last Edit: January 11, 2008, 02:53:15 pm by Mc.Michael »

jhp

  • Guest
Re: VC 2008 and SDL
« Reply #2 on: January 11, 2008, 05:21:44 pm »
Bah, still errors galore :?

Think I'll go back to MinGW for now and see how I get on.

Thanks for the response!

Offline Albenejean

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: VC 2008 and SDL
« Reply #3 on: January 12, 2008, 01:50:15 am »
Quote
defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library.
This should be just a warning and not en error.

However, I don't think that you have to explicitly link the msvcrt, msvcprtd.lib, orothers, if the flags /MT, /MTd, /MD, MDd are active. Please verify this. Personnly, I don't give any of these files to the linker. I just use the flags.