Jump to content
  • Advertisement
Sign in to follow this  
AniMerrill

Some C++ trouble

This topic is 2887 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

EDIT== Problem resolved.

Hey everyone. I'm new here- just joined -and I was wondering if I could get some help with my C++.

I'm working with Visual Studio C++ Express 2010, on Windows 7. I've been following the tutorials over on Lazyfoo.net to try and practice some basic SDL, so I can make games eventually. Right now I have a basic program made that utilizes some of the basic functions of SDL, SDL Image, SDL TTF, and SDL Mixer so I can get my feet wet and have a self written example of how to use the code.

The program wasn't giving me any trouble until I wanted to switch from making a Debug version to a Release version (which is of course important if I ever want to release anything to anybody ever). IMMEDIATELY it gives me an error after I switch to compile this version:

"error LNK1107: invalid or corrupt file: cannot read at 0x2B8"

The file it's referring to is the SDL.dll which is located in the project folder. I'm not exactly sure what's going on since it works fine in debug, so the file must not actually be corrupted. And it KNOWS where its at, so its not anything concerning the displacement of the file. The compiler can find and read the file, it just doesn't work I guess.

I've read a lot of documentation on Microsoft forums and whatnot that the switch from Debug to Release in Visual Studio usually causes problems, but none of them usually actually explain how to fix it. Any advice you guys can give would be appreciated. And if you need to see any of the code, I'll post it... but it seems to be a problem with the Linker not anything in the source files.

I've been meaning to join these forums anyway, so I guess this is good of a reason as any XD

Thanks,

[Edited by - AniMerrill on October 23, 2010 10:21:53 PM]

Share this post


Link to post
Share on other sites
Advertisement
Review your project build settings for Release build and ensure that they are correct. Not all project build settings are copied from Debug to release.

Share this post


Link to post
Share on other sites
Quote:
Original post by zerothrillz
Review your project build settings for Release build and ensure that they are correct. Not all project build settings are copied from Debug to release.


If you mean the project properties, then it appears that everything is identical, at least the stuff that directly relates to the SDL libraries. I don't know what else would be causing it anyway.

Share this post


Link to post
Share on other sites
are you linking to a debug or release time build of sdl? if you're trying to build a project in release mode, you should be linking to a release build of the sdl library.

Share this post


Link to post
Share on other sites
Quote:
The file it's referring to is the SDL.dll
SDL.dll or SDL.lib? You don't link to dll files. You link to a static library.

Share this post


Link to post
Share on other sites
Quote:
Original post by oler1s
Quote:
The file it's referring to is the SDL.dll
SDL.dll or SDL.lib? You don't link to dll files. You link to a static library.


XD

Okay, so I'm an idiot. That makes sense. I'm not exactly sure why I tried that. Release version works fine now.

Thanks :3

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!