使用基于libzbar的Qt应用程序构建问题

时间:2021-01-12 07:08:04

I am using libzbarQT (libzbarQT.so) in my QT code.I am facing an error while building the code saying "undefined reference to QWidget::qwsEvent(QWSEvent *event)".I am not using this function in my QT code.I want to know which function is internally calling this function so that I can tweak the library a bit. Any suggestions please..

我在我的QT代码中使用libzbarQT(libzbarQT.so)。我在构建代码时遇到错误,说“未定义引用QWidget :: qwsEvent(QWSEvent * event)”。我没有在我的QT代码中使用此函数。我想知道哪个函数在内部调用这个函数,以便我可以稍微调整一下库。有什么建议请..

Thanks in advance for any help.

在此先感谢您的帮助。

PS: I am crosscompiling my code using arm-none-linux-gnueabi-g++ toolchain with LTIB. To solve error '/usr/lib/libzbarqt.so: undefined reference to QX11Info::display()', I have build Qt with X11.Now I am getting error:libzbarqt.so: undefined reference toQWidget::qwsEvent(QWSEvent*)' error.

PS:我正在使用带有LTIB的arm-none-linux-gnueabi-g ++工具链来交叉编译我的代码。要解决错误'/usr/lib/libzbarqt.so:对QX11Info :: display()'的未定义引用,我已经使用X11构建Qt。现在我收到错误:libzbarqt.so:未定义引用QWidget :: qwsEvent(QWSEvent * )'错误。

1 个解决方案

#1


1  

In general, you could make sure that the symbols are present in the library unless it is built without symbols. I usually use the nm -a and objdump utilities for that operation.

通常,您可以确保符号存在于库中,除非它是在没有符号的情况下构建的。我通常使用nm -a和objdump实用程序进行该操作。

More to the point: it seems that the zbar dynamic library that you have was built against the embedded version of Qt rather than the desktop Linux.

更重要的是:您所拥有的zbar动态库似乎是针对Qt的嵌入式版本而不是桌面Linux构建的。

It is an unfortunate issue that both versions have the same dynamic library file names, so things like ldd cannot be much of help.

这两个版本具有相同的动态库文件名是一个不幸的问题,因此像ldd这样的东西不会有太大的帮助。

You will need to make sure to use exactly the same version of Qt installation that the library was built against. This means, if you use the desktop Linux installation for this, it will not work.

您需要确保使用与构建库完全相同的Qt安装版本。这意味着,如果您使用桌面Linux安装,它将无法正常工作。

#1


1  

In general, you could make sure that the symbols are present in the library unless it is built without symbols. I usually use the nm -a and objdump utilities for that operation.

通常,您可以确保符号存在于库中,除非它是在没有符号的情况下构建的。我通常使用nm -a和objdump实用程序进行该操作。

More to the point: it seems that the zbar dynamic library that you have was built against the embedded version of Qt rather than the desktop Linux.

更重要的是:您所拥有的zbar动态库似乎是针对Qt的嵌入式版本而不是桌面Linux构建的。

It is an unfortunate issue that both versions have the same dynamic library file names, so things like ldd cannot be much of help.

这两个版本具有相同的动态库文件名是一个不幸的问题,因此像ldd这样的东西不会有太大的帮助。

You will need to make sure to use exactly the same version of Qt installation that the library was built against. This means, if you use the desktop Linux installation for this, it will not work.

您需要确保使用与构建库完全相同的Qt安装版本。这意味着,如果您使用桌面Linux安装,它将无法正常工作。