<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Florian,<br>
      <br>
      this all sound really strange...<br>
      <br>
      as you have noted already yourself, plug-ins are also just shared
      libraries, which are loaded dynamically at runtime. If I
      understood you right, in the case of linking the proprietary
      tracker library to the plug-in, the plug-in starts successfully
      but the tracker library reports a runtime error. Is that correct?<br>
      <br>
      The only difference of which I can think of (compared to the
      working cases you mentioned), is that the plug-in is loaded via
      "dlopen" (on POSIX systems) using the QLibrary class. Depending on
      the Plugin Framework options<br>
      <br>
<a class="moz-txt-link-freetext" href="http://www.commontk.org/docs/html/structctkPluginConstants.html#a29af0cac606ca29ea8d66d342d05060e">http://www.commontk.org/docs/html/structctkPluginConstants.html#a29af0cac606ca29ea8d66d342d05060e</a><br>
      <br>
      different load hints are passed to QLibrary
      (<a class="moz-txt-link-freetext" href="http://qt-project.org/doc/qt-4.8/qlibrary.html#loadHints-prop">http://qt-project.org/doc/qt-4.8/qlibrary.html#loadHints-prop</a>).
      These load hints might affect symbol resolutions of subsequently
      loaded libraries, like your tracker library.<br>
      <br>
      But if all this really relates to your actual problem is not clear
      to me, sorry.<br>
      <br>
      Best,<br>
      <br>
      Sascha<br>
      <br>
      <br>
      On 08/26/2013 02:37 PM, Florian Ganglberger wrote:<br>
    </div>
    <blockquote
cite="mid:CAFfsywhvPrfJ9t4ZZ7o9kiJ4UEKg55v_muBSW9DB8KSpTXPmgA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Jc,
        <div style="">we've built a new shared library which calls our
          shared-tracker-library. It works perfectly outside of our
          plugin and the tracker can connect. As soon as we link the new
          shared library into the plugin, we have our connection problem
          again. It calls the function, produces all the output, but
          can't connect. So we can say that the<u> shared tracker
            library works for:</u></div>
        <div style=""><b>- a normal example program</b>:   example
          program --> shared tracker library</div>
        <div style=""><b>- the main method of our ctk app:</b>   ctk app
          --> shared tracker library</div>
        <div style=""><b>- called from a "normal" shared library: </b>  
          example program --> "normal" shared library  --> shared
          tracker library</div>
        <div style=""><br>
        </div>
        <div style=""><u>and not for:</u></div>
        <div style=""><b>- the plugin</b> (which is a shared library):
          ctk plugin --> shared tracker library</div>
        <div style=""><b>- a call from a shared library which is called
            by the plugin</b>:  ctk plugin --> "normal" shared
          library  --> shared tracker library</div>
        <div style=""><br>
        </div>
        <div style="">Actually we have no idea, why it doesn't work....</div>
        <div style=""><br>
        </div>
        <div style="">Thanks for your help,</div>
        <div style="">Florian </div>
        <div style=""><br>
        </div>
      </div>
      <div class="gmail_extra">
        <br>
        <br>
        <div class="gmail_quote">2013/8/26 Florian Ganglberger <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:Florian.Ganglberger@student.i-med.ac.at"
              target="_blank">Florian.Ganglberger@student.i-med.ac.at</a>></span><br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Hi Jc,
              <div>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.</div>
              <div><br>
                Additional information: As far as we know, the tracker
                library was written in C (and not in C++)</div>
              <div><br>
              </div>
              <div>Thanks for your help,</div>
              <div>Florian</div>
              <div>
                <div class="h5">
                  <div class="gmail_extra">
                    <br>
                    <br>
                    <div class="gmail_quote">
                      2013/8/24 Jean-Christophe Fillion-Robin <span
                        dir="ltr"><<a moz-do-not-send="true"
                          href="mailto:jchris.fillionr@kitware.com"
                          target="_blank">jchris.fillionr@kitware.com</a>></span><br>
                      <blockquote class="gmail_quote" style="margin:0 0
                        0 .8ex;border-left:1px #ccc
                        solid;padding-left:1ex">
                        <p>Hi Florian,<br>
                          If it build without problem, did you try using
                          a debugger to try to understand what s wrong?<br>
                          Jc</p>
                        <p>--<br>
                          Sent from my mobile device</p>
                        <div class="gmail_quote">
                          <div>
                            <div>On Aug 23, 2013 12:00 PM, "Florian
                              Ganglberger" <<a moz-do-not-send="true"
href="mailto:Florian.Ganglberger@student.i-med.ac.at" target="_blank">Florian.Ganglberger@student.i-med.ac.at</a>>
                              wrote:<br type="attribution">
                            </div>
                          </div>
                          <blockquote class="gmail_quote"
                            style="margin:0 0 0 .8ex;border-left:1px
                            #ccc solid;padding-left:1ex">
                            <div>
                              <div>
                                <div dir="ltr"><span
                                    style="font-family:arial,sans-serif;font-size:13px">Hi,</span>
                                  <div
                                    style="font-family:arial,sans-serif;font-size:13px">
                                    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. </div>
                                  <div
                                    style="font-family:arial,sans-serif;font-size:13px">The
                                    cmakelists code to link the .so file
                                    in our test application is</div>
                                  <div
                                    style="font-family:arial,sans-serif;font-size:13px">TARGET_LINK_LIBRARIES(optoExtern
                                    ${OPTOTRAK_LIBRARY})</div>
                                  <div
                                    style="font-family:arial,sans-serif;font-size:13px">(${OPTOTRAK_LIBRARY}
                                    is the library path, optoExtern the
                                    project name)</div>
                                  <div
                                    style="font-family:arial,sans-serif;font-size:13px"><br>
                                  </div>
                                  <div
                                    style="font-family:arial,sans-serif;font-size:13px">
                                    The cmakelists code to link the .so
                                    file in our plugin:</div>
                                  <div
                                    style="font-family:arial,sans-serif;font-size:13px">
                                    <div>ctkMacroBuildPlugin(</div>
                                    <div>  NAME ${PROJECT_NAME}</div>
                                    <div>  EXPORT_DIRECTIVE
                                      ${PLUGIN_export_directive}</div>
                                    <div>  SRCS ${PLUGIN_SRCS}</div>
                                    <div>  MOC_SRCS ${PLUGIN_MOC_SRCS}</div>
                                    <div>  UI_FORMS ${PLUGIN_UI_FORMS}</div>
                                    <div>  INCLUDE_DIRECTORIES
                                      ${Plugin_SOURCE_DIR}</div>
                                    <div>  RESOURCES ${PLUGIN_resources}</div>
                                    <div>  TARGET_LIBRARIES
                                      ${PLUGIN_target_libraries}
                                      ${OPTOTRAK_LIBRARY}</div>
                                    <div>)</div>
                                    <div><br>
                                    </div>
                                    <div>Has anyone an idea how to link
                                      external shared libraries within a
                                      plugin properly?</div>
                                    <div><br>
                                    </div>
                                    <div>Best regards,</div>
                                    <div>Florian Ganglberger</div>
                                  </div>
                                </div>
                                <br>
                              </div>
                            </div>
_______________________________________________<br>
                            Ctk-developers mailing list<br>
                            <a moz-do-not-send="true"
                              href="mailto:Ctk-developers@commontk.org"
                              target="_blank">Ctk-developers@commontk.org</a><br>
                            <a moz-do-not-send="true"
                              href="http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers"
                              target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers</a><br>
                            <br>
                          </blockquote>
                        </div>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>