MacOS下C/C++项目CMake构建后找不到webserver执行文件求助
C/C++构建后测试脚本找不到可执行文件问题
我是C/C++初学者,在MacOS上执行以下命令生成构建文件:
mkdir build cd build cmake ..
CMake执行输出无异常:
-- The CXX compiler identification is AppleClang 13.0.0.13000029 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenSSL: /opt/homebrew/lib/libcrypto.dylib (found version "3.2.1") -- Configuring done (0.8s) -- Generating done (0.0s) -- Build files have been written to: /Users/avissataghizadeh/Desktop/rn-praxis/build
但运行测试脚本时,所有测试均报错找不到build/webserver:
FAILED test_praxis3.py::test_stabilize - FileNotFoundError: [Errno 2] No such file or directory: 'build/webserver' FAILED test_praxis3.py::test_notify - FileNotFoundError: [Errno 2] No such file or directory: 'build/webserver' FAILED test_praxis3.py::test_successor_update - FileNotFoundError: [Errno 2] No such file or directory: 'build/webserver' FAILED test_praxis3.py::test_join - FileNotFoundError: [Errno 2] No such file or directory: 'build/webserver' FAILED test_praxis3.py::test_join_forward - FileNotFoundError: [Errno 2] No such file or directory: 'build/webserver' FAILED test_praxis3.py::test_join_react - FileNotFoundError: [Errno 2] No such file or directory: 'build/webserver' FAILED test_praxis3.py::test_dht - FileNotFoundError: [Errno 2] No such file or directory: 'build/webserver' ========================================================== 7 failed in 0.28s =========================================================== avissataghizadeh@Air-von-Avissa test %
我猜测是项目层级的问题,Webserver.c源码文件不在build目录中,但不确定具体原因,希望得到解决帮助。项目层级结构大致为:根目录下有build、test文件夹,以及存放Webserver.c等源码的目录。
内容的提问来源于stack exchange,提问作者Avissa Taghizadeh
相关产品推荐
相关产品推荐

