JNI符号查找错误

时间:2013-12-12 04:10:49

标签: java c++ linux java-native-interface chromium-embedded

我正在尝试在x86-64架构的Linux下在Linux中嵌入Chromium,但我遇到了一个问题:

执行此命令后:

   /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:符号查找错误:/ home / xxx / code / workspace / eclipse_workspace / cef-swt-gtk-linux-x86_64-native / libcef -swt-gtk-linux-x86_64.so:未定义的符号:_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)

任何人都可以告诉我如何解决这个问题?

由于

0 个答案:

没有答案