在Ubuntu 8.10 amd64编译安装Player-2.1.*版本时遇到错误:
root@ubuntu:/opt/player-2.1.1# make
make all-recursive
make[1]: Entering directory `/opt/player-2.1.1'
Making all in replace
make[2]: Entering directory `/opt/player-2.1.1/replace'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../libplayercore -I../client_libs/libplayerc++ -I../client_libs/libplayerc -g -O2 -MT dummy.lo -MD -MP -MF .deps/dummy.Tpo -c -o dummy.lo dummy.c
../libtool: line 847: X--tag=CC: command not found
../libtool: line 880: libtool: ignoring unknown tag : command not found
../libtool: line 847: X--mode=compile: command not found
../libtool: line 1014: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 1015: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 1158: Xgcc: command not found
../libtool: line 1158: X-DHAVE_CONFIG_H: command not found
../libtool: line 1158: X-I.: command not found
../libtool: line 1158: X-I..: command not found
../libtool: line 1158: X-I../libplayercore: No such file or directory
../libtool: line 1158: X-I../client_libs/libplayerc++: No such file or directory
../libtool: line 1158: X-I../client_libs/libplayerc: No such file or directory
../libtool: line 1158: X-g: command not found
../libtool: line 1158: X-O2: command not found
../libtool: line 1158: X-MT: command not found
../libtool: line 1158: Xdummy.lo: command not found
../libtool: line 1158: X-MD: command not found
../libtool: line 1158: X-MP: command not found
../libtool: line 1158: X-MF: command not found
../libtool: line 1158: X.deps/dummy.Tpo: No such file or directory
../libtool: line 1158: X-c: command not found
../libtool: line 1211: Xdummy.lo: command not found
../libtool: line 1216: libtool: compile: cannot determine name of library object from `': command not found
make[2]: *** [dummy.lo] Error 1
make[2]: Leaving directory `/opt/player-2.1.1/replace'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/player-2.1.1'
make: *** [all] Error 2
player-2.1.*采用libtool作为编译工具,这个错误说明系统中的libtool与player自带的ltmain.sh文件中定义的libtool版本号不一致.
解决办法就是找到系统libtool的ltmain.sh替换player目录下的同名文件.
二: 在server/drivers/vectormap目录下的vec2map.cc 及 dbconn.cc在编译时报错 :
vec2map.cc: In member function ‘void Vec2Map::dumpFeature(GEOSGeometry*, std::vector<player_segment, std::allocator<player_segment> >&)’:
vec2map.cc:299: error: invalid conversion from ‘const GEOSCoordSequence*’ to ‘GEOSCoordSequence*’
vec2map.cc:311: error: invalid conversion from ‘const GEOSCoordSequence*’ to ‘GEOSCoordSequence*’
vec2map.cc:344: error: invalid conversion from ‘const GEOSGeometry*’ to ‘GEOSGeometry*’
vec2map.cc:344: error: initializing argument 1 of ‘void Vec2Map::dumpFeature(GEOSGeometry*, std::vector<player_segment, std::allocator<player_segment> >&)’
vec2map.cc:346: error: invalid conversion from ‘const GEOSGeometry*’ to ‘GEOSGeometry*’
vec2map.cc:346: error: initializing argument 1 of ‘void Vec2Map::dumpFeature(GEOSGeometry*, std::vector<player_segment, std::allocator<player_segment> >&)’
vec2map.cc:353: error: invalid conversion from ‘const GEOSGeometry*’ to ‘GEOSGeometry*’
vec2map.cc:353: error: initializing argument 1 of ‘void Vec2Map::dumpFeature(GEOSGeometry*, std::vector<player_segment, std::allocator<player_segment> >&)’
make[4]: *** [vec2map.lo] Error 1
make[4]: Leaving directory `/host/player-2.1.1/server/drivers/vectormap'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/host/player-2.1.1/server/drivers'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/host/player-2.1.1/server'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/host/player-2.1.1'
make: *** [all] Error 2
关于GEOSGeometry和GEOSCoordSequence的定义,参考系统的Geos.h文件
解决办法:用const_cast强制转换.
也可以到http://download.csdn.net/source/1466053 下载dbconn.cc然后拷贝到player的相应目录下