Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: jhp on January 11, 2008, 01:56:32 pm

Title: VC 2008 and SDL
Post by: jhp 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
Title: Re: VC 2008 and SDL
Post by: Mc.Michael 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 )
Title: Re: VC 2008 and SDL
Post by: jhp 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!
Title: Re: VC 2008 and SDL
Post by: Albenejean 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.