DevelopmentVSCode
Jump to navigation
Jump to search
Linux Development with VS Code[edit | edit source]
Minidev Login setup[edit | edit source]
- first, create an SSH key to auto login to the dev server 'minidev'.
- Install an SSH client: https://code.visualstudio.com/docs/remote/troubleshooting#_installing-a-supported-ssh-client
- Setup a key on your PC, and copy it to minidev. https://code.visualstudio.com/docs/remote/troubleshooting#_configuring-key-based-authentication
- In powershell:
ssh-keygen -t rsa -b 4096$USER_AT_HOST="kevinb@minidev"$PUBKEYPATH="$HOME\.ssh\id_rsa.pub"$pubKey=(Get-Content "$PUBKEYPATH" | Out-String); ssh "$USER_AT_HOST" "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo '${pubKey}' >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
- Make sure you can login without a password:
ssh kevinb@minidev
- Make sure you have the SVN directory checked out locally. Usually this is in $HOME/svn/vr/linux.
mkdir -p ~/svn/vr && cd ~/svn/vr/ && svn co http://svn/svn/linux/
VS Code Setup[edit | edit source]
Following this article: https://code.visualstudio.com/docs/remote/ssh
- Install VS Code from https://code.visualstudio.com/docs/setup/windows
- Install the Remote Development Extension Pack https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack
- Open VS code. Follow the instructions here: https://code.visualstudio.com/docs/remote/ssh#_connect-to-a-remote-host
- Open the forkliftreader_linux folder in src. $HOME/svn/vr/linux/src/forkliftreader_linux. A barebones vscode environment should be setup already.
- Setup more vscode extensions:
- C/C++ Extension Pack
- C/C++ Intellisense
- SVN
- vscode-proto3
- Python
- Pylance
Other[edit | edit source]
Setup Intellisense. First time run gtags at project root:
gtags
(needed?)
Building Code[edit | edit source]
Terminal -> Run Build Task. Will run 'make'
Debugging[edit | edit source]
To debug the application, use 'F5' or click 'Start Debugging'. This will run a new version of the RFID service.
Note that breakpoints and debugging also work really well.
Troubleshooting[edit | edit source]
If you get an error like:
Then open a .c file so that it knows what to do.