Including .h files
Page 1 of 1

Author:  AlexJ [ Wed Mar 19, 2014 1:29 pm ]
Post subject:  Including .h files

I need access to some of the .h libraries for programs I've been writing. Whenever I try to run my programs, I get this error:
Couldn't open '#include' file

I've tried saving my programs in several different locations so they'll be on the same path (ex: I saved several directly in the 'ROBOTC Development Environment' folder), but I still get this message.

I've tried this #include header (the way it was in the sample program):
#include "drivers/hitechnic-compass.h"

As well as this:
#include "C:\Program Files (x86)\Robomatter Inc\ROBOTC Development Environment\drivers\hitechnic-compass.h"

Where should I save the files or how should I write #include statements so I can use .h libraries?

Author:  BurningLights [ Wed Mar 19, 2014 2:01 pm ]
Post subject:  Re: Including .h files

This can actually be solved by telling ROBOTC where to look for certain #include files (such as the third party drivers). Navigate in the menus to View->Preferences->Detailed Preferences->Compiler. Under "Directory for User Include Files (Common)" click the first browse button. Navigate to Program Files (or Program Files x86)/Robomatter Inc/ROBOTC Development Environment/Sample Programs/NXT/3rd Party Sensor Drivers/drivers and select it. Voila! You should be all set.

Author:  AlexJ [ Thu Apr 10, 2014 11:54 pm ]
Post subject:  Re: Including .h files

Thank you, this worked great!
As a band aide, I also found .h files can be copied and pasted into file folders outside of the Robomatter folder. If the robotc files are written there as well, this works for me by default.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group