qnx shared library design

hi

In our project we have some functions which is common to all the modules.
instead of writing these functions in every module, i want to make the
shared library for these functions. but i am unable to find the design /
format of the qnx shared library.

can anyone guide in this matter.

thanks in advance
sameer

sam <sito@vsnl.com> wrote:

hi

In our project we have some functions which is common to all the modules.
instead of writing these functions in every module, i want to make the
shared library for these functions. but i am unable to find the design /
format of the qnx shared library.

QNX4 didn’t really support shared libraries very well.

There was some sample code, and a utility to do it, posted to /usr/free
for this, though.

Try going to:

ftp.qnx.com:/usr/free/qnx4/os/development/

And grabbing everything with mkshlib in the name.

This would include:
mkshlib.tgz.readme
mkshlib-demo.tgz.readme
mkshlib.tgz
mkshlib-demo.tgz
mkshlib-src.tgz
mkshlib-src.tgz.readme

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

In our project we have some functions which is common to all the modules.
instead of writing these functions in every module, i want to make the
shared library for these functions. but i am unable to find the design /
format of the qnx shared library.

You don’t need a SHARED library for that. A static library is what you
really need. You can build a static library with cc command, or directly
invoking ar utility. Then you link your *.c files against the library to
build
executable modules.

thanks for reply…

i am more interested in shared library as with shared library it would be
possible for me to change the functions without any change to
other modules. other modules will basically call the same functions and
receive the result. other modules will not have any knowledge
of what happens inside those functions. with STATIC library, i think, i will
have to recompile the code.

thanks
sameer

sam <sito@vsnl.com> wrote:

thanks for reply…

i am more interested in shared library as with shared library it would be
possible for me to change the functions without any change to
other modules. other modules will basically call the same functions and
receive the result. other modules will not have any knowledge
of what happens inside those functions. with STATIC library, i think, i will
have to recompile the code.

With static, you would have to relink everyone if you changed the library,
with shared you would not.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

sam <sito@vsnl.com> wrote:

thanks for reply…

i am more interested in shared library as with shared library it would be
possible for me to change the functions without any change to
other modules. other modules will basically call the same functions and
receive the result. other modules will not have any knowledge
of what happens inside those functions. with STATIC library, i think, i will
have to recompile the code.

if you mean tasks linking a library:
you could make a server task providing the library services and all other task
will link just the client library to communicate with the task (function enwrapping
Send() call). Then you need to compile only the server to change the services
implementation and not other process.
I am aware that this solution is not natural if there are no data tied to the sevices
shared by all the tasks but why not.

if you mean c modules (.c, .o) calling a library, it is easy to design
the library in such a way that it is not needed to compile .c modules,
just to link altogether (if such a design is not easy, use so-called
opaque pointers).

Andy

thanks
sameer