Jump to content

Visual Studio for Managing C/C++ programs on Orange PI ?


zipzit

Recommended Posts

Background:

 

I'm using Orange Pi Zero for data I/O.  I'm using https://github.com/zhaolei/WiringOP to manage the GPIO stuff.  

 

So I've been writing programs in C/C++ using the simple nano editor via SSH to my Orange Pi Zero.  

  •  I start by doing all code edit within Atom.io on my laptop/desktop computer.  (I ALWAYS want a record of what I'm changing... )  
  •  I keep track of code changes via Git and the Atom content on my laptop/desktop.  

When it comes time to push code to the Orange Pi, I SSH login to the orange pi:

  • Delete my old workingCode.c file (erasing big blocks of code within Nano is a pain in the neck)
  • Create the file again via Nano.  
  • Copy paste the new code (from Atom), exit and save the file.  

 

Run from SSH via 

gcc workingCode.c -o workingCode -lwiringPi

This works fine, as long as you don't need to step thru the code.  

 

 

 

I've been playing around with Visual Studio Community Edition 2015 lately.  I was using it to do OpenCV stuff using C/C++.  

 

I saw this posting, https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development/

 

The Visual C++ for Linux Development extension enables you to author C++ code for Linux servers, desktops and devices. You can manage your connections to these machines from within VS (Visual Studio). VS will automatically copy and remote build your sources and can launch your application with the debugger. Our project system supports targeting specific architectures, including ARM. Read on for how to get started with our new Linux projects.
 
Today we only support building remotely on the Linux target machine. We are not limited by specific Linux distros but we do have dependencies on the presence of some tools. Specifically, we need openssh-server, g++, gdb and gdbserver. Use your favorite package manager to install them, e.g. on Debian based systems:  sudo apt-get install openssh-server g++ gdb gdbserver

 

 
I did some playing around (basically hello world programs with lots of variables and calculations...) and wow.  This works.. kinda, sorta.  File master on my laptop/desktop within the Visual Studio project.  When I compile and run, the system pushes the code from Visual Studio right over to my orange pi device.  I can debug step through the code, including inspection of variable content at interim steps.   Output is available via a console window within Visual Studio.  For a "helloWorld.c" program, Visual Studio does create a few files on my Orange Pi:
 
projects directory
     helloWorld directory
          bin directory
               ARM directory

                    Debug directory
                         helloWorld
.out file <--- ./helloWorld.out works!
          obj directory
               ARM directory

                    Debug directory
                         helloWorld
.o file
                         helloWorld
.c file
 
 
My dilemma is I don't understand is how Visual Studio deals with on remote libraries.  When I try to use GPIO on the Orange Pi, I get errors relating to the wiringIP library.  Part of my problem is the  zhaolei/WiringOP is called from within the C program via #include <wiringPi.h> and wiringPi library in its original form is already located within the Visual Studio system.  Its not clear to me on how to set this system up to use the already-compiled-on-remote-device-library.  
 
Anybody else using Visual Studio Enterprise edition for Orange Pi (or other armbian) work?  any hints on how to proceed here?  It sure would be nice to be able to step thru code and inspect interim results during debugging.  
 
Many thanks.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines