Preparation for working with DSPElib using Visual Studio Code
- Visual Studio code – basic installation
- Add C++ support for VSCode (see: https://code.visualstudio.com/docs/languages/cpp)
- Extension: C/C++ IntelliSense, debugging, and code browsing
- Extension: Graphviz (dot) language suport for VSC
- Library is mainly developed and tested using GCC compiler
- some versions have been successfully compiled with Visual Studio 2019
- .vscode folder in the workspace contains configurations for VSC
- (Windows) MSYS (v.2 is better choice)
- (deprecated) MSYS v.1.0: https://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.11/MSYS-1.0.11.exe/download?use_mirror=kumisystems
- MSYS2: https://www.msys2.org/
- install msys2 (64bit)
- in MSYS2 terminal
- pacman -Syuu
- => restart msys2
- pacman -Sy
- pacman -S make
- optional: update path to msys (for example: C:\msys64\usr\bin\) in in system path or *.bat file
- MinGW-w64 GCC (provided with MSYS2)
- pacman -S --needed base-devel mingw-w64-x86_64-toolchain
- optional (for 32bit applications compilation): pacman -S --needed base-devel mingw-w64-i686-toolchain
- optional: update path to gcc (for example: C:\msys64\mingw\bin\) in in system path or *.bat file
- If msys and gcc are not in system path
-
(version 1) run_VScode.bat (run_VScode.bat)
- Script setups paths (MinGW gcc and MSys) and runs VS Code
- This allows avoiding setting global system paths and using different compiler sets but might not work in certain configurations
-
(version 2) update path in .vscode/tasks.json
"windows": { "options": { "cwd": "${workspaceFolder}", "env": {"PATH":"c:/msys64/usr/bin;c:/msys64/mingw64/bin/;${env:PATH}"} }, },
- In Windows VSCode might require setting default terminal profile to Command Prompt (Ctrl+Shift+P: select default profile).
-
(version 1) run_VScode.bat (run_VScode.bat)
- Optionally install Doxygen (https://www.doxygen.nl/) which can be used for generation of library documentation from source code.
- subfolder Doxydoc contains doxygen configuration files and windows batch files for documatation generation using doxygen.
- Open main folder DSPE_lib in VSC.
- .vscode/c_cpp_properties.json – C++ configurations
- https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference
- The status bar in VS Code will show you which configuration is active. You can also click on the label in the status bar to change the active configuration.
- first setup C++ in status bar
- next select C++ Configuration in status bar, e.g. select "Windows64-Debug".
- \note: this determines compilation actions.
- .vscode/tasks.json
- compilation tasks configurations
- Compilation:
- in menu choose Terminal > Run Task... to select compilation task
- Ctrl+Shift+B - default compilation task
- Compilation actions depend on C++ language configuration (e.g. Windows64-Debug)
- Compilation actions:
- Build DSPElib - debug/release compilation based on C++ language configuration
- Clean DSPElib - clears both debug and release tmp compilation folders
- Install DSPElib - building both Debug and Release versions and copying library files to DSPE_lib_minGW folder in the subforder depending on platform and the compiler
- build examples Windows/Linux (requires (depends on last) "Install DSPElib" done beforehand)
- clean examples Windows/Linux
- Debugging
- launch.json
- debuger path might need updating
- https://code.visualstudio.com/docs/cpp/config-mingw
- Linux required sound libraries
- sudo apt install libasound2
- sudo apt-get install libasound2-dev
- Git configuration in Linux
- git config --global user.email "me@example.com"
- git config --global user.name "Your Name and Surname"
- Wiki