y50a7XpWRH66IV
May 26th, 2010, 02:11 AM
Hi everyone,
I am currently writing a GTK program that involves the use of plugins. I have successfully compiled my main program, which is then suppose to load my plugin.
My plugin compiles and loads fine until I start using SimCList for its linked-list functions.
I have copied simclist.h and simclist.c into my plugin's structure as follows:
libmyplugin.c
libmyplugin.h
libplugincallbacks.h
libplugincallbacks.c
simclist.h
simclist.c
I have included simclist using:
#include "simclist.h"
My program compiles fine into a .so file.
However, whenever I call something that uses a simclist function, I get an error like this:
symbol lookup error: modules/libmyplugin.so: undefined symbol: list_init
It is strange that I can call functions within libmyfunctioncallbacks.h without any problems.
The simclist documentation mentions that compiling with the -std=c99 flag is needed. So I have modified my makefile to the following, but it did not make any difference:
libmyplugindir= /
libmyplugin_LTLIBRARIES=libmyplugin.la
libmyplugin_la_SOURCES=libmyplugin.c libmyplugincallbacks.c simclist.c
include_HEADERS = libmyplugincallbacks.h simclist.h
libmyplugin_la_LDFLAGS= -lc -lgcc -std=c99 -avoid-version --export-dynamic @PACKAGE_LDFLAGS@
libmyplugin_la_LIBDADD = @PACKAGE_LIBS@
INCLUDES = @PACKAGE_CFLAGS@
Any ideas appreciated! :)
I am currently writing a GTK program that involves the use of plugins. I have successfully compiled my main program, which is then suppose to load my plugin.
My plugin compiles and loads fine until I start using SimCList for its linked-list functions.
I have copied simclist.h and simclist.c into my plugin's structure as follows:
libmyplugin.c
libmyplugin.h
libplugincallbacks.h
libplugincallbacks.c
simclist.h
simclist.c
I have included simclist using:
#include "simclist.h"
My program compiles fine into a .so file.
However, whenever I call something that uses a simclist function, I get an error like this:
symbol lookup error: modules/libmyplugin.so: undefined symbol: list_init
It is strange that I can call functions within libmyfunctioncallbacks.h without any problems.
The simclist documentation mentions that compiling with the -std=c99 flag is needed. So I have modified my makefile to the following, but it did not make any difference:
libmyplugindir= /
libmyplugin_LTLIBRARIES=libmyplugin.la
libmyplugin_la_SOURCES=libmyplugin.c libmyplugincallbacks.c simclist.c
include_HEADERS = libmyplugincallbacks.h simclist.h
libmyplugin_la_LDFLAGS= -lc -lgcc -std=c99 -avoid-version --export-dynamic @PACKAGE_LDFLAGS@
libmyplugin_la_LIBDADD = @PACKAGE_LIBS@
INCLUDES = @PACKAGE_CFLAGS@
Any ideas appreciated! :)