qmake 不会将 .pro 文件中的库添加到 makefile

编程入门 行业动态 更新时间:2024-10-11 11:20:10
本文介绍了qmake 不会将 .pro 文件中的库添加到 makefile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试使用 qmake 构建一个 QT 项目.为此,我需要 boost 库.

I try to build an QT project using qmake. For this I need the boost library.

LIBS += -L/usr/lib/ \ -lboost_system \ -lboost_filesystem

但是在运行 qmake 之后,这些库并没有添加到 makefile 中:

But after running qmake, these libraries are not added to the makefile:

LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lQt5MultimediaWidgets -L/build/buildd/qtmultimedia-opensource-src-5.0.1/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/x86_64-linux-gnu -lQt5OpenGL -lQt5Multimedia -lpulse -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread

正如预期的那样,链接器打印了许多错误,例如

As expected, the linker prints many error like

/usr/include/boost/system/error_code.hpp:214: error: undefined reference to boost::system::generic_category()

如果您想查看整个 .pro 文件,请转到 raw.github/francisengelmann/FabScan100/master/qtTest/qtTest.pro

If you want to take a look to the whole .pro file, go to raw.github/francisengelmann/FabScan100/master/qtTest/qtTest.pro

我也遇到了与 opencv 类似的问题.有谁知道如何解决这个问题?

I am also having a similar problem with opencv. Does anyone know how to solve this issue ?

推荐答案

更改.pro文件后需要再次运行qmake.仅删除您的构建目录是不够的.

You need to run qmake again after changing the .pro file. Just removing your build directory is not enough.

另外你确定你的 qmake 目标是 linux-g++ 吗?INCLUDEPATH 是否有效?

Also are you sure your qmake target is linux-g++? Does the INCLUDEPATH work?

更多推荐

qmake 不会将 .pro 文件中的库添加到 makefile

本文发布于:2023-10-30 04:54:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1541828.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:会将   文件   qmake   makefile   pro

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!