Compile, Build and Run C++

You need to have a dir with your .cpp files and the CMakeLists.txt file.

Here you can see an example of these types of directories:


Then, in this same directory, you need to create a build folder, then compile (using the CMakeLists.txt file information), then building the executable file and then launch the (just created) executable file:

$ mkdir -p build
$ cd build
$ cmake .. -DCMAKE_BUILD_TYPE=Release
$ make name_of_file
$ ./name_of_file

You just need this to run the recently created file. Every time you change the .cpp original file, you should run the last 3 command lines in order to test that changes when running the program.

The build folder should contain the following:


 

 


Comments

Popular posts from this blog

Remote Control of UR10e via MoveIt (ROS)

UR10e control architecture

ViSP - first tutorial