QtCreator and pkg-config
QtCreator and pkg-config
我将一个makefile项目导入Qt creator,以便进行更高效的开发。当我在终端中使用 make 时:
g++ Size3.o SteerableTests.o MyLib.o Tensor.o Cube.o Steerable.o -lUnitTest++ `pkg-config --libs opencv` -o steerable
它编译成功。但是当使用QtCreator的构建选项时,它一直说pkg-config找不到opencv。如何设置QtCreator的环境路径?
11:35:21: Starting: "/usr/bin/make" all
g++ Size3.o SteerableTests.o MyLib.o Tensor.o Cube.o Steerable.o -lUnitTest++ `pkg-config --libs opencv` -o steerable
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
我的猜测是环境变量PKG_CONFIG_PATH
设置在你的shell中,而不是在QtCreator的环境中。
我能想到的最简单的解决方法是在Makefile
中显式设置它,例如
export PKG_CONFIG_PATH=/the/path
要查找/the/path
,请尝试在 shell 中echo $PKG_CONFIG_PATH
或使用locate
(最好)或find
查找opencv.pc
。
相关文章:
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- C++核心准则 C35 对于接口类"A base class destructor should be either public and virtual, or protected and nonv
- 为什么C++逐位AND运算符在不同大小的操作数中表现为这样
- 为什么 Clang 不允许"and"作为函数名称?
- 位阵列上的快速AND运算
- 是否可以在 C++03 中定义'move-and-swap idiom'等效项
- Opencv4 使用 pkg-config 给出未定义的引用错误
- Cygwin pkg-config/protobuf filepath issues
- 如何在Visual Studio Code中使用'pkg-config gtkmm-3.0 --cflags --lib
- 当 pkg-config 不能解决 opencv 'undefined reference'编译问题时,如何解决它?
- 如何在CMAKE(JUCI )中使用PKG-Config
- GTKMM-3.0:使用PKG-Config的程序构建失败的MSYS2 NetBeans
- 如何将 pkg-config 添加到生成文件
- QtCreator and pkg-config
- pkg-config 在 Cygwin 上不起作用
- g++编译器选项使用' pkg-config..的结果是-I(directory) -I是什么意思?
- CMake and Config/Modules find_package
- 为什么pkg-config——libs opencv返回库位置而不是库本身?
- 如何在CMake的CXX_FLAGS中包含“pkg-config——cflags——libs gtk+-2.0”
- /找不到bin/sh:pkg-config:命令