其他分享
首页 > 其他分享> > JNI odx bridge install dependent libs

JNI odx bridge install dependent libs

作者:互联网

please copy bellow content to Markdown editor for better reading.

#dependency libs

* libtool
* libxml2
* cjson
* gtest
* glog
* gflags

 

#install guidance on centOS

>* `PKG_CONFIG_PATH`
how to find current `PKG_CONFIG_PATH` by `pkg-config --variable pc_path pkg-config` and
`export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig:/usr/local/lib64/pkgconfig/:/usr/local/lib/pkgconfig/`

>* `m4` check not exist then `sudo yum install m4`
>* `g++` check not exist then `sudo yum install gcc-c++`
>* `cmake` check not exist then `sudo yum install cmake`
>* `libxml2` install by yum, `sudo yum install libxml2`
>* `libtool` install by grade, reference: `https://www.quyu.net/info/856.html`, wget download and make
>* `glib` install by yum, `sudo yum install glib2-devel.x86_64`
>* `gtest` install by source, `sh $ git clone https://github.com/google/googletest.git $ cd googletest/ $ mkdir build $ cd build $ cmake .. $ make $ sudo make install`
>* `cjson` install by source, `https://github.com/arnoldlu/cJSON.git` same as `gtest`
>* `glog` install by yum, `sudo yum install glog-devel`
>* `gflags` install by yum, `sudo yum install gflags-devel`

 

compile to lib cmd

```
cd sourc_code_dir/

g++ -fPIC ../odx/odxd.cpp OdxProxy.cpp -shared -o libjodx.so -I/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-7.b10.el7.x86_64/include \
-I/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-7.b10.el7.x86_64/include/linux \
-I/usr/include/libxml2 -I/usr/local/include/cjson \
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include/ \
-I/usr/include/gio-unix-2.0/ \
-I../odx \
-L/usr/local/lib64/pkgconfig/../../lib64 -lgtest -lpthread -lxml2 -L/usr/local/lib -lcjson -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lglog
```

 

that is all.

 

标签:odx,bridge,2.0,dependent,sudo,yum,usr,install,include
来源: https://www.cnblogs.com/sinsonglew/p/11581746.html