HBase的C客户端编译问题

编写HBase的C语言客户端,通过JNI调用JVM来实现
编译过程中出现如下错误
gcc -L/home/hadoop/media/jdk1.6.0_14/jre/lib/amd64/server -shared -o "libUdmslogParser"  ./bytesUtil.o ./delete.o ./get.o ./hashtable.o ./hbase.o ./hdfs.o ./hdfsUtil.o ./htable.o ./jniHelper.o ./put.o ./recordFile.o ./result.o   -ljvm
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: ./bytesUtil.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

在Link的时候加上-fPIC,仍然报错。google得知,是在compile的时候加上-fPIC,重编译通过
搞定~

猜你喜欢

转载自leongfans.iteye.com/blog/1144178