Chunky by FelipeFS
Chunky by FelipeFS
GPWiki.org
It is currently Wed Apr 16, 2014 1:11 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: SDL Linking error
PostPosted: Fri Dec 07, 2012 9:41 am 
Rookie

Joined: Fri Dec 07, 2012 9:36 am
Posts: 4
I've just started using SDL, and have been following lazyfoo's tutorial here, and all has been going well so far, until I got to using TTF fonts. Whenever I add the library and link it, which I have already done with the SDL_Image library successfully, I cannot run the program with the error 0xc000007b, which seems to be a common .dll error. The same program will run fine without any mention of the TTF library so I'm certain it has to do with that. I have tried reinstalling the library from fresh sources, but get the same result each time, so I'm unsure what I'm doing wrong, any help will be appreciated.


Top
 Profile  
 
 Post subject: Re: SDL Linking error
PostPosted: Fri Dec 07, 2012 10:12 am 
Obfuscation Ogre

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 329
Location: Here (where else?)
Code:
LIBS=-lSDL -lSDL_ttf
At Linux, I link with two libraries, libSDL, and libSDL_ttf, perhaps it is the same situation with Windows?

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
 Post subject: Re: SDL Linking error
PostPosted: Fri Dec 07, 2012 11:18 am 
Rookie

Joined: Fri Dec 07, 2012 9:36 am
Posts: 4
Alberth wrote:
Code:
LIBS=-lSDL -lSDL_ttf
At Linux, I link with two libraries, libSDL, and libSDL_ttf, perhaps it is the same situation with Windows?

Sorry, I should've mentioned, I'm using Windows and visual studio express 2008, so the libraries should be linked and everything through that, which it does seem to be, since it compiles fine, only when running do I get the error.


Top
 Profile  
 
 Post subject: Re: SDL Linking error
PostPosted: Fri Dec 07, 2012 12:18 pm 
Obfuscation Ogre

Joined: Sun Oct 16, 2011 3:09 pm
Posts: 329
Location: Here (where else?)
Ah, ok.
I have no idea what 0xc000007b means, but it looks like a crash error.

Did you try some simple experiments, like linking but not using, only initializing (return values are ok?), using sdl but not sdl_ttf, and vice versa and so on?
Does adding a debug print statement work, or can you run it in the debugger?

Perhaps you can find out where in the execution it fails.

_________________
My project: Messing about in FreeRCT, dev blog, and IRC #freerct at oftc.net


Top
 Profile  
 
 Post subject: Re: SDL Linking error
PostPosted: Fri Dec 07, 2012 3:05 pm 
Double Guru
User avatar

Joined: Fri Aug 12, 2005 8:58 am
Posts: 2009
Location: LA, CA
Did you build SDL_ttf yourself or just download the binary? Visual Studio is very picky about libs, make sure that both libSDL and libSDL_ttf are compiled for your version of Visual studio and were using the same linking options (multithreaded-dll should work). Also make sure that you are using all 64bit or all 32bit dlls and are compiling your program as such. If you are sure of those things then try to narrow your program down (or make a new one) with the simplest code that makes it crash.

_________________
My Development Blog | My Website | My Current 3d Engine


Top
 Profile  
 
 Post subject: Re: SDL Linking error
PostPosted: Sat Dec 08, 2012 11:43 am 
Rookie

Joined: Fri Dec 07, 2012 9:36 am
Posts: 4
Alberth wrote:
Ah, ok.
I have no idea what 0xc000007b means, but it looks like a crash error.

Did you try some simple experiments, like linking but not using, only initializing (return values are ok?), using sdl but not sdl_ttf, and vice versa and so on?
Does adding a debug print statement work, or can you run it in the debugger?

Perhaps you can find out where in the execution it fails.


I have tried stuff like that, I found the most I can do is link it, use sdl_tff, #include "sdl_ttf.h", but the error only occurs when I include TTF_Init().

Seoushi wrote:
Did you build SDL_ttf yourself or just download the binary? Visual Studio is very picky about libs, make sure that both libSDL and libSDL_ttf are compiled for your version of Visual studio and were using the same linking options (multithreaded-dll should work). Also make sure that you are using all 64bit or all 32bit dlls and are compiling your program as such. If you are sure of those things then try to narrow your program down (or make a new one) with the simplest code that makes it crash.


I downloaded the binary, how would I check if they are compiled for my version of visual studio?
I'm sure I copied across the 32bit dll's, however I'm not too sure they actually are 32bit. I used dependency walker on the .exe thats compiled, and get these errors:
Code:
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.


And in the list, there are 2 64bit dll's while all the rest are 32bit. However, these are dll's that I don't think I'm referencing, they're MSVCR90.DLL and ZLIB1.DLL. It also complains that GPSVC.DLL and IESHIMS.DLL are missing. I haven't seen these before, and they weren't in the download for the SDL_ttf.


Top
 Profile  
 
 Post subject: Re: SDL Linking error
PostPosted: Mon Dec 10, 2012 3:14 pm 
Double Guru
User avatar

Joined: Fri Aug 12, 2005 8:58 am
Posts: 2009
Location: LA, CA
MSVCR90.dll is from visual studio 2008, so I'm guessing you have the right one there. IESHIMS.DLL is from internet explorer, dependency walker always complains about that and it can safely be ignored. Not sure what GPSVC.dll is, most likely a system dll. ZLIB1.DLL might be your issue, do you have a zlib.dll in your working directory along side sdl.dll and sdl_ttf.dll?

_________________
My Development Blog | My Website | My Current 3d Engine


Top
 Profile  
 
 Post subject: Re: SDL Linking error
PostPosted: Thu Dec 13, 2012 5:03 am 
Rookie

Joined: Fri Dec 07, 2012 9:36 am
Posts: 4
Seoushi wrote:
MSVCR90.dll is from visual studio 2008, so I'm guessing you have the right one there. IESHIMS.DLL is from internet explorer, dependency walker always complains about that and it can safely be ignored. Not sure what GPSVC.dll is, most likely a system dll. ZLIB1.DLL might be your issue, do you have a zlib.dll in your working directory along side sdl.dll and sdl_ttf.dll?


Image
Success!
Thanks!
Including zlib1.dll in the working directory fixed it completely. That just makes me wonder though, why would it not just say that?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group