Original Post
Hello all,
The other night I decide to have a go at making my own shared library. To start with I thought I would create a library containing one function which prints out a simple message so we do…
#include
void libmessage(void);
void libmessage(void)
{
printf(“hello from lib\n”);
}
I then compile this as a shared library following the example in the manual with the compiler. I am using a version of gcc ported over to Qnx RtP.
I then write a program to try and call this library and this is where the limit of my knowledge ends and guess work starts. So we do….
#include
void libmessage(void);
void main(void)
{
printf (“hello from program\n”);
libmessage();
}
Now when I try to compile this (linking it to my library as given in other examples in the manual) I get an error message saying something like undefined reference to libmessage(). (I think it was that, but I am not on my qnx machine at the moment and I forgot to write it down!). Any way I think it is something to do with the way I tell my program about the function in my library am I doing that part right? I did a search on the Internet but could not find anything about writing libraries so if you could tell me what I am doing wrong or direct me to a site about library creation I would be most grateful.
Sorry for being so long
Paul R