View unanswered posts | View active topics It is currently Thu Nov 15, 2018 2:37 pm






Reply to topic  [ 6 posts ] 
#include files 
Author Message
Rookie

Joined: Tue Aug 19, 2014 12:15 pm
Posts: 37
Post #include files
I created a file named "standard.txt". I want to use the statement #include "standard.txt". I am getting a compiler error. Which directory should standard.txt reside in.

Thanks


Thu Jul 09, 2015 9:31 am
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: #include files
What is the compile error you are seeing? Include files tend to have the .h extension, not .txt.

= 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]


Thu Jul 09, 2015 1:04 pm
Profile WWW
Rookie

Joined: Tue Aug 19, 2014 12:15 pm
Posts: 37
Post Re: #include files
Couldn't open '#include' file 'Ronstandard.h' is the error that I get.

I tried to place the file in RobotC includes directory but did not have access.

thanks


Thu Jul 09, 2015 5:34 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: #include files
Did you try placing it in the same folder as the .c file you're trying to compile?

= 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 Jul 10, 2015 2:43 am
Profile WWW
Rookie

Joined: Tue Aug 19, 2014 12:15 pm
Posts: 37
Post Re: #include files
Thanks for the help. I want to place it in the base directory of my robotC programs that I write. The following works just fine. Now I can have my own include files in one place which will work for any program that I am developing.

#include "C:\Users\R_Ledf\Documents\VexRobots\working_programs\VEX2\Ronstandard.h"

BTW, by placing the Ronstandard.h file in the working directory of the program that I was compiling, that worked also.

Thanks
Ronald


Fri Jul 10, 2015 7:46 am
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: #include files
There's a way you can have a standard folder be in the list of places the compiler will look for header files. You can do this form the preferences dialog, just set your Menu level to "Expert", through Window->Menu Level and then navigate to View->Preferences->Detailed Preferences:
Attachment:
Screenshot at 13-50-14.png
Screenshot at 13-50-14.png [ 20.99 KiB | Viewed 6408 times ]

Click on the "Browse" button and navigate to the folder where you'd like the compiler to look for .h files (C:\Users\R_Ledf\Documents\VexRobots\working_programs\VEX2\ in your case). Click Apply and OK to save and you should be good to go with just the file name to include :)

= 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 Jul 10, 2015 7:53 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


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.