Skip to main content
gamedev.net
🔒 Locked

zlib + Dev-C++?

Started by randomZ Feb 21, 2003 at 10:25 AM 7 replies 7.3k views
Original Post
randomZ
randomZ
I''m using Dev-C++, which comes with zlib. However, it doesn''t allow using it by adding "-lz" to the linker options (which works with all other libraries), but only by including the absolute path to libz.a. Why is this, and how can I fix it? It''s crap if you want to redistribute your programs... Another thing - I don''t know if it''s related to that matter: When running an executable I compiled on my computer on a friend''s machine, I get an windows error message saying that ZLIB.DLL is missing. Does zlib even require a DLL? I just had to recompile the program; that was enough.
"George W. Bush Geography Simplification Initiative"
More info on George W. Bush My Homepage (C++ SDL OpenGL Game Programming)
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/
smart_idiot
smart_idiot
I''ve used zlib with Dev-C++ and it worked okay, although I had compiled my copy myself. I don''t think it required a DLL, although it is possible that there is both a static and a dll version of it.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
randomZ
randomZ
My libz.a is in
D:\Programme\Dev-C++\lib\libz.a
which is my lib directory.
And the only zlib.dll i have is in my OpenOffice directory. Yet I can compile and run zlib programs.
When I do -lz, the linker doesn''t even complain about a missing file, it just shows a lot of unresolved dependencies.


"George W. Bush Geography Simplification Initiative"

More info on George W. Bush
My Homepage (C++ SDL OpenGL Game Programming)
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/
randomZ
randomZ
OK, smart_idiot sent me a copy of his self-compiled zlib. Thanks. However, it changes nothing. I still can''t use "-lz" in the linker options, which works with all other libraries. Why is this?

Sorry, I haven''t yet had the chance to try my compiled program on another computer; however I have the feeling that somehow it won''t work - the binary that came with Dev-C++ should''ve been statically linking too, shouldn''t it?


"George W. Bush Geography Simplification Initiative"

More info on George W. Bush
My Homepage (C++ SDL OpenGL Game Programming)
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/
smart_idiot
smart_idiot
What are the unresolved dependencies?
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
randomZ
randomZ
OK, here they go:


[Linker error] undefined reference to `inflateInit_''
[Linker error] undefined reference to `inflateInit_''
[Linker error] undefined reference to `inflate''
[Linker error] undefined reference to `inflateEnd''
[Linker error] undefined reference to `crc32''
[Linker error] undefined reference to `crc32''
[Linker error] undefined reference to `inflateReset''
[Linker error] undefined reference to `inflate''
[Linker error] undefined reference to `inflateReset''
[Linker error] undefined reference to `inflateReset''
[Linker error] undefined reference to `inflate''
[Linker error] undefined reference to `inflateReset''


This is with -lz in the linker options, but not with the direct path to libz.a. Note that it doesn''t complain about a missing file.


"George W. Bush Geography Simplification Initiative"

More info on George W. Bush
My Homepage (C++ SDL OpenGL Game Programming)
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/
smart_idiot
smart_idiot
The only 2 things I can think of is that Dev-C++ has been set up incorrectly (make sure ''D:\Programme\Dev-C++\lib\'' is in the list under compiler settings/directories/libraries) or you''re using an older copy of mingw32 which doesn''t understand the way the names are mangled in the library. Since it works if you give the full path, that probably isn''t the problem.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other
randomZ
randomZ
Hm. Interesting.
I just moved -lz in the linker options *below* -lpng, which uses -lz, and now it works.
OK, I could have thought about this earlier.

Can somebody tell me more details about the order the library inclusions have to be written?


"George W. Bush Geography Simplification Initiative"

More info on George W. Bush
My Homepage (C++ SDL OpenGL Game Programming)


I am a signature virus. Please add me to your signature so that I may multiply.
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.