简体   繁体   English

QT项目中的符号查找错误问题

[英]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.

相关问题 Qt:Centos 6.7中的会话管理错误和符号查找错误 - Qt: Session management error and Symbol lookup error in Centos 6.7 传递给qt插件的对象的调用方法产生符号查找错误 - Calling method of object passed to qt plugin yields symbol lookup error 无法将boost库连接到我的项目“符号查找错误” - Unable to connect boost library to my project “symbol lookup error” 与 Qt 交叉编译到 Raspberry Pi 3B+ 地址簿(协议缓冲区) - 错误符号查找错误 - Cross-compile with Qt to Raspberry Pi 3B+ the addressbook (Protocol Buffer) - error symbol lookup error 从共享库中使用我的Qt插件时出现符号查找错误 - symbol lookup error when using my Qt plugin from inside of shared library 部署后的Linux qt应用程序-符号查找错误:libQt5Core.so.5未定义符号:uncv_getDefaultName_56 - Linux qt application after deployment - symbol lookup error: libQt5Core.so.5 undfined symbol: uncv_getDefaultName_56 符号查找错误:未定义的符号:_alloca - symbol lookup error: undefined symbol: _alloca Java JNI符号查找错误 - Java JNI symbol lookup error 如何捕捉符号查找错误 - how to catch symbol lookup error 符号存在时为什么出现“符号查找错误”、“未定义符号” - Why "symbol lookup error", "undefined symbol" when the symbol exists
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM