Jump to content
  • Advertisement
Sign in to follow this  
Raduprv

Program crash before main(), in some other lib

This topic is 4988 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

Ok, this problem is very, very annoying, and have no clue why it happens, much less how to fix it. Basically, under Windows, the program crashes even before reaching the main function. But under Linux it works OK. To make things worse, it crashes in a library, libxml2.dll And to make things even worse, when run under GDB, the program doesn't crash at all. The program is written in C, so there are no methods and such that could crash it before it reaches main() Another very strange thing is, libxml2.dll needs zlib1.dll. Now, we do not use, or need zlib1.dll, but libxml needs it. Well, on some computers relplacing the zlib1.dll with some other version works. But on other computers it doesn't work. This is extremely annoying, and we are kind of tired, so I decided to post here, maybe someone can help? As for posting the code, there is no way you can help us, the code has about 40K lines of code, and like I said, it crashes before main()

Share this post


Link to post
Share on other sites
Advertisement
Maybe this is your problem.

Although that is less likely to be a problem in C as there are no constructors in C...

Share this post


Link to post
Share on other sites
eah, the thing is that we don't have constructors. I think it is window's problem, and it has to do with loading the libraries. But still, it worked before. So WTF....

Share this post


Link to post
Share on other sites
Did you build libxml2.dll yourself? libxml requires zlib because it can read and write compressed xml files (and they are compressed using zlib). You can build libxml without zlib support though. Make sure you have the right versions of the various dlls. Your build of libxml2.dll requires a specific version of zlib1.dll; although you can replace it with another version, dlls aren't still magically swappable like that and if the external interface has changed you may have strange crashes.

cheers
sam.

Share this post


Link to post
Share on other sites
No, we got the version from their web site. But the program DID work before, until some modifications were made.
We are thinking of building it ourselves, but I have no idea how to do that with DevCPP

Share this post


Link to post
Share on other sites
I have had this kind of crashes before and then it was due to a wrong version of a dll. You could always make a blank project with your current project settings to pin down that if it's a library problem.

Share this post


Link to post
Share on other sites
Quote:
Original post by doho
I have had this kind of crashes before and then it was due to a wrong version of a dll. You could always make a blank project with your current project settings to pin down that it's a library problem.


Yes, but the god damn thing worked fine...
Does it matter if you add new functions from that DLL, even if you don't use them?

Share this post


Link to post
Share on other sites
Quote:
Original post by Raduprv
Does it matter if you add new functions from that DLL, even if you don't use them?

I don't know.

You could always consider linking staticlly if that solves your problem. Unless you have multiple executables in your project there is nothing to gain from linking with dll's.

Share this post


Link to post
Share on other sites
We are considering statically linking with it.
Ok, new info. It works FINE when using the win2k compatibility mode. Same exe, same dlls...

Share this post


Link to post
Share on other sites
Quote:
Original post by Raduprv
Ok, new info. It works FINE when using the win2k compatibility mode. Same exe, same dlls...
Interesting. Maybe you can post on MSDN newsgroups about this.

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!