Jun 29, 2009

Compile seagull-1.8.0.1 on RHLS 5.3 X64

Download seagull source package (seagull-1.8.0.1-svn.tar.gz) from http://gull.sourceforge.net/download/index.html.

Unpack the package, follow the manual (http://gull.sourceforge.net/doc/core.html#Compiling+Seagull+from+source+code). you will end up with an error:
-----------------------------------------
cc1plus: warnings being treated as errors
protocol-text/C_MessageText.cpp: In member function ‘C_ProtocolFrame::_msg_error_code C_MessageText::EncodeWithContentLength(int)’:
protocol-text/C_MessageText.cpp:62: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
protocol-text/C_MessageText.cpp:62: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘size_t’
make[1]: *** [/tmp/seagull.svn/work-1.8.0.1/C_MessageText.o] Error 1
-----------------------------------------
This is caused by -Werror flag in the compilation option. Modify build.conf, remove all -Werror flag, you can continue with the compilation process. However, in the linking stage, you get the following error:
-----------------------------------------
[Linking /tmp/seagull.svn/build-1.8.0.1/libtrans_ip.so]
/usr/bin/ld: /tmp/seagull.svn/work-1.8.0.1/C_RegExp.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/tmp/seagull.svn/work-1.8.0.1/C_RegExp.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [/tmp/seagull.svn/build-1.8.0.1/libtrans_ip.so] Error 1
make[1]: Leaving directory `/tmp/seagull.svn'
make: *** [all_libtrans_ip.so] Error 2
-----------------------------------------
By adding -fPIC to BUILD_EXE_CC_FLAGS_LINUX and BUILD_LIB_CC_FLAGS_LINUX options defined in build.conf and run ./build.ksh -target clean and then rebuild, you finally get the seagull build successfully.

1 comment:

明白 said...

I love... readding.., ....................and ..thanks.. for.. your.. artical.

About Me

My photo