LIBS += \ # -L"$$EXT_ROOT/google_protocol_buffer/bin_linux" -lprotobuf \ # -L"$$EXT_ROOT/boost/bin_linux" -lboost_thread \ # -L"$$OUTPUT_ROOT/bin" -lgccomm \ -L"$$PWD/../../../External/google_protocol_buffer/bin_linux" -lprotobuf \ -L"$$PWD/../../../External/boost/bin_linux" -lboost_thread \ -L"$$PWD/../../../UIH/bin" -lgccomm
时间: 2024-01-03 15:04:11 浏览: 89
这是一个 Qt 项目中的 .pro 文件中的 LIBS 变量的赋值语句,其中包含了多个库文件的链接选项。其中 -L 选项指定了库文件所在的路径,-l 选项指定了需要链接的库文件名。具体来说,这个 .pro 文件中包含了以下库文件的链接选项:
- google_protocol_buffer/bin_linux/libprotobuf.so
- boost/bin_linux/libboost_thread.so
- OUTPUT_ROOT/bin/libgccomm.so
- ../../../External/google_protocol_buffer/bin_linux/libprotobuf.so
- ../../../External/boost/bin_linux/libboost_thread.so
- ../../../UIH/bin/libgccomm.so
这些库文件的具体作用需要结合代码来判断。
相关问题
#!/bin/bash # Assets TEST_IMG=demo.png SDK_ROOT=$PWD TEST_ROOT=$PWD BIN_NAME=test_demo DEVICE_TEST_PATH=/data/local/tmp/ts_ai_sdk_test MODEL_PATH=/sdcard/models RUSULT=/data/local/tmp/ts_ai_sdk_test/results/ RUNTIME=DSP adb root # Push test assets adb shell rm -rf $DEVICE_TEST_PATH # adb shell rm -rf $MODEL_PATH adb shell mkdir -p $DEVICE_TEST_PATH/jpgs adb shell mkdir -p $DEVICE_TEST_PATH/results/post_result adb shell mkdir -p $DEVICE_TEST_PATH/results/img_result #adb shell mkdir -p $MODEL_PATH adb push images/* $DEVICE_TEST_PATH/jpgs # Push SNPE libraries adb push ${SDK_ROOT}/libs/ $DEVICE_TEST_PATH adb push ${SDK_ROOT}/models/model.exf $DEVICE_TEST_PATH/ # Push executable adb push build/$BIN_NAME $DEVICE_TEST_PATH # Test adb shell "chmod +x $DEVICE_TEST_PATH/$BIN_NAME" echo "Running on Android device ..." echo "LD_LIBRARY_PATH='$DEVICE_TEST_PATH/libs' $DEVICE_TEST_PATH/$BIN_NAME $DEVICE_TEST_PATH/jpgs $RUSULT $DEVICE_TEST_PATH/model.exf" echo "Done." adb shell "LD_LIBRARY_PATH='$DEVICE_TEST_PATH/libs' $DEVICE_TEST_PATH/$BIN_NAME $DEVICE_TEST_PATH/jpgs $RUSULT $DEVICE_TEST_PATH/model.exf" # Pull result adb pull $DEVICE_TEST_PATH/results/ . sleep 1改为bat脚本
将该脚本转换为 Windows 的 batch 脚本,需要进行以下修改:
1. 更改第一行为 `@echo off`,表示关闭命令回显。
2. 将变量的赋值方式从 `$变量名=值` 改为 `set 变量名=值`。
3. 将 `adb` 命令行中的路径分隔符 `/` 改为 Windows 下的路径分隔符 `\`。
4. 在执行命令行时需要使用 `call` 命令。
修改后的 batch 脚本如下:
```
@echo off
REM Assets
set TEST_IMG=demo.png
set SDK_ROOT=%cd%
set TEST_ROOT=%cd%
set BIN_NAME=test_demo
set DEVICE_TEST_PATH=/data/local/tmp/ts_ai_sdk_test
set MODEL_PATH=/sdcard/models
set RESULT=/data/local/tmp/ts_ai_sdk_test/results/
set RUNTIME=DSP
REM Push test assets
adb root
adb shell rm -rf %DEVICE_TEST_PATH%
adb shell mkdir -p %DEVICE_TEST_PATH%/jpgs
adb shell mkdir -p %DEVICE_TEST_PATH%/results/post_result
adb shell mkdir -p %DEVICE_TEST_PATH%/results/img_result
adb push images\* %DEVICE_TEST_PATH%/jpgs
REM Push SNPE libraries
adb push %SDK_ROOT%\libs\ %DEVICE_TEST_PATH%
adb push %SDK_ROOT%\models\model.exf %DEVICE_TEST_PATH%\
REM Push executable
adb push build\%BIN_NAME% %DEVICE_TEST_PATH%\
REM Test
adb shell "chmod +x %DEVICE_TEST_PATH%\%BIN_NAME%"
echo Running on Android device ...
echo "LD_LIBRARY_PATH='%DEVICE_TEST_PATH%\libs' %DEVICE_TEST_PATH%\%BIN_NAME% %DEVICE_TEST_PATH%/jpgs %RESULT% %DEVICE_TEST_PATH%/model.exf"
echo Done.
call adb shell "LD_LIBRARY_PATH='%DEVICE_TEST_PATH%\libs' %DEVICE_TEST_PATH%\%BIN_NAME% %DEVICE_TEST_PATH%/jpgs %RESULT% %DEVICE_TEST_PATH%\model.exf"
REM Pull result
adb pull %DEVICE_TEST_PATH%/results/ .
timeout /t 1
```
解释QT += core QT -= gui CONFIG += c++11 TARGET = UavRectifyLoadLIb CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS win32{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../../RasterManager/bin/Debug } else{ DESTDIR = $$PWD/../../../../RasterManager/bin/release } INCLUDEPATH += $$PWD/../../../include/gdal1101 DEPENDPATH += $$PWD/../../../include/gdal1101 } else{ CONFIG(debug, debug|release){ DESTDIR = $$PWD/../../../product/release32 } else{ DESTDIR = $$PWD/../../../product/release32 } } # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lUAVAutoRectifyMt -lUAVAutoRectify -lUAVAutoRectifyFi INCLUDEPATH += $$PWD/../include DEPENDPATH += $$PWD/../include unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_core unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../lib/opencvf249/ -lopencv_imgproc INCLUDEPATH += $$PWD/../../../lib/opencvf249 DEPENDPATH += $$PWD/../../../lib/opencvf249 unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_core #unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_highgui unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgproc unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_features2d unix:!macx: LIBS += -L$$PWD/../../../../../../../usr/local/lib/ -lopencv_imgcodecs INCLUDEPATH += $$PWD/../../../../../../../usr/local/include DEPENDPATH += $$PWD/../../../../../../../usr/local/include unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lDEMDriver unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lProjection unix:!macx: LIBS += -L$$PWD/../../../product/release32/ -lIImage_gC QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
这是一个Qt项目的.pro文件,其中包含了该项目需要使用的库、头文件、源文件等信息的配置。
QT += core 表示该项目需要使用Qt的核心模块。
QT -= gui 表示该项目不需要使用Qt的GUI模块。
CONFIG += c++11 表示该项目需要使用C++11标准。
TARGET = UavRectifyLoadLIb 表示该项目的目标文件名为UavRectifyLoadLIb。
CONFIG += console 表示该项目是控制台应用程序。
CONFIG -= app_bundle 表示该项目不需要生成AppBundle。
TEMPLATE = app 表示该项目是一个应用程序。
SOURCES += main.cpp 表示该项目的源文件为main.cpp。
DEFINES += QT_DEPRECATED_WARNINGS 表示该项目使用了Qt中已经被废弃的API,会产生编译警告。
win32{...} else{...} 表示如果是win32系统,执行前面的语句,否则执行后面的语句。这里是设置DESTDIR的路径。
INCLUDEPATH 和 DEPENDPATH 分别表示头文件和依赖路径。
LIBS 表示需要链接的库文件。
QMAKE_CXXFLAGS_RELEASE 和 QMAKE_LFLAGS_RELEASE 分别表示编译和链接时的参数。
总之,这是一个Qt项目的.pro文件,通过配置各种参数和库文件来构建应用程序。
阅读全文