View unanswered posts | View active topics It is currently Wed Apr 23, 2014 10:44 am






Reply to topic  [ 5 posts ] 
multiple includes 
Author Message
Expert

Joined: Tue Feb 28, 2012 3:10 pm
Posts: 195
Post multiple includes
I'm sure there is probably a work around/alternative but i was just hoping

is it possible to allow separation of library paths for the includes? I'm sure most of us use Xander's lib, but I would also like to have my own common library as well. being able to specify both, semi-colon delimited or similar, would be helpful.

as it is now (3.512 pre) there is a user 'include' file for platform, as well as a user include files (common) - so I guess i can use both of those for this, however, just semi separated single entry is more in line with what I'm used to, and to me, more logical.

_________________
Mike aka Spiked3
http://www.spiked3.com


Sat Oct 13, 2012 7:00 pm
Profile
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 614
Post Re: multiple includes
You can always used something like
Code:
#include "./Directory/Filename.h"

where "Directory" is a folder in the same folder that your source file is located.

"../" (up one directory) and "./" are alsoerecognized in the file path for relative file references. Multiple folders can be specified in the name -- "./directory/subdirectory/filename"

You can also specify non-relative (i.e. absolute file names) with
Code:
#include "C:/folderName/filename.h"


Mon Oct 15, 2012 3:45 pm
Profile
Expert

Joined: Tue Feb 28, 2012 3:10 pm
Posts: 195
Post Re: multiple includes
I see what you are saying.

In my case I keep other peoples code very separate from mine, for VCS reasons. I could still move directories around to make this usable (it wouldnt by any chance support environment variables would it? I have not checked), but like I said, was just hoping a change to the compiler so that I could make a single change to a setting in the IDE was easy enough (and more in line with ANSI C :wink: ) as compared to changing/managing include lines in many programs. Maybe at some later point, it is not creating any problems at the moment.

_________________
Mike aka Spiked3
http://www.spiked3.com


Mon Oct 15, 2012 4:51 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: multiple includes
I agree. I would like this feature as well. Since there are different versions of RobotC, different versions of Xander's Driver Suite as well as different versions of our FTC library, I found myself having all these in different folders to test the code. It would be nice to be able to switch the "include path" to point to different versions of the library instead of going into code and change the path of each include. Or worst yet, duplicate the library in another folder so that it is at a fixed relative path (e.g. ..\MyLib). Well, nice to have but not high priority.


Thu Oct 25, 2012 5:38 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3112
Location: Rotterdam, The Netherlands
Post Re: multiple includes
I have an internal build that seems to support multiple include directories :)

Let the rejoicing begin!

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Oct 26, 2012 1:03 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.