Program crash before main(), in some other lib

Started by
37 comments, last by Raduprv 19 years, 2 months ago
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()
Advertisement
Maybe this is your problem.

Although that is less likely to be a problem in C as there are no constructors in C...
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....
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.
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
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.
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?
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.
We are considering statically linking with it.
Ok, new info. It works FINE when using the win2k compatibility mode. Same exe, same dlls...
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.

This topic is closed to new replies.

Advertisement