Go Down

Topic: Windows/Linux/Mac Eclipse plugin to compile and upload arduino sketches (Read 307813 times) previous topic - next topic

ats3788

Hello
I use sloeber 4.1 and it has Problems with adding Libraries so I add them manually , this works
but


#include <Adafruit_GFX.h> // Hardware-specific library
#include <MCUFRIEND_kbv.h>
// work in line numbers.  Font height in ht
int16_t ht = 16, top = 3, line, lines = 15, scroll;
MCUFRIEND_kbv tft; // without this tne Code got compiled

void setup()
{

}

void loop()
{

}

with MCUFRIEND_kbv tft
I got the Message

D:\Workspace\UNO\ILI9341_Test\Release/..\ILI9341_Test.ino:15: undefined reference to `MCUFRIEND_kbv::MCUFRIEND_kbv(int, int, int, int, int)'
collect2.exe: error: ld returned 1 exit status
makefile:79: recipe for target 'ILI9341_Test.elf' failed
make: *** [ILI9341_Test.elf] Error 1

With the Arduino KDE it works.

ats3788

I found a solution for my Problem. I added the the Offline Library to the library Folder with drag and drop and now it's working. You did a damn good Job the only think what has to be improve is the Library Manager.

ats3788

Hello me again
What i figured out, in Eclipse drag and drop just the path of the libs don't copy and paste the whole files because then Eclipse is causing Problems. After this you have to add the paths of your added Libs in
Project-->Proberties-->C++/C General --> Path and Symbols-->Add (Check all Languages)

gfvalvo

Hi All. I previously posted this same question here, but, have received to reply in 4 days. Maybe someone reading this thread can help:

I managed to get Sloeber installed including support for Teensy and ESP8266 boards. Never used Eclipse before so the learning curve is a little steep, but I'm groping my way through.

I'm also new to the workspace / project concept, so I'd appreciate a little advice on how to organize things. When using the Arduino IDE I would often make subfolders in my main sketch folder. These would enable me to group together related sketches or different versions of the same sketch in a hierarchical manner.

So, what's the equivalent of this hierarchy in the Eclipse world? Say I want to group together multiple versions of the same sketch so that I can always revert to a previous one if I screw things up too badly along the way. Can I have multiple versions of the source code in the same project? Or, do I make a "sub workspace" under my main one and put an individual project for each version in there?

Thanks in advance for your advice.

MFletcher93

Hi gfvalvo,

I am new to Sloeber too but I fortunately have some experience with Eclipse and some other tools. If you are worried about reverting to a previous sketch if you screw things up, it's time to learn about version control. I use Git but there are other tools out there such as Subversion.

The idea of version control -- although I may be using language unique to Git, as that is what I know -- is that you have a repository for your project and commits, which are previous versions of your source code. You don't have to manually copy and paste, it is all managed for you and you can revert at any time. You can also compare the changes you have made since the last time you committed, so if something is screwed up and you don't know where, you may be able to find it that way.

Eclipse has plugins (I think it is called EGit) which integrate Git into your IDE directly. Then you have a Git menu somewhere where you can commit with a few clicks.

I highly recommend finding one of the many tutorials that are out there for Git because it is one of those life-changing tools for anyone who programs. It won't take you long to learn the basics at all.

gfvalvo

Thanks for the reply @MFletcher93. I agree that a version control product would allow reversion to a previously working code if I mess up too bad.

But, I'm just as happy handling that aspect manually and not having to learn yet another tool.

However, the real problem I see is that I don't think it solves the issue of organizing the workspace into a logical, hierarchical structure. I want to group similar projects together rather than one big flat structure. Let me know if I'm wrong about that and the Git tool can provide the capability.

Thanks again.

MFletcher93

You are correct that Git only solves the versioning problem.

In terms of a more sensible structure there doesn't seem to be a way of organizing things in a hierarchy but there are some partial solutions: separate workspaces and working sets.

Personally, I find that changing workspaces is very slow. That might just be my computer but I would only use it for things I wanted to keep strictly separate -- such as work and hobby projects.

Working sets are within workspaces and can act like a folder but only go one-level deep. Also, I think that you can have one folder within multiple working sets so it's not exactly like a normal folder.

I'm hoping that you have a similar layout to mine so I can give you some instructions.

To create some working sets, find your Project Explorer panel and click the View Menu triangle at the top. Click "Select Working Set..." and click "New...". You will want the "Resource" working set type (as that is what projects fall under), and then you can select which projects you want in that working set. Then back in the "Select Working Set..." dialog box you can select which working sets you want to be able to view in the Project Manager.

If you go back to that Project Manager menu there are also some other options which may help.
Projects Presentation -> Hierarchical and Top Level Elements -> Working Sets.
Those will display the working set folders in your Project Manager.

So not a perfect solution but I hope that helps. I was just experimenting with that now because I realized I have too many projects myself.

gfvalvo

Thanks again for the reply @ MFletcher93. I read several postings during my Google searches that agree with your assessment of switching Workspaces -- it's slow and keeping your preferences synchronized between multiple Workspaces is a pain.

I also stumbled onto the Working Sets concept during my Google searches and fumbling around in the IDE. I came to the same conclusion -- it only gives you the simulation of hierarchy, and only one level deep at that. But, it also appears to be the only simple alternative to the totally flat Workspace. It's amazing to me that someone would go to the trouble of creating a tool as extensive and powerful as Eclipse and neglect the concept of hierarchical organization. But, it is what it is.

I'll look further into Git and GitHub when I get a chance. After viewing a couple of tutorials, the concept seems simple enough. But, I think it would be cumbersome to use unless support is integrated into Eclipse. Perhaps the plug-in you mentioned?

Anyway, thanks again.

Jantje

@gfvalvo
version control is the normal answer to your version control question.
The sloeber project includes e-git so there is no need to install extra plugins.
If you are serious in software development (and it looks like you are) you have to take a look at version control and if you do opensource github is a really good choice at the time of writing.
Note that a good version control allows you to have versions over time (commits) as over functionality (branches)
See this video on how to import a non Sloeber Arduino project in Sloeber. A Sloeber project is just lots easier todo https://youtu.be/FrtiVYjF7vU

As to workspaces:
I use multiple workspaces and I do not swap but start multiple eclipses (I have more memory 16GB then cpu power 2-cores)  :smiley-confuse: .
It is not uncommon for me to have 3 eclipse instances running. FI one to develop sloeber, one for my arduino projects and one for debugging/testing github issues.
My advice is as follows: Start with one test and one production workspace. Only add a workspace if you have a need. Note that if you use version control you can have the same source code (in different versions) in all workspaces

I'm not sure what you mean with "concept of hierarchical organization"

best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Jantje

@Headroom

The current nightly will be V4.2 () and supports java V9.
It also has a bunch of great improvements.
Best regards
Jantje
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

gfvalvo

I'm not sure what you mean with "concept of hierarchical organization"
Hi @Jantje, thanks for the reply.

As an example of hierarchical organization, think of the folder tree structure on your PC. You (probably) don't keep all your thousands of files in one big, flat "My Documents" folder. More likely, that folder has lots of sub-folders in it (Pictures, Music, Movies, Correspondence, Financial, Appliance Owners Manuals, Investments, etc.)

And, each of those sub-folders can have more sub-folders inside them. And, THOSE sub-folders can have sub-folders inside them. You get the idea. Starting from the top level, I can drill down to the files I need in a logical and organized manner.

I'd like to have the same organizational structure for my Eclipse workspace. I don't want dozens or hundreds of Arduino sketches sitting at the top (and only) level of a flat workspace. I want hierarchical organization. I want sub-workspaces called "Holiday Projects", "Audio Projects", "Robot Projects", and "Home Automation Projects". Inside those sub-projects I want more sub-workspaces. For instance, inside the "Holiday Projects" sub-workspace I want sub-workspaces called "Halloween Projects" and "Christmas Projects". Inside the "Halloween Projects" sub-workspace I want more sub-workspaces called "Scary Light and Sound Effects Projects" and "Costume Projects".

In short, I want an organized, hierarchical structure analogous to the folder structure on my PC. Does that make sense?

Edit:
Thanks for the info that e-git is already installed in Sloeber.

Jantje

@gfvalvo
I would consider the "hierarchical organization" as you describe it as "the old way of working.
Tagging is the new way. This because real things do not fit in a tree.

I think about the version control as the place to store/search code so tagging and organisation happens there. The workspace is the place where I have my currently active projects not all projects.
Using git it is easy to add/remove projects to/from the workspace. In other words, I don't want Halloween projects in my workspace during Christmas time.
 
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

gfvalvo

@gfvalvo
I would consider the "hierarchical organization" as you describe it as "the old way" of working.
But, I am old   8)
I'll try to learn the "new way".
Thanks.

Jantje

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

gfvalvo

version control is the normal answer to your version control question.
The sloeber project includes e-git so there is no need to install extra plugins.
So, I've never done git-anything before except download Arduino libraries from GitHub.

But, I have been reading a lot online and understand the basic concepts at least. It should be pretty easy for me since I'll be the only "collaborator" working on my projects.

However, I'm still having difficulty understanding the relationship between Sloeber / Eclipse, e-git, git, GitHub, etc. And, I can't figure out what's necessary to start using e-git from within Sloeber to do version control on my own projects. Part of the problem is there is too much information on the web and I can't separate the applicable from the not applicable.

So, how do I start out? Sloeber is already installed. Do I have to also install a git-something program on the PC and somehow link it with Sloeber?

I just need a basic guide for a single-contributor setup. After that, I should eventually become smart enough to ask more intelligent questions.

Thanks.

Go Up