To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3883
3882  |  3884
Subject: 
Re: How to build a shared library
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 16 Mar 2005 18:51:46 GMT
Viewed: 
7210 times
  
Hello Anne,

How can I dynamically link my c++ classes or rather build a shared library with
the brickos Makefiles?

You can't. Shared libraries are not supported by brickOS. Shared memory or
shared libraries are not a feature of a compiler but a feature of the
underlying OS.

But you can do it the hard way:

- put all shared routines in program 1.
- include a jump table to the routines
- and display the address of the jump table

Start program 1 and note the jump table start address.

Now you can call the external routines from your user programs via the jump table.

But beware! This hack is in no way multitasking-proof, you must have an eye on
race conditions and should try to secure the calling with some semaphore
mechanism.

You can find some sort of demo program (regarding shared memory, but you will
get the idea) here:

http://news.lugnet.com/robotics/rcx/legos/?n=2175

Regards,

Michael



Message is in Reply To:
  How to build a shared library
 
Hello! How can I dynamically link my c++ classes or rather build a shared library with the brickos Makefiles? Anne. (19 years ago, 16-Mar-05, to lugnet.robotics.rcx.legos)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR