cmake编译找不到函数:undefined reference

cmake编译配置:

# Find Src file(GLOB_RECURSE SRC_FILE #    ${PROJECT_SRC_ROOT}/../module/InferDetClsV2/*.cpp #    ${PROJECT_SRC_ROOT}/../module/InferChipeakNet/*.cpp #    ${PROJECT_SRC_ROOT}/../module/InferFeature/*.cpp ${PROJECT_SRC_ROOT}/main.cpp
    ${PROJECT_SRC_ROOT}/Common/*.cpp #[[    ${PROJECT_SRC_ROOT}/../module/StreamPuller/*.cpp ${PROJECT_SRC_ROOT}/../module/VideoDecoder/*.cpp
    ${PROJECT_SRC_ROOT}/../module/InferFace/*.cpp
    ${PROJECT_SRC_ROOT}/../module/InferDetCls/*.cpp
    ${PROJECT_SRC_ROOT}/../module/InferSegmentation/*.cpp
    ${PROJECT_SRC_ROOT}/../module/SrcFile/*.cpp
    ${PROJECT_SRC_ROOT}/../module/Bridge/*.cpp
    ${PROJECT_SRC_ROOT}/../module/BridgeTest/*.cpp
    ${PROJECT_SRC_ROOT}/../module/MQTTSub/*.cpp 
    ${PROJECT_SRC_ROOT}/../module/MQTTPub/*.cpp
    ${PROJECT_SRC_ROOT}/../module/InferPolygon/*.cpp
    ${PROJECT_SRC_ROOT}/../helper/HelperSub/*.cpp
    ${PROJECT_SRC_ROOT}/../helper/HelperPubV1/*.cpp
    ${PROJECT_SRC_ROOT}/../helper/HelperPubV2/*.cpp]]
    ${PROJECT_SRC_ROOT}/../helper/waiter/*.cpp )

编译出现的错误:

root@davinci-mini:/home/HwHiAiUser/zjx/24-dmanager/app# ./env.sh
ASCEND_VERSION is set to latest by user
ARCH_PATTERN is set to arm64-linux by user, reset it to arm64-linux/acllib
– The C compiler identification is GNU 7.4.0
– The CXX compiler identification is GNU 7.5.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Configuring done
– Generating done
– Build files have been written to: /home/HwHiAiUser/zjx/24-dmanager/app/build
Scanning dependencies of target main
[ 20%] Building CXX object CMakeFiles/main.dir/Common/check.cpp.o
[ 40%] Building CXX object CMakeFiles/main.dir/Common/Singleton.cpp.o
[ 60%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[ 80%] Building CXX object CMakeFiles/main.dir/home/HwHiAiUser/zjx/24-dmanager/helper/waiter/waiter.cpp.o
[100%] Linking CXX executable …/dist/main
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ModuleBase.cpp.o): In function ascendBaseModule::ModuleBase::ProcessThread1()': ModuleBase.cpp:(.text+0x488): undefined reference toaclrtSetCurrentContext’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ModuleBase.cpp.o): In function ascendBaseModule::ModuleBase::ProcessThread()': ModuleBase.cpp:(.text+0x1350): undefined reference toaclrtSetCurrentContext’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ModuleBase.cpp.o): In function ascendBaseModule::ModuleBase::Stop()': ModuleBase.cpp:(.text+0x2f8c): undefined reference toaclrtSetCurrentContext’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ModuleManager.cpp.o): In function ascendBaseModule::ModuleManager::InitAcl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': ModuleManager.cpp:(.text+0x89c): undefined reference toaclrtGetRunMode’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ResourceManager.cpp.o): In function ResourceManager::Release()': ResourceManager.cpp:(.text+0x218): undefined reference toaclrtDestroyContext’
ResourceManager.cpp:(.text+0x310): undefined reference to aclrtResetDevice' ResourceManager.cpp:(.text+0x3f0): undefined reference toaclFinalize’
/home/HwHiAiUser/zjx/24-dmanager/managerlib/output/libascendbasedevice.a(ResourceManager.cpp.o): In function ResourceManager::InitResource(ResourceInfo&)': ResourceManager.cpp:(.text+0x788): undefined reference toaclInit’
ResourceManager.cpp:(.text+0x874): undefined reference to aclInit' ResourceManager.cpp:(.text+0xa68): undefined reference toaclrtSetDevice’
ResourceManager.cpp:(.text+0xc2c): undefined reference to aclrtCreateContext' ResourceManager.cpp:(.text+0xe28): undefined reference toaclopSetModelDir’
collect2: error: ld returned 1 exit status
CMakeFiles/main.dir/build.make:179: recipe for target ‘…/dist/main’ failed
make[2]: *** […/dist/main] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/main.dir/all’ failed
make[1]: *** [CMakeFiles/main.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2

正确配置:

# Find Src file(GLOB_RECURSE SRC_FILE #    ${PROJECT_SRC_ROOT}/../module/InferDetClsV2/*.cpp #    ${PROJECT_SRC_ROOT}/../module/InferChipeakNet/*.cpp #    ${PROJECT_SRC_ROOT}/../module/InferFeature/*.cpp ${PROJECT_SRC_ROOT}/main.cpp
    ${PROJECT_SRC_ROOT}/Common/*.cpp
    ${PROJECT_SRC_ROOT}/../module/StreamPuller/*.cpp
    ${PROJECT_SRC_ROOT}/../module/VideoDecoder/*.cpp
    ${PROJECT_SRC_ROOT}/../module/InferFace/*.cpp
    ${PROJECT_SRC_ROOT}/../module/InferDetCls/*.cpp
    ${PROJECT_SRC_ROOT}/../module/InferSegmentation/*.cpp
    ${PROJECT_SRC_ROOT}/../module/SrcFile/*.cpp
    ${PROJECT_SRC_ROOT}/../module/Bridge/*.cpp
    ${PROJECT_SRC_ROOT}/../module/BridgeTest/*.cpp
    ${PROJECT_SRC_ROOT}/../module/MQTTSub/*.cpp 
    ${PROJECT_SRC_ROOT}/../module/MQTTPub/*.cpp
    ${PROJECT_SRC_ROOT}/../module/InferPolygon/*.cpp
    ${PROJECT_SRC_ROOT}/../helper/HelperSub/*.cpp
    ${PROJECT_SRC_ROOT}/../helper/HelperPubV1/*.cpp
    ${PROJECT_SRC_ROOT}/../helper/HelperPubV2/*.cpp
    ${PROJECT_SRC_ROOT}/../helper/waiter/*.cpp )
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值