[英]Symbol lookup error problem in QT project
I am trying to add a new library to the Qt plugins folder.我正在尝试向 Qt 插件文件夹添加一个新库。
That plugin is located here: http://qt.gitorious.org/qt-solutions/qt-solutions/trees/master/qtjp2imageformat该插件位于: http://qt.gitorious.org/qt-solutions/qt-solutions/trees/master/qtjp2imageformat
It says that it requires jasper to build, so I downloaded jasper, and built it, generating a libjasper.a in my jasper/lib folder (which is in my home dir, not in /usr or anything)它说它需要 jasper 来构建,所以我下载了 jasper,并构建了它,在我的 jasper/lib 文件夹中生成了一个 libjasper.a(它在我的主目录中,而不是 /usr 或任何东西)
So i built out qtjp2imageformat using the jasper include files, and linking against that libjasper.a file所以我使用 jasper 包含文件构建了 qtjp2imageformat,并链接到该 libjasper.a 文件
here are the relevant lines from the makefile:以下是 makefile 的相关行:
INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++-64 -I. -I/usr/lib64/qt4/include/QtCore -I/usr/lib64/qt4/include/QtGui -I/usr/lib64/qt4/include -I../src -I. -I/home/dcole/software/jasper-1.900.1/include
LIBS = $(SUBLIBS) -L/usr/lib64/qt4/lib64 -L/home/dcole/software/jasper-1.900.1/lib -ljasper -lQtGui -L/usr/lib64/mysql -L/usr/lib64/qt4/lib64 -L/usr/X11R6/lib64 -lQtCore -lpthread
I then put the generated libqtjp2.so in the QT Plugins/imageformats folder, and now when my code runs, and gets to the part where it's going to read a jpeg2000, I get the following: symbol lookup error: /usr/lib64/qt4/plugins/imageformats/libqtjp2.so: undefined symbol: jas_init
然后我将生成的 libqtjp2.so 放在 QT Plugins/imageformats 文件夹中,现在当我的代码运行并到达要读取 jpeg2000 的部分时,我得到以下信息:
symbol lookup error: /usr/lib64/qt4/plugins/imageformats/libqtjp2.so: undefined symbol: jas_init
So I think jas_init comes from jasper - how come my QT project can't see that?所以我认为 jas_init 来自 jasper - 我的 QT 项目怎么看不到? Do I need to also make MY project link against libjasper.a, or have I linked the library wrong when I built libqtjp2?
我是否还需要针对 libjasper.a 建立我的项目链接,或者我在构建 libqtjp2 时是否将库链接错误?
Thanks谢谢
You didn't say which distro you are using, but the simplest would be to install the jasper package and link your application to it's library.您没有说您使用的是哪个发行版,但最简单的方法是安装 jasper package 并将您的应用程序链接到它的库。
by the way, did you build static library ( .a
) or dynamic ( .so
)?顺便说一句,您是构建 static 库(
.a
)还是动态库( .so
)? Try building a dynamic library尝试构建动态库
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.