... | @@ -3,29 +3,42 @@ Preparation for working with DSPElib using Visual Studio Code |
... | @@ -3,29 +3,42 @@ Preparation for working with DSPElib using Visual Studio Code |
|
2. Add C++ support (see: https://code.visualstudio.com/docs/languages/cpp)
|
|
2. Add C++ support (see: https://code.visualstudio.com/docs/languages/cpp)
|
|
- C/C++ IntelliSense, debugging, and code browsing
|
|
- C/C++ IntelliSense, debugging, and code browsing
|
|
- Assumes use of GCC
|
|
- Assumes use of GCC
|
|
- some versions have been compiled with Visual Studio 2019
|
|
- some versions have been successfully compiled with Visual Studio 2019
|
|
- on Windows used with MinGW gcc compilers
|
|
- on Windows just like in Linux it has been mostly used with gcc compilers
|
|
- for examples compiler provided with https://code.visualstudio.com/docs/cpp/config-mingw
|
|
- for example compiler provided with https://code.visualstudio.com/docs/cpp/config-mingw
|
|
- .vscode folder in the workspace contains configurations for VSC
|
|
- .vscode folder in the workspace contains configurations for VSC
|
|
3. run_VScode.bat ([run_VScode.bat](uploads/e2c8f797454db50f5252b4d7846a450d/run_VScode.bat))
|
|
3. (Windows) MSYS (v.2 is better choice)
|
|
- Script setups paths (MinGW gcc and MSys) and runs VS Code
|
|
|
|
- This allows avoiding setting global system paths and using different compiler sets
|
|
|
|
- MSYS (v.2 is probably a better choice)
|
|
|
|
- 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
|
|
- 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/
|
|
- MSYS2: https://www.msys2.org/
|
|
- install msys2 (64bit)
|
|
- install msys2 (64bit)
|
|
- pacman -Syuu => restart msys2
|
|
- in MSYS2 terminal
|
|
|
|
- pacman -Syuu
|
|
|
|
- => restart msys2
|
|
- pacman -Sy
|
|
- pacman -Sy
|
|
- pacman -S make
|
|
- pacman -S make
|
|
- update path to msys in *.bat; for example: D:\msys64\usr\bin\
|
|
- update path to msys (for example: C:\msys64\usr\bin\\) in in system path or \*.bat file
|
|
4. Open folder: d:\Eclipse_Mars\git_folder\DSPElib\DSPE_lib\src\
|
|
- MinGW-w64 GCC (provided with MSYS2)
|
|
5. .vscode/c_cpp_properties.json – C++ configurations
|
|
- pacman -S --needed base-devel mingw-w64-x86_64-toolchain
|
|
|
|
- update path to gcc (for example: C:\msys64\mingw\bin\\) in in system path or \*.bat file
|
|
|
|
4. If msys and gcc are not in system path
|
|
|
|
- **(version 1)** run_VScode.bat ([run_VScode.bat](uploads/e2c8f797454db50f5252b4d7846a450d/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*
|
|
|
|
~~~C++
|
|
|
|
"options": {
|
|
|
|
"cwd": "${workspaceFolder}",
|
|
|
|
"env": {"PATH":"c:/msys64/usr/bin;c:/msys64/mingw64/bin/;${env:PATH}"}
|
|
|
|
},
|
|
|
|
~~~
|
|
|
|
5. Open folder: d:\Eclipse_Mars\git_folder\DSPElib\DSPE_lib\src\
|
|
|
|
6. .vscode/c_cpp_properties.json – C++ configurations
|
|
- https://code.visualstudio.com/docs/cpp/c-cpp-properties-schema-reference
|
|
- 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.
|
|
- 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 in status bar setup C++
|
|
- first in status bar setup C++
|
|
6. .vscode/tasks.json
|
|
7. .vscode/tasks.json
|
|
- compilation tasks configurations
|
|
- compilation tasks configurations
|
|
7. Compilation:
|
|
8. Compilation:
|
|
- in menu choose Terminal > Run Task... to select compilation task
|
|
- in menu choose Terminal > Run Task... to select compilation task
|
|
- Ctrl+Shift+B - default compilation task
|
|
- Ctrl+Shift+B - default compilation task
|
|
- Compilation actions depend on C++ language configuration (e.g. Windows64-Debug)
|
|
- Compilation actions depend on C++ language configuration (e.g. Windows64-Debug)
|
... | @@ -35,16 +48,16 @@ Preparation for working with DSPElib using Visual Studio Code |
... | @@ -35,16 +48,16 @@ Preparation for working with DSPElib using Visual Studio Code |
|
- Install DSPElib - compile both Debug and Release and copy library files to _DSPE_lib_minGW_ folder
|
|
- Install DSPElib - compile both Debug and Release and copy library files to _DSPE_lib_minGW_ folder
|
|
- build examples Windows/Linux (requires/depends on last "Install DSPElib")
|
|
- build examples Windows/Linux (requires/depends on last "Install DSPElib")
|
|
- clean examples Windows/Linux
|
|
- clean examples Windows/Linux
|
|
8. Debugging
|
|
9. Debugging
|
|
- launch.json
|
|
- launch.json
|
|
- https://code.visualstudio.com/docs/cpp/config-mingw
|
|
- https://code.visualstudio.com/docs/cpp/config-mingw
|
|
9. Linux
|
|
10. Linux
|
|
- sudo apt install libasound2
|
|
- sudo apt install libasound2
|
|
- sudo apt-get install libasound2-dev
|
|
- sudo apt-get install libasound2-dev
|
|
- git
|
|
- git
|
|
- git config --global user.email "me@example.com"
|
|
- git config --global user.email "me@example.com"
|
|
- git config --global user.name "Your Name and Surname"
|
|
- git config --global user.name "Your Name and Surname"
|
|
10. Wiki
|
|
11. Wiki
|
|
- https://git.pg.edu.pl/dspe/DSPElib/wikis/git_access
|
|
- https://git.pg.edu.pl/dspe/DSPElib/wikis/git_access
|
|
|
|
|
|
|
|
|
... | | ... | |