Page 1 of 1

Failed to compile server

Posted: 11 Oct 2009, 16:02
by maever
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?

Re: Failed to compile server

Posted: 12 Oct 2009, 04:35
by Jaxad0127
The makefile should detect 64-bit and adjust automatically.

Re: Failed to compile server

Posted: 12 Oct 2009, 07:44
by maever
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?

Re: Failed to compile server

Posted: 12 Oct 2009, 14:06
by Jaxad0127
Is your machine x64 or x86_64? The former won't likely work, the latter should.

Re: Failed to compile server

Posted: 12 Oct 2009, 14:20
by maever
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

Re: Failed to compile server

Posted: 13 Oct 2009, 11:05
by Rotonen
Please do point your linker to where you have your 32bit zlib installed.

Re: Failed to compile server

Posted: 16 Oct 2009, 18:31
by maever
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.