jwintz
30th May 2006, 12:48
Hi,
My application uses QPlugins. These plugins are a glue between my application objetcs and several libraries. Anyway, in a plugin project file I just specify :
TEMPLATE = lib
CONFIG += plugin release
...
INCLUDEPATH += /Path/To/The/Application/Headers
HEADERS += Plugin.h
SOURCES += Plugin.cpp
So of course, running nm on the library tells that several symbols are undefined. No problem, they will be found at runtime since the application defines them. It works perfectly well on linux when the plugin config is not set.
To make this compile on MacOsX you need to add in your project file :
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3
QMAKE_LFLAGS += -undefined dynamic_lookup
So the plugin works on MacOSX but on linux I have undefined symbols at runtime : symbol lookup error. These problems only occurs with function defined in a source file within a namespace. Declaring them in the header solves the problem but this is not a solution.
By default objects are compiled with -fPIC and the plugin is linked with -shared so that it should work but it doesn't :confused:
Does anybody have a solution to make my plugins work on linux ?
My application uses QPlugins. These plugins are a glue between my application objetcs and several libraries. Anyway, in a plugin project file I just specify :
TEMPLATE = lib
CONFIG += plugin release
...
INCLUDEPATH += /Path/To/The/Application/Headers
HEADERS += Plugin.h
SOURCES += Plugin.cpp
So of course, running nm on the library tells that several symbols are undefined. No problem, they will be found at runtime since the application defines them. It works perfectly well on linux when the plugin config is not set.
To make this compile on MacOsX you need to add in your project file :
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3
QMAKE_LFLAGS += -undefined dynamic_lookup
So the plugin works on MacOSX but on linux I have undefined symbols at runtime : symbol lookup error. These problems only occurs with function defined in a source file within a namespace. Declaring them in the header solves the problem but this is not a solution.
By default objects are compiled with -fPIC and the plugin is linked with -shared so that it should work but it doesn't :confused:
Does anybody have a solution to make my plugins work on linux ?