Skip to content

VSCode C++ development environment for smaller projects

Notifications You must be signed in to change notification settings

JackKenney/cpp-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Environment

A C++ project structure for compiling, debugging, and running C++ code using Visual Studio Code on Unix machines.

Requirements

  • g++ 9.3.0
  • GNU Make 4.2.1
  • VSCode 1.49.0+

Configuring PATH and Environment variables

If you would like to reuse libraries across projects, add the following line to your ~/.bashrc. Otherwise, include the libraries in the local lib/ folder.

export CPP_LIB="/path/to/your/cpp/libraries/"

Now either close and open your terminal or run source ~/.bashrc to sync the updates.

Running example

First, unpack the Eigen folder from the ZIP download on the Eigen website into either the lib/ or CPP_LIB folder.

Then you can open VSCode like this:

code .

Open main.cpp and press F5. This will start the debugger and you can step through your code.

If you want to run an optimized version, you can choose the g++ Release, which will build the O2 optimized version of the main.cpp file.

You can run either mode without using the debugger with Ctrl+F5.

Acknowledgements

  • Phil Thomas, CICS, Umass Amherst - C++ introduction as part of CS 687
  • Dave for the tasks.json structure
  • This Duke U. page on Makefiles.
  • vcpkg makers at Microsoft for making the automated library management possible

More information

For more information, check out

About

VSCode C++ development environment for smaller projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published