本人开发环境:
为实现debug/release模式下加载不同的动态库,在.pro文件中,实现如下配置:
CONFIG += debug_and_release
CONFIG(debug, debug|release){
INCLUDEPATH += ./ \
/usr/local/opencv3.4.6_debug/include \
/usr/local/opencv3.4.6_debug/include/opencv \
/usr/local/opencv3.4.6_debug/include/opencv2 \
LIBS += /usr/local/opencv3.4.6_debug/lib/libopencv_imgproc.so \
} else {
INCLUDEPATH += ./ \
/usr/local/opencv3.4.6_release/include \
/usr/local/opencv3.4.6_release/include/opencv \
/usr/local/opencv3.4.6_release/include/opencv2 \
LIBS += /usr/local/opencv3.4.6_release/lib/libopencv_imgproc.so \
}
一定要注意{}的换行格式,必须是以下格式
CONFIG += debug_and_release
CONFIG(debug, debug|release){
} else {
}
随意’{’、’}'换行,极可能会导致不起作用。