Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Create your own library, like WPILib? (http://www.chiefdelphi.com/forums/showthread.php?t=128602)

The Doctor 07-04-2014 21:44

Create your own library, like WPILib?
 
I am writing a library, which contains all the stuff my team needs but isn't in WPILib, like integer mapping, threaded timers, and inverse kinematics for mecanum wheel drive. I would like to include it in the standard include directory, so i can simply do an
Code:

#include <MRTLib.h>
at the top of my C++ program and get my library. How do i do this?

I have already created a header and cpp file, which work already.

The Doctor 07-04-2014 23:07

Re: Create your own library, like WPILib?
 
Might i have forgotten to mention that i am using Windriver C++?

Sparkyshires 09-04-2014 12:48

Re: Create your own library, like WPILib?
 
I'd imagine it would be fairly simple to implement. Excellent idea by the way! We may try and accomplish the same thing.

Just copy the format of the WPILib. You would probably have to import all the files into every project you start, easiest way to do that I'd imagine would just have a folder titled MRTLib, and inside a file MRTLib.h, MRTLib.cpp, and all the other things you'd want to create. Just follow the format of the WPILib :D they did pretty well on it!

EDIT: on second thought, you could just add the classes you want into the WPILib! put the files in the WPILib location and add the include into the main WPILib.h file. would make your life a whole lot easier, although you'd have to re-import the classes every year.

rich2202 09-04-2014 12:56

Re: Create your own library, like WPILib?
 
Note: Be careful about R13 (elements created before Kickoff) if you intend to reuse libraries from year to year. There is an exception for "publicly available prior to Kickoff". A post here with a link to your library should be sufficient for "publicly available".

ekapalka 10-04-2014 18:28

Re: Create your own library, like WPILib?
 
psst... I can help you ;) All of my examples have been restricted to methods instead of separate classes and OOP because the vast majority of what I have been trying to teach you guys can be easily contained in a single file. I'll try to put up some examples when I get a chance...


All times are GMT -5. The time now is 12:09.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi