Failed to compile server

Ask for help regarding any technical issue or report any bug or OS independent issues.
Post Reply
maever
Peon
Peon
Posts: 4
Joined: Sun Oct 11, 2009 3:48 pm

Failed to compile server

Post by maever » Sun Oct 11, 2009 4:02 pm

Good day,

I am interested in this project so i tried to setup my own server in a Debian linux 86_64x enviroment (64bit).
Following this guide however, I am not able to get my server to compile properly.

The error I get is as followed:

Code: Select all

gcc -m32 -pipe -o ../../map-server obj/tmw.o obj/magic-interpreter-lexer.o obj/magic-interpreter-parser.o obj/magic-interpreter-base.o obj/magic-expr.o obj/magic-stmt.o obj/magic.o obj/map.o obj/chrif.o obj/clif.o obj/pc.o obj/npc.o obj/chat.o obj/path.o obj/itemdb.o obj/mob.o obj/script.o obj/storage.o obj/skill.o obj/skill-pools.o obj/atcommand.o obj/battle.o obj/intif.o obj/trade.o obj/party.o obj/guild.o ../common/core.o ../common/socket.o ../common/timer.o ../common/grfio.o ../common/db.o ../common/lock.o ../common/nullpo.o ../common/malloc.o ../common/mt_rand.o -lz -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib32/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/../lib32/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib32/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[1]: *** [map-server] Error 1
make[1]: Leaving directory `/home/tmw/eathena/src/map'
It would appear that the reference to "zlib" is an incorrect one.

I have the feeling that this might have to do with my 64bit enviroment and the lack of support for this in the makefile.
Also there appears to be no ./configure command which could resolve such issues.
for the record, I DO have "zlib1g-dev" installed

anyone have some ideas?
User avatar
Jaxad0127
TMW Adviser
TMW Adviser
Posts: 4209
Joined: Thu Nov 01, 2007 6:35 pm
Location: Internet

Re: Failed to compile server

Post by Jaxad0127 » Mon Oct 12, 2009 4:35 am

The makefile should detect 64-bit and adjust automatically.
Image
maever
Peon
Peon
Posts: 4
Joined: Sun Oct 11, 2009 3:48 pm

Re: Failed to compile server

Post by maever » Mon Oct 12, 2009 7:44 am

That might be so but that doesn't change the fact that i'm experiencing this error.

the Makefile contains the following:

Code: Select all

ifeq ($(shell uname -m), x86_64)
M32=-m32
endif
I don't know what this means but i'm beginning to suspect that eathena might not support a 64bit enviroment.

Can anyone confirm this?
User avatar
Jaxad0127
TMW Adviser
TMW Adviser
Posts: 4209
Joined: Thu Nov 01, 2007 6:35 pm
Location: Internet

Re: Failed to compile server

Post by Jaxad0127 » Mon Oct 12, 2009 2:06 pm

Is your machine x64 or x86_64? The former won't likely work, the latter should.
Image
maever
Peon
Peon
Posts: 4
Joined: Sun Oct 11, 2009 3:48 pm

Re: Failed to compile server

Post by maever » Mon Oct 12, 2009 2:20 pm

The error I get is (still) as followed:

Code: Select all

gcc -m32 -pipe -o ../../map-server obj/tmw.o obj/magic-interpreter-lexer.o obj/magic-interpreter-parser.o obj/magic-interpreter-base.o obj/magic-expr.o obj/magic-stmt.o obj/magic.o obj/map.o obj/chrif.o obj/clif.o obj/pc.o obj/npc.o obj/chat.o obj/path.o obj/itemdb.o obj/mob.o obj/script.o obj/storage.o obj/skill.o obj/skill-pools.o obj/atcommand.o obj/battle.o obj/intif.o obj/trade.o obj/party.o obj/guild.o ../common/core.o ../common/socket.o ../common/timer.o ../common/grfio.o ../common/db.o ../common/lock.o ../common/nullpo.o ../common/malloc.o ../common/mt_rand.o -lz -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib32/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/../lib32/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/bin/../lib/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib32/libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[1]: *** [map-server] Error 1
make[1]: Leaving directory `/home/tmw/eathena/src/map'
As for my enviroment:

Code: Select all

maever:/home/tmw/eathena# uname -a
Linux maever.gerrit.nl 2.6.26-1-amd64 #1 SMP Sat Jan 10 17:57:00 UTC 2009 x86_64 GNU/Linux
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: Wed Sep 08, 2004 8:48 pm
Location: Espoo, Finland

Re: Failed to compile server

Post by Rotonen » Tue Oct 13, 2009 11:05 am

Please do point your linker to where you have your 32bit zlib installed.
This message used to be meaningful.
maever
Peon
Peon
Posts: 4
Joined: Sun Oct 11, 2009 3:48 pm

Re: Failed to compile server

Post by maever » Fri Oct 16, 2009 6:31 pm

I found out what the problem was.
It indeed had to do with incompatible libraries because of the 64bit architecture.

You simply need to install the 32bit libraries of libz which are conveniently named: lib32z1 and lib32z1-dev on Debian and Ubuntu.

So install those using apt-get and you should be fine.

It compiled without problems after I had done this.
Post Reply