---
title: "HBase的C客户端编译问题"
author: "leongfans"
date: "2011-08-10T09:17:16Z"
tags: []
categories: ["操作系统"]
slug: "hbase-c"
draft: false
lastmod: "2011-08-10T09:17:16Z"
id: 1144178
url: "https://leongfans.iteye.com/blog/1144178"
---

编写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，重编译通过
搞定~