build file in wrong directory?

30 Views Asked by At

I am a beginner in C/C++, and need help with this:

I am generating the build file on my MacOS by using:

mkdir build
cd build 
cmake .. 

and get this:

-- 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

then when I try to run it:

AILED 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 % 

I think the problem is the project hierarchy because the Webserver.c file is not in the build directory. I am not sure though. Can someone help? I have added a screenshoot of the project hierarchy

Project hierarchy screenshoot

1

There are 1 best solutions below

0
Lake On

From what you posted, it looks like your issue has more to do with what @zaufi said in his comment under your original post.

No such file or directory: 'build/webserver'

I don't know the structure of your project or what dependencies it relies on, but if your program relies on a directory or file or program in your build directory, you should place it there.

If webserver is your program name, see if you can find a way to set the name of your executable at build time. Then double check to make sure that there is something called webserver in your build directory.

Hope this helps!