Go Down

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

Jantje

@hichhiker
Windows indeed has a problem with long path names. V4.2 warns wen starting up with a to long path
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 -

hichhiker

Any ways to work around it?

I made a stripdown example - if you create a simple cpp Sketch, create a directory called a and add empty files "aaa.h" and "aaaa.h", you can demo the issue by also adding a.cpp there with following content:

Code: [Select]

// a/a.cpp - expects a/aaa.h and a/aaaa.h to exist (can be empty)

//direct - 5 chars
#include "aaa.h"
//direct - 6 chars
#include "aaaa.h"

//indirect - 10 chars WORKS
#include "../a/aaa.h"

//indirect - 11 chars WORKS
#include "../a/aaaa.h"

//indirect long 200 chars - Works
#include "../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/aaa.h"
//indirect long 201 chars - DOES NOT WORK ON WINDOWS
#include "../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/../a/aaaa.h"


breakage seems to be at 201st character, but I think it may be a bit more involved as the path of to the file being compiled is part of it


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 -

hichhiker

You are awesome. This is exactly what I needed. I made a reg file to include with code and it works great!

For what it's worth, they mention in this link that you can add a manifest to a windows app to make it automatically apply for the process only - but I have no idea how to do it and if it is feasible to add to  eclipse/sloeber

Thank you so much!

-HH

it is pretty well documented and there seems to be a workaround since windows 10 version 1607.
https://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath

wiseda51

I have been successfully using an earlier version of the plugin and just upgraded to V4.2 via the Marketplace.  Most of my projects are ESP8266 based so I installed the 2.4.0 version via Boards Manager.  When it started I got the error messages for the path too long so I reinstalled Ecliplse and the V4.2 plugin with a shorter path (C:\neon).  Builds now fail due to a bad path to the ESP8266 compliler, it is still using the long path from the original install ("C:\eclipse\cpp-neon\eclipse\/arduinoPlugin/packages/esp8266/tools/xtensa-lx106-elf-gcc). Since the plugin is now installed in C:\neon\eclipse\/arduinoPlugin this clearly needs to be updated.  Where is it stored and how should it be updated?

I fully erase the original install of ecplise and the plugin at C:\eclipse\cpp_neon\ and checked that the new install has properly put the tools at C:\neon\eclipse\arduinoPlugin\packages...

Thanks in advance.  Great tool!

Jantje

you probably didn't do the workspace update actions as described here http://eclipse.baeyens.it/how_to.shtml#/n
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 -

wiseda51

Thanks for the quick reply but it didn't address my problem.  I finally figured it out by further searching where Eclipse stores data.  Basically every time Eclipse is installed it creates a subdirectory in C:\Users\xxx\.p2\org.eclipse.equinox.p2.engine\profileRegistry where the sudirectory name is created from the install path, like "C__neon_eclipse.profile" for C:\neon install or "C__eclipse_cpp_neon_eclipse.profile" for a default C:\eclipse\cpp_neon install.  Deleting the old install directory fixed the problem.

So if you delete Eclipse and re-install it with a shorter path name to fix the long path name problem you need to do this extra cleanup.  Or maybe there was another way I was supposed to delete Eclipse which would have done this automatically (note that Eclipse doesn't show up as a "normal" Windows app that can be uninstalled via settings/control panel).

Jantje

Did you start from the sloeber product or a eclipse install?
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 -

wiseda51

I started from a Eclipse neon install (with original Arduino plugin before it became Sloeber).

Forking to another topic, just got an ESP32 module and would love to have that supported by the plugin.  I have my ESP32 working with Eclipse and the ESP32 IDK (FreeRTOS based without Arduino framework and all it's libraries) and also with Arduino but prefer the Eclipse/Arduino combo.  It looks like it might be possible to just hack together a "package_esp32_index.json" similar to the esp8266 file in the ArduinoPlugin folder?  That's definitely doable.  Anything else need to be added?

Jantje

I noticed eclipse puts the installation location in the eclipse.ini. Sloeber does not do so. This info in the eclipse.ini is causing havoc when moving eclipse instances.

As to esp32. this is how I advice to do it https://youtu.be/szRrvJPvQz4

As an independent open source project we value your submission, but we ask for support, either by helping us out coding (yeah, we do understand it does require time) or a Patreon contribution (starting from as low as 1$ a month): this allows us to support people who support us back!
As a supporter you can drag our attention and prioritize your submission...
please become a supporter!
https://www.patreon.com/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 -

wiseda51

Thanks for your advice, I did become a supporter. 

I did not find an eclipse.ini file anywhere, only the /Users/xxx/.p2 directory, presumably Eclipse changed at some point. 

Regarding ESP32, I'm a little embarrassed not figuring this out myself; all my google searches on Eclipse and ESP32 and somehow I missed searching for ESP2 + Sloeber.  It is working great now.  After watching the video I also realized you could easily use the Arduino installed ESP32 tools with same technique (without any need to run the get.exe since presumably Arduino already ran it).  So it seems like a personal choice whether to tie Eclipse and Arduino installs together or leave them independent.  If you use only use Eclipse then your method would clearly be the better choice!  With 3 different installs of ESP32 enviroment (ESP32 IDK, Eclipse Sloeber, and Arduino) it is a bit messy.

And for anyone else who reads this entry:
I did find that there were a lot of errors compiling various Arduino libraries.  Turning off "Show all warnings" in the project properties Arduino Compile Options tab was necessary to build projects (or modify C/C+ General Code Analysis settings).  The errors did seem to be legit at a glance but project compiles and works anyway under both Arduino and Eclipse.

manny2002

Hi guys.
Im on Mac and multiple monitors,, I would like to see the Serial output on my second monitor.
Is there any way to detach the Serial tab to a separate Window?



Jantje

Simply drag the serial monitor outside of the eclipse window.
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 -

jfitter

Just an idea may help someone. I've seen many versions of the how to make a project Arduino IDE/C++ IDE compatible. This works for me and it's really simple.

In folder /myProject/

Complete contents of myProject.ino
Code: [Select]
#include myProject.h

In myProject.h
Code: [Select]
void setup();
void loop();


In myProject.cpp
Code: [Select]
void setup() {........}
void loop() {........}


Now it will build with Arduino IDE AND it will build with a C++ IDE and no need to waste time renaming files etc.

Works for me....

hichhiker

Just an idea may help someone. I've seen many versions of the how to make a project Arduino IDE/C++ IDE compatible. This works for me and it's really simple.

...
FWIW, in my experience you can leave your INO file empty and it will still work in most cases. The only IDE that I ran into that seems to need something in the ino files was Atmel Studio - and that only needed the 3rd party libs.

-HH

Go Up