Re: Adding Library for Robots

Bernhard Wymann <[email protected]> Tue, 02 Dec 2014 20:29:53 +0100
Newsgroups gmane.games.torcs.general
Organization wytec
Message-ID <[email protected]>
Hello Joey

Yes. As you are speaking from Makefiles I guess you are working in 
GUN/Linux. An example for using an additional lib in a robot is 
"olethros", have a look at this line in its Makefile:

LIBS        = -L${EXPORTBASE}/lib -llearning

 From gcc man page (read original page for full description):
-Ldir
Add directory dir to the list of directories to be searched for -l.

-l library
Search the library named library when linking. (The second alternative 
with the library as a separate argument is only for POSIX compliance and 
is not recommended.)

So basically you can link any library with this. If you have the library 
only in binary form it might be pretty tricky though, because the 
alignment and name mangling might differ (e.g. if the library was 
complied using some other c++ compiler, or with different alignment 
options).

So in the worst case you have pack the library in a wrapper or dock onto 
it with an adapter or some other way, in the best case you can simply 
link it. If you compile the library by yourself, you will be able to 
simply link it.

Additionally you have eventually to take care about memory management, 
if the library is in binary form only it might bring its own heap 
manager, so it is important that you construct/destruct objects always 
with the same heap manager.

Btw. there is a change which is not yet mentioned in the tutorial:
http://www.berniw.org/trb/forum/showthread.php?topicid=3508

Hope this helps

Bernhard

On 12/02/2014 08:28 AM, Joey Andres wrote:
> Hello,
>
> I just discovered Torcs and robotics and its giving me loads of ideas. I
> just read Berni's tutorial and already started building my AI agent. I
> have a huge c++ library of AI that contains all kinds of learning
> algorithms and data structures and would like to integrate these in
> Torcs. I'm wondering, where in Makefile do I place these libraries and
> headers? Also, is it possible to compile these with -std=c++14? I'd be
> very glad if someone can give me information with these stuff. I've
> googled all possible things with respect to this topic and can't find any.
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Torcs-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/torcs-users
>


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk