Some C++ trouble

Started by
4 comments, last by AniMerrill 13 years, 6 months ago
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]

AniMerrill, a.k.a. Ethan Merrill

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.
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.

AniMerrill, a.k.a. Ethan Merrill

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.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.
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.
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

AniMerrill, a.k.a. Ethan Merrill

This topic is closed to new replies.

Advertisement