Skip to content

Building Your Code In Visual Studio Code

samriffle edited this page Jun 8, 2023 · 10 revisions

Build *.cu with Visual Studio Code

1. Utilize cmake and build your c compiler with the options to include specified opencv libraries (Help with this step)

 a. Create a file called CMakeLists.txt in the directory that also holds the /src directory for your program. Edit the cmake dependency file to include the pathing to your specifications

2. In visual studio code, use the terminal to cmake the compiler, then compile the program

 a. Navigate to the directory that holds the /src directory for your program, and use the commands below
      cmake -Bbuild -DCMAKE_BUILD_TYPE=Released
      cd build
      make

3. The program will compile into an executable in your /src directory if you followed along with the example CMakeLists.txt file

 a. Continue in visual studio code terminal with the following lines
      cd ..
      ./nameofyourexecutable