olety / ghostplusplus

Preserving the wc3 hostbot
http://code.google.com/p/ghostplusplus
Other
0 stars 0 forks source link

libgmp not listed in ghost++ linking process. #126

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download either ghost-17.1.zip or the SVN source
2. Build bncsutil
3. Build StormLib
4. Build ghost++

What is the expected output?
g++ -o ./ghost++ bncsutilinterface.o bnet.o bnetprotocol.o bnlsclient.o 
bnlsprotocol.o commandpacket.o config.o crc32.o csvparser.o game.o game_admin.o 
game_base.o gameplayer.o gameprotocol.o gameslot.o ghost.o ghostdb.o 
ghostdbmysql.o ghostdbsqlite.o gpsprotocol.o language.o map.o packed.o replay.o 
savegame.o sha1.o socket.o stats.o statsdota.o statsw3mmd.o util.o sqlite3.o 
-L. -L../bncsutil/src/bncsutil/ -L../StormLib/stormlib/ -lbncsutil -lgmp 
-lpthread -ldl -lz -lStorm -lmysqlclient_r -lboost_date_time-mt 
-lboost_thread-mt -lboost_system-mt -lboost_filesystem-mt -lrt
ghostpp@casper:~/ghost-0-svn/ghost>

What do you see instead?
g++ -o ./ghost++ bncsutilinterface.o bnet.o bnetprotocol.o bnlsclient.o 
bnlsprotocol.o commandpacket.o config.o crc32.o csvparser.o game.o game_admin.o 
game_base.o gameplayer.o gameprotocol.o gameslot.o ghost.o ghostdb.o 
ghostdbmysql.o ghostdbsqlite.o gpsprotocol.o language.o map.o packed.o replay.o 
savegame.o sha1.o socket.o stats.o statsdota.o statsw3mmd.o util.o sqlite3.o 
-L. -L../bncsutil/src/bncsutil/ -L../StormLib/stormlib/ -lbncsutil -lpthread 
-ldl -lz -lStorm -lmysqlclient_r -lboost_date_time-mt -lboost_thread-mt 
-lboost_system-mt -lboost_filesystem-mt -lrt
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to 
`__gmp_randseed_ui'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_init2'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to 
`__gmpz_init_set_str'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to 
`__gmpz_powm_ui'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to 
`__gmpz_urandomb'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_sub'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to 
`__gmpz_init_set'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to 
`__gmp_randclear'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to 
`__gmp_randinit_default'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_clear'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_mod'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_import'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_add'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to 
`__gmpz_init_set_ui'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_init'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_mul_ui'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to 
`__gmpz_urandomm'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_export'
../bncsutil/src/bncsutil//libbncsutil.so: undefined reference to `__gmpz_powm'
collect2: ld returned 1 exit status
make: *** [ghost++] Error 1
ghostpp@casper:~/ghost-0-svn/ghost>

What version of the product are you using? On what operating system?
This is reproducible with either the current SVN or ghostplusplus-17.1.zip on 
Ubuntu Oneiric 11.10. 

libgmp-dev 2:5.0.1+dfsg-7ubuntu2

Please provide any additional information below.

The fix is in the diff below:
====== cut ===========================================================

Index: ghost/Makefile
===================================================================
--- ghost/Makefile      (revision 579)
+++ ghost/Makefile      (working copy)
@@ -4,7 +4,7 @@
 CC = gcc
 DFLAGS = -DGHOST_MYSQL
 OFLAGS = -O3
-LFLAGS = -L. -L../bncsutil/src/bncsutil/ -L../StormLib/stormlib/ -lbncsutil 
-lpthread -ldl -lz -lStorm -lmysqlclient_r -lboost_date_time-mt 
-lboost_thread-mt -lboost_system-mt -lboost_filesystem-mt
+LFLAGS = -L. -L../bncsutil/src/bncsutil/ -L../StormLib/stormlib/ -lbncsutil 
-lgmp -lpthread -ldl -lz -lStorm -lmysqlclient_r -lboost_date_time-mt 
-lboost_thread-mt -lboost_system-mt -lboost_filesystem-mt
 CFLAGS =

 ifeq ($(SYSTEM),Darwin)
====== cut ===========================================================

It is important that -lgmp exist AFTER -lbncsutil otherwise the linking process 
will fail.

Original issue reported on code.google.com by ayo...@gmail.com on 5 Feb 2012 at 4:36