[Ctk-developers] Linking a shared library within a plugin

Florian Ganglberger Florian.Ganglberger at student.i-med.ac.at
Mon Aug 26 04:18:13 EDT 2013


Hi Jc,
we can't really use a debugger, since we don't have the code for the shared
library, only the header files. The methods of the shared library is
definitely called, because we get an error message that a connection to the
tracker can't be established. Can it be a problem, that the plugins are
also shared libraries? We'll write a shared library that calls the tracker
today, so we can see if the problem depends on calling the tracker-library
from a shared library or if it is ctk specific.

Additional information: As far as we know, the tracker library was written
in C (and not in C++)

Thanks for your help,
Florian


2013/8/24 Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>

> Hi Florian,
> If it build without problem, did you try using a debugger to try to
> understand what s wrong?
> Jc
>
> --
> Sent from my mobile device
> On Aug 23, 2013 12:00 PM, "Florian Ganglberger" <
> Florian.Ganglberger at student.i-med.ac.at> wrote:
>
>> Hi,
>> we are trying to link a shared library to connect to tracker from a
>> plugin. We know, that the code that calls the .so library works in a test
>> application and also in the main method of our CTK application. After we
>> have added our code to the plugin and linked it to the .so library, we can
>> link and compile the code without errors, but we don't get a connection to
>> the tracker.
>> The cmakelists code to link the .so file in our test application is
>> TARGET_LINK_LIBRARIES(optoExtern ${OPTOTRAK_LIBRARY})
>> (${OPTOTRAK_LIBRARY} is the library path, optoExtern the project name)
>>
>> The cmakelists code to link the .so file in our plugin:
>> ctkMacroBuildPlugin(
>>   NAME ${PROJECT_NAME}
>>   EXPORT_DIRECTIVE ${PLUGIN_export_directive}
>>   SRCS ${PLUGIN_SRCS}
>>   MOC_SRCS ${PLUGIN_MOC_SRCS}
>>   UI_FORMS ${PLUGIN_UI_FORMS}
>>   INCLUDE_DIRECTORIES ${Plugin_SOURCE_DIR}
>>   RESOURCES ${PLUGIN_resources}
>>   TARGET_LIBRARIES ${PLUGIN_target_libraries} ${OPTOTRAK_LIBRARY}
>> )
>>
>> Has anyone an idea how to link external shared libraries within a plugin
>> properly?
>>
>> Best regards,
>> Florian Ganglberger
>>
>> _______________________________________________
>> Ctk-developers mailing list
>> Ctk-developers at commontk.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20130826/15599ef5/attachment.html>


More information about the Ctk-developers mailing list