Pages: [1]   Go Down
Author Topic: Can't have editable .h or .cpp files outside folder?  (Read 1251 times)
0 Members and 1 Guest are viewing this topic.
Anacortes, WA
Offline Offline
Full Member
***
Karma: 2
Posts: 163
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So the only way I can have an editable .h or .cpp file is to let it live in my project's folder?

I have files for library classes that I need to use in multiple projects. I -could- put them in the library folder, but alas, then I can't edit them. (with the IDE)

Most everyone must run into this.

How about setting up the IDE so it can use aliases to my library files in my project folders? Would this be a doable change to the IDE? (Cause it can't do it now.)

-jim lee
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 50039
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have files for library classes that I need to use in multiple projects. I -could- put them in the library folder, but alas, then I can't edit them. (with the IDE)
A class does not qualify as a library, in my opinion, until it IS used in more than one project. When it is used in more than one project, it is a library, and should have already been debugged. So, editing should not be necessary.

Any text editor can be used to edit the library class files outside of the IDE. Save any edited files, then go to the IDE and compile and link the sketch. The library will be recompiled, too.

Quote
How about setting up the IDE so it can use aliases to my library files in my project folders? Would this be a doable change to the IDE? (Cause it can't do it now.)
If you are using a Unix variation, you can create symbolic links in the sketch folder to files that live elsewhere. If you are using Windows, you can create reparse points that serve the same purpose, programatically. I have no idea how you would do this using the Windows OS itself.
Logged

Anacortes, WA
Offline Offline
Full Member
***
Karma: 2
Posts: 163
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"When it is used in more than one project, it is a library, and should have already been debugged. So, editing should not be necessary."

No.. That's like "We designed a perfect engine, weld them into the cars."  My shared code is pretty good, but never that good. It would be very useful to be able to edit it with the IDE without dumping it all into the folder containing the project.

If I have N projects sharing the same code I now have N versions of the same shared code? Why does it have to be this way?

And, I'm on a Mac, not UNIX.

-jim lee
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 631
Posts: 50039
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
And, I'm on a Mac, not UNIX.
Running OSX, right? Based on Unix.

If you are needing to make changes to some code that is used in another application, how are you ensuring that the changes do not break the other application?

The IDE isn't perfect, but, then, how much did you pay for it?

The ability to have multiple files in one directory exists. The ability to use (not edit) files from another directory (a library) exists.

The ability to make a file appear to be in more than one directory at a time exists, for most operating systems.

It is up to you to figure out how that works for your operating system, and use that feature to make it appear as though the library file were local to the sketch directory, if that is really what you need to do.
Logged

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1922
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Jimlee
Don't expect any tool to solve all your pains. Especially the free tools. They are build by people who sacrifice their free time to make your life easier. If you use the free tools the writers deserve at least your respect.
 
The Arduino IDE caters for simple, robust, straightforward. This is done because anyone who wants to start with Arduino has so much to learn that you need a simple IDE to succeed. I feel the Arduino IDE has chosen the correct approach and does a great job.
However when you grow on the coding side you start feeling the limitations of the Arduino IDE brought by the correct decisions above. For me library development is the one that made me add eclipse to my arduino toolset.
So maybe you should consider adding a tool to the Arduino IDE.
I'm not a mac specialist so I don't know what is available on mac os. I do know my eclipse plugin is working on mac. See this article of garretto on how to set it up on mac osx. http://robots.dacloughb.com/project-1/setting-up-the-arduino-eclipse-environment-on-mac-os-x-lion/
But I'm sure that if you search the forum you'll find other options.


Best regards
Jantje
Logged

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 -

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Jantje, just use a program editor for the lib files and the IDE for your sketches. You get syntax highlighting etc.

- http://forums.macrumors.com/showthread.php?t=749199 -

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1922
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

robtillaart
I've been there. Wasn't good enough for me.
As I said there are plenty of tools. Pick the ones you like but do not expect one tool to solve all your problems.
Best regards
Jantje
Logged

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 -

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 220
Posts: 13836
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
do not expect one tool to solve all your problems

If your only tool is a hammer every problem starts looking like a nail smiley-wink
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1922
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If your only tool is a hammer every problem starts looking like a nail smiley-wink
And if you treat every problem like a nail you go as quick as a snail.
Jantje
Logged

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 -

Pages: [1]   Go Up
Jump to: