Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Eclipse (IDE) with Remote Projects
#1
Eclipse is a robust development environment available for linux which offers better scope for dealing with remote projects than other utilities that I've tried on the O/S. With it you can install a GDB add-on and manage your files across a network, perfect for remote compiling. I will offer the links for all the items you will need to code and cross-compile for the Raspberry Pi 3 B(+.) Here goes:

Installing Eclipse should be the first step, you can get it at the official site, as Brians' book is dealing with C/C++ we should install the IDE for working in those languages (Eclpise C/C++ IDE) or you can download it using your favourite package manager. The official website for Eclipse finds its home at: https://www.eclipse.org/

Now because the Raspberry Pi has proprietary hardware we will need to have drivers ready for our host computer to compile against. You can find these here [https://github.com/raspberrypi/firmware] and because the Rpi has a different architecture to your desktop or laptop we need more tools for remote compiling which can be found here [https://github.com/raspberrypi/tools].

With Eclipse installed we need to extract the files we got from github to somewhere. For ease of use I suggest just extracting them to your workspace folder.

Let's start Eclipse and get it ready to speak to the Rpi.

Open a .cpp file, start a new project, import an existing one, whichever way you go you'll need to direct Eclipse to files from both the firmware and tools-master folders. To set this up we need to open up the properties panel in the projects menu at the top bar. Once in there open the C/C++ Build menu and go to settings. And from there, in the newly visible settings panel, you should be seeing Cross Settings.

In the Cross Settings you need to set the prefix to 'arm-linux-gnueabihf-' and set the path to '~/workspace/tools-master/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin' or wherever you have put these files.

It's from the properties panel that we include the libraries and names of the modules we will be using to compile with. First up we include the directories in the Cross G++ Compiler->Includes section. You can find most of these in the section of the book that details setting up Visual Studio, they have paths like '/opt/vc/include/.' In fact this is so similar that it's practically the same thing. Further to setting up the libraries we have to include the names and this is done in the Cross G++ Linker section->Libraries and these look like 'bcm_host' and 'EGL_static.' You can also set the path for the compiler to find them.

For a more in depth, and easier to follow example, you can check here: https://www.96boards.org/blog/eclipse-re...debugging/

However it must be noted that the tools-master and firmware are both required to make the tool chain, again you can find these here: https://github.com/raspberrypi/tools and here: https://github.com/raspberrypi/firmware respectively.

Any questions? Smile
Reply
#2
Thanks for posting this.

I've been able to get some basic code compiled for the Raspberry Pi from an Ubuntu 16.04 system but have not tried the OpenGL ES libraries. Have you been able to get these compiled with Eclipse for the RasPi?
Reply
#3
Im not very familiar with eclipse (except for a dabble in java), but adding any library should be a basic set up of any IDE, review how its done on Code::Blocks, on the 1st magpi lesson, it won't be too different. I don't have a Linux PC to try it out myself to give a better answer. Google seems to have the answer.

https://codeyarns.com/2013/09/22/how-to-...lipse-cdt/

But maybe DiSkaarj can be more specific.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply
#4
(10-13-2018, 07:52 AM)Brian Beuken Wrote: Im not very familiar with eclipse (except for a dabble in java), but adding any library should be a basic set up of any IDE, review how its done on Code::Blocks, on the 1st magpi lesson, it won't be too different. I don't have a Linux PC to try it out myself to give a better answer. Google seems to have the answer.

https://codeyarns.com/2013/09/22/how-to-...lipse-cdt/

But maybe DiSkaarj can be more specific.

Brian,

Yeah, thanks but I am familiar with how to add lib references in Eclipse for C/C++.  The issue I am having is with getting the OpenGLES libraries in the right place on the remote Linux host.  
I've been following through some examples I have found but most seem to be geared toward configuring QT for remote cross compiling with the RasPi. 

Ex:
https://wiki.qt.io/RaspberryPi2EGLFS

I can get a basic C program to work but not with OpenGLES yet.  

I've used this to bring in the libs from the RasPi but need to see if I can get it to compile in Eclipse.

This seems to work local on the RasPi though.
https://github.com/peepo/openGL-RPi-tutorial
Reply
#5
So after a bit of hair pulling I was able to get OpenGLES to build and deploy to my RasPi from Eclipse running on Ubuntu. I created a new project and then added the code from the first tutorial from the peepo link I previously posted. After getting all of the right pieces in place, I could build the example and run it on the Pi. Actually it took a bit of each of the links above and then some to get this to work.

Now I just need to get GDB to work remotely and I will be golden.
Reply
#6
Awesome
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply
#7
Yeah, this is certainly not for the faint at heart. For an easy path to getting to programming, Visual Studio with VisualGDB is a better option. I'm just a glutton for punishment.
Reply
#8
Big Grin which is why I use visual studio with Visual GDB, I hate punishement...but Im impressed by those that get things like that up and running
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply
#9
Hey there,

Sorry for the long silence.

In my quest to get Eclipse up and running as a viable alternative to Visual Studio and VisualGDB I came across a couple of key points which are relevant to this topic.

In concern of the libraries and their paths what I found to be easiest is to download the latest firmware from https://github.com/raspberrypi/firmware and copy the 'vc' folder from 'firmware/hardfp/opt' to your own distros '/opt' folder. This should make it easier to maintain your project.

The OpenGLES libraries for the RPi were renamed and are now prefixed with brcm. However to keep in line with the book a symbolic link can be used to make the code run.*

Quote:cd /opt/vc/lib && sudo ln -s libbrcmEGL.so libEGL.so && sudo ln -s libbrcmGLESv2.so libGLESv2.so

When I originally started this thread I had successfully launched both the Triangle and Image exercises remotely. However, I think it was the following day, when I upgraded Eclipse I lost my configuration and went in a huff hah!

* https://www.raspberrypi.org/forums/viewt...p?t=191857
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)