[IRCServices Coding] Problems with exporting functions

Jason farklem farklem at gmail.com
Tue Apr 11 17:08:20 PDT 2006


I have 2 modules im working on.  One of them (OtherServ) needs to access a
function from the other (BotServ).  I have been stuck on this simple thing
for many hours.

I get this error when starting ircservices:
"modules: Unable to load module `otherserv/main':
/home/farklem/ircservices/lib/modules/otherserv/main.so: undefined symbol:
get_botserv_id"

So far this is what I have done with no luck:

1. Added "E int get_botserv_id(const char *chan);" to botserv.h
2. Added #include "modules/botserv/botserv.h" to main.c for BotServ.
3. Added this to main.c for BotServ:

EXPORT_FUNC(get_botserv_id)
int get_botserv_id(const char *chan)
{
     return 0; // Just for testing purposes.
}

4. Edited the Makefile for BotServ to include botserv.h
5. Added #include "modules/botserv/botserv.h" to main.c for OtherServ.
6. Edited the Makefile for OtherServ to include botserv.h

Sorry if that is confusing but I had a hard time figuring out the best way
to organize it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: ../attachments/20060411/27be30f6/attachment.html