1

So, based on the advice given here: Cannot find filesystem I used the RPi-Cpp-Toolchain to build my executable on my Ubuntu desktop. The build appeared to succeed, but I can't find the executable anywhere. Also, being rusty with this stuff, I don't even really know the name of it.

Here is the output of my build.

/snap/bin/cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=pi-zero.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_DEPENDS_USE_COMPILER=FALSE -G "CodeBlocks - Unix Makefiles" /tmp/tmp.UNnm1OGKQ2
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/thomas/lib/RPi-Cpp-Toolchain/toolchain/x-tools/armv6-rpi-linux-gnueabihf/bin/armv6-rpi-linux-gnueabihf-gcc - 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: /home/thomas/lib/RPi-Cpp-Toolchain/toolchain/x-tools/armv6-rpi-linux-gnueabihf/bin/armv6-rpi-linux-gnueabihf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: /usr/bin/python3.8 (found version "3.8.6") found components: Interpreter 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/tmp.UNnm1OGKQ2/cmake-build-raspberry-pi-release

[Finished]

Here's the dir listed above:

thomas@bravos:/tmp/tmp.UNnm1OGKQ2/cmake-build-raspberry-pi-release$ ls
bin             CMakeFiles           lib       rookery.cbp  Testing
CMakeCache.txt  cmake_install.cmake  Makefile  src          tst

Nothing in bin. Nothing else obvious. Couldn't find anything in my project dirs either. Looking for a pointer.

1
  • As per the answer you didn't execute the build, you configured the context for it. Note that questions about clion and cmake general use are more appropriate to our larger parent site, Stack Overflow. You should probably find a cmake tutorial to work through.
    – goldilocks
    May 12 at 15:47
2

I'm not familiar with CLion or Code::Blocks, but looking at the output you posted, it seems like you only configured your project using CMake, you didn't actually build it.
CMake looks for compilers and dependencies, handles options and configurations, and generates the actual build files (in your case Makefiles) to compile your source files.

To build your project, you have three main options:

  1. Use your IDE to do it. Like I said, I'm not familiar with your IDE, but there has to be a “build” option somewhere.
  2. Use cmake --build, see https://cmake.org/cmake/help/latest/manual/cmake.1.html#build-a-project.
  3. Call make manually in the build folder (the one CMake wrote the build files to).

This only works if your CMakeLists.txt has a target with rules to build your project, of course, usually in the form of a call to add_executable(<target-name> <list-of-source-files>). The name of the executable will be <target-name>. It will be somewhere in the build folder, but the location will depend on the structure of your project and if you changed the output folder in your CMake scripts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.