2 java314 java314 于 2013.12.12 11:10 提问

JNI 运行错误 symbol lookup error
/usr/lib/jvm/java-6-openjdk-amd64/bin/java -Djava.library.path=../cef-swt-gtk-linux-x86_64-native/ -cp ./target/classes:./target/test-classes:$HOME/.m2/repository/org/eclipse/swt/org.eclipse.swt.gtk.linux.x86_64/3.7.2/org.eclipse.swt.gtk.linux.x86_64-3.7.2.jar com.zxg.cef.swt.test.TestWindow

错误:
/usr/lib/jvm/java-6-openjdk-amd64/bin/java: symbol lookup error: /home/xxx/code/workspace/eclipse_workspace/cef-swt-gtk-linux-x86_64-native/libcef-swt-gtk-linux-x86_64.so: undefined symbol: _Z13CefInitializeRK11CefMainArgsRK13CefStructBaseI17CefSettingsTraitsE9CefRefPtrI6CefAppE

makefile:

OBJS =      cef-swt-gtk-linux-x86_64.o

JAVA_HOME = /usr/lib/jvm/java-6-openjdk-amd64

CXXFLAGS = -fPIC -Wall -fmessage-length=0 -I$(JAVA_HOME)/include -I/usr/local/include/cef3 `pkg-config --cflags gtk+-2.0`

LIBS = -lcef -lffmpegsumo `pkg-config --libs gtk+-2.0`

LDFLAGS := -shared -fpic -Wl,-rpath,/usr/local/lib

CXX = g++

TARGET =    libcef-swt-gtk-linux-x86_64.so

$(TARGET):  $(OBJS)
    $(CXX) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)

all:    $(TARGET)

../cef-swt-gtk-linux-x86_64/target/classes/com/zxg/cef/swt/Cef.class: ../cef-swt-gtk-linux-x86_64/src/main/java/com/zxg/cef/swt/Cef.java
    mvn -f ../cef-swt-gtk-linux-x86_64/pom.xml compile

com_zxg_cef_swt_Cef.h: ../cef-swt-gtk-linux-x86_64/target/classes/com/zxg/cef/swt/Cef.class
    $(JAVA_HOME)/bin/javah -classpath ../cef-swt-gtk-linux-x86_64/target/classes com.zxg.cef.swt.Cef

cef-swt-gtk-linux-x86_64.o: cef-swt-gtk-linux-x86_64.cpp com_zxg_cef_swt_Cef.h
    $(CXX) $(CXXFLAGS) -c -o cef-swt-gtk-linux-x86_64.o cef-swt-gtk-linux-x86_64.cpp

clean:
    rm -f $(OBJS) $(TARGET)
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!