ZLib

250 views
Skip to first unread message

Abyss

unread,
Dec 7, 2006, 1:34:52 PM12/7/06
to C++ Game Programming
Hello

I'm the lead programmer of a game known as Asguard. It is coded purely
in C, for a Linux system. I'm not the original programmer, so I'm a bit
n00bish at knowing some of the code used, and some of the libraries
linked to.

We have a prebuilt Makefile, that has always worked for us. Recently,
we have been switching servers and are getting our own server going.
When we made the switch, we got many errors during the make. We found
one major problem was a missing stdlib on the new system. We fixed this
by installing gcc and build-essential through apt-get.

Then, we got errors related to a missing zlib.h. A google search later,
I had the zlib installed, as well. I followed the instructions present
in the zlib's Makefile, and I have it installed.

The error pertaining to the missing zlib.h has disappeared, but we
still have another error, related to zlib. Google hasn't turned up too
much useful for me, but maybe it's going over my head.

If anyone could provide some help on getting this to compile correctly
(it works on the other server, so it's not the actual code itself), I
would be thankful.

Here's the errors we are getting:
.obj/server.o: In function `csend':
/home/main/server.c:259: undefined reference to `deflateEnd'
.obj/server.o: In function `new_player':
/home/main/server.c:172: undefined reference to `deflateInit_'
.obj/server.o: In function `compress_ticks':
/home/main/server.c:369: undefined reference to `deflate'
.obj/server.o: In function `csend':
/home/main/server.c:259: undefined reference to `deflateEnd'
/home/main/server.c:259: undefined reference to `deflateEnd'
/home/main/server.c:259: undefined reference to `deflateEnd'
/home/main/server.c:259: undefined reference to `deflateEnd'
.obj/server.o: In function `rec_player':
/home/main/server.c:331: undefined reference to `deflateEnd'
.obj/server.o:/home/main/server.c:305: more undefined references to
`deflateEnd' follow
collect2: ld returned 1 exit status
make: *** [server] Error 1

You can reach me by email (Ab...@AsguardOnline.com) if you need
anything else to figure out what could be the problem.

Again, I thank you for any assistance you may provide.

--Abyss

JeffCameron

unread,
Dec 19, 2006, 1:55:37 PM12/19/06
to C++ Game Programming
Hi there, Abyss. Looks like you need to link with zlib in order to get
rid of those errors.

If you have apt-get, use it to install zlib properly. Simply
downloading zlib.h and putting it in your include directory won't help.
You should be able to do this using something like

apt-get zlib install

If this does not work, then do a Google search for "install zlib
debian" and you will probably find some useful tips.

Once you have installed zlib, then you need to link zlib in with your
game in order for it to compile. There should be a line in your
makefile (or a couple of lines) which link the application. You need
to add "-lz" to the end of that line to tell GCC to link zlib into your
application.

I have just briefly skimmed over the solution to this problem. If you
have any troubles, email me and I will help you.

Jeff Cameron

Abyss Blackrose

unread,
Dec 19, 2006, 2:16:58 PM12/19/06
to C-Game-Pr...@googlegroups.com
Thanks :) I solved the problem already..

I was previously unable to use apt-get, due to a DNS error, but it was fixed, and I found out how to install Zlib with it.

The game's server is running fine, and compilation goes on now.
Infact, the Beta version of Asguard is being released Thursday night.
Feel free to check it out, if you wish :) (http://www.asguardonline.com)

But anyways, thanks for your help :)

--Abyss

d+(--) s:+ a17 C++(++++)$ UL+++ P+ L+(++) E---(--) W+++ N+ o? K? w++(+++) !O M-- V? PS+ PE+ Y+(++) PGP>++ t- ?5 X- R+++ tv+ b+++ DI+ D G e->++++ h! r+>+++ y-(+)
------END GEEK CODE BLOCK------
<a href="http://www.ebb.org/ungeek/">Translate My Geek Code</a>
<a href=" http://www.geekcode.com">Geek Code Home Page</a>
Reply all
Reply to author
Forward
0 new messages