Subject:
|
Re: How to build a shared library
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Wed, 16 Mar 2005 18:51:46 GMT
|
Viewed:
|
7484 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:
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|