Skip to main content
GameDev.net gamedev.net
🔒 Locked

Programmatically Setting the RunTime Library in VS

Started by Drew_Benton Dec 20, 2005 at 2:03 PM 3 replies 600+ views
Original Post
Drew_Benton
Drew_Benton
Does anyone know how to do this? Like you can use pragma comment lib in order to set a library, and you can specify quite some settings for project stuff, shouldn't there be a way to specify the RTL as well? I checked MSDN last night and found a convient link, "Programmatically Setting the RunTime Library", but unfortunetly that is for .Net and does not apply to me. Has anyone been able to do this, or is changing it via project options the only way possible?
SiCrane
SiCrane
You can set it with a macro in the IDE. Is that what you're asking?
Drew_Benton
Drew_Benton
Quote:
Original post by SiCrane
You can set it with a macro in the IDE. Is that what you're asking?


Yes, do you know what that macro is? Erm, I mean like put it in a .h/.cpp file and it will be changed, well have it so the project now uses the right RTL, just like how a #pragma comment(lib, "SDL.lib") would work.
SiCrane
SiCrane
Not that kind of C++ macro, an IDE macro. I don't think there's a way to set the runtime library in the C++ code itself, and there really shouldn't be since the runtime library switch is a global change not a local change. It defines certain preprocessor symbols as well as changing link targets.
Drew_Benton
Drew_Benton
Ok cool thanks, I've searched before I couldn't ever find it, but I wanted to see if anyone had any tricks for it [wink]. Only reason I was looking was because it would make using SDL a lot easier if each time you didn't have to change the RTL for the project. I'm working on my own little SDL framework (again? yes [lol]) and it'd be nice to have it so the end user could include the .lib and .h and be ready to program without having to touch project settings. Thanks, and I guess I'd be interested in that IDE macro myself, not that I'm so lazy as to not want to change settings myself, but just curious how it works [smile]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.