- WHY I exist?!
- Turn your VSCODE into remote IDE |INTRO|
- FAQ
- Turn your Microsoft Visual Studio into remote IDE |INTRO|
- Source list
Problem appiered when you start using Raspberry Pi as IDE .Its TOO SLOW!. In Raspbians VScode you do not have Intelsens(auto complite line.shows methodds of the class e.t.c), Debugger. This topic was created to solve this problems using remote build options in Visual studio or in VSCODE in the remote machines. where Raspberry PI will be used as compiler of programm.
Its assumed what you already installed gcc, CMake, Cutycapt, OpenVG etc on Raspberry.In version 1.42 (2020) of VsCode Microsoft still did not added ARM procesors support(no intellsans and debuging) but they said they will add in future proof,but they added remote IDE functionality. It means what you code projectfor example in ubuntu and use Raspberry Pi as compiler/linker.
- Pluged on Raspbbery and Enabled SSH
Start->Preferences->Raspberry Pi Configuration->Interfaces->"Enable SSH." - Raspberry Pi hostname
Use this command in console to get hostname:$ hostname -I
- Must be installed on Linux machine.command for installation(probably you can survive without gdb stuff):
$ sudo apt-get install openssh-server g++ gdb gdbserver
Most importanly what allows you to turn your IDE as remote one (install on client side) is:
1.In VS Code, press on green rect(at the left lower corner)
2.chose from popup window Remote-SSH connect to host
3.For new conection press on "Add New SSH Host"
4.VS will ask you to witch device to connect. in edit box enter connection request/command
example of input request
ssh pi@${yours PIs hostname}
5.VS will ask where to save/edit your .ssh config chose first one.
5.1. inf .ssh config (see pic below how it looks like) you can rename your connection if needed change hostname/port/user etc
6.press again on green rect to start session and chose needed conection
7.VS will ask you password . enter pasword of remote machine
8.VS will do its magick(installation of vscode server etc)
9.install on remote machine(press in vscode extensions tab) additional extensions(c++ language support,cmake support etc)
10.press on Explorer (Ctrl+Shift+E) press on open folder button(you are now in yours pi cataloge LOL).
11.??????
12.PROFIT!
Installed VsCode on your working machine not on Pi.
Installed Extensions in VsCode server part:
-
"c/c++ definition" from regnofwebber-allows to create definitions like in vscode
-
"CMake Tools" from Microsoft-Extended CMake support in Visual Studio Code
-
"Clang-Format" from xaver-is a tool to format C/C++ In vscode File->Preferences->Settings in search field type "clang" and in field change to google style
now vscode will "force/help" you to write code in google code style -
"Commit Message Editor" from Adam Bender - allows better edit commit messages in conveniant way
-
"Git history"- allows you to see what changed from previus commit compare version and more using git
VSCode can be installed on windows.Can I use it in same way as in Linux?
ДА.
How you debug project?
printf("DEBUG style \n");
How you use intelsanse if VSCode do not have ARM support? ->
under construction
THIS WORKS UNDER WINDOWS OS ONLY . (kinda tested on windows 7 and 10)
Maybe solution could be faund here
-
N Straigth arms
-
Pluged on Raspbbery and Enabled SSH
Start->Preferences->Raspberry Pi Configuration->Interfaces->"Enable SSH." -
Raspberry Pi hostname
Use this command in console to get hostname:$ hostname -I
-
crap what must be installed on Linux machine
command for installation:$ sudo apt-get install openssh-server g++ gdb gdbserver
-
Installed Putty on Windows
-
Obviosly installed MVS on Windows with Linux package
in VS installer
If needed install it
1)Start->Visual Studio installer2)"in Installed page"
more->modify3)in "WORKLOADS"
scroll down and press on "Linux development with C++"4)press "modify" button
5)???
6)PROFIT!!!
1)Open MVS and chose "Create new project"
2)Chose "Makefile Project" if you havent it back to "What do you need to start" *punkt 6
3)Write path where to store it on your machine
*MVS migth show you pop out window where you need to enter Linux device info(hostname,user,password etc) fill it with info if it did not appiered its ok!
4)Connect your Linux machine to MVS:
In projec:Tools->Options->Cross Platform->press "Add button" fill pop out window with needed info(hostname,username e.t.c)
5)Configure project to understand make for Make
5.1)Project type:
Project->$(Your project name)Properties..->General
Configuration Type->Makefile
5.2)For compilator to understand
Project->$(Your project name)Properties..->Remote Build
5.3)For Debuging
Project->$(Your project name)Properties->Debugging
Program->$(FULL_PATH_TO_EXE)/$(EXE_NAME)
Create Source.cpp file in VS (it can be with different name I used this for guides purpose) in Source.cpp paste this code:
#include <iostream>
int main(){
std::cout << "HELLO WORLD I AM ALIVE!@\n";
return 0;
}
Create simple Makefile in project folder:
#Something like that
CC= g++ -g -Wall
#compiling project and linking
Hello:Source.o
$(CC) -o $@ Source.cpp
#command what allows you to delete obj files by using this command-> make clean
.PHONY:clean
clean:
-rm *.o
FINNALY PRESS CTRL+F5 then thru putty open yours project folder in linux machine and type this in console
$ ./$(Your project name.exe)