Results 1 to 12 of 12

Thread: setlibrarypath does not seem to work on qtnamespace modified frameworks

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,332
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    317
    Thanked 871 Times in 858 Posts

    Default Re: setlibrarypath does not seem to work on qtnamespace modified frameworks

    my problem is that if using my qtnamespace modified frameworks i do a setLibraryPath toward the folder where those (namespace modified) xx.dylib are in my deployed version, they are not seen or used!!!
    How do you know that they are "not seen or used"? Maybe they are in fact "seen" and when Qt tries to load them and looks for the plugin class and its entry point, it finds "MyNamespace::QWhatever" instead and has no idea what to do with that. As amleto is trying to tell you, you can't expect a version of Qt built with no namespace to be able to use parts of a Qt built with a namespace inside a DLL, because you have no way to tell Qt what namespace should be used there.

    It is basic C++: the symbols MyClass::someMethod() and MyNamespace::MyClass::someMethod() are different and cannot be used interchangeably. In the first case MyClass::someMethod() is in the global namespace and should actually be written as ::MyClass::someMethod() to be strictly correct.

    So if you are trying to load a DLL with Qt classes that are qualified by your namespace, and Qt is expecting the plugin classes and their entry points in that DLL to be in the global namespace, then your plugin methods do not match the expected names.

    You can try putting a "using MyNamespace;" declaration somewhere in your source file before you try to load the DLL, maybe that will work. But by doing that, you make the idea of a namespace on your DLL irrelevant because the "using" statement basically tells C++ to import everything into the global namespace before trying to match symbols.
    Last edited by d_stranz; 7th August 2012 at 20:05.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. trying to use Qtnamespace modified QT libs
    By eric_vi in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2012, 18:49
  2. combining frameworks (libcinder or openframeworks)
    By pyramation in forum Qt Programming
    Replies: 2
    Last Post: 6th January 2011, 09:58
  3. puzzle about toolkits and frameworks
    By Raul in forum General Programming
    Replies: 1
    Last Post: 24th July 2010, 09:05
  4. Problem using Qt debug frameworks on Mac
    By bibbinator in forum Qt Programming
    Replies: 2
    Last Post: 5th November 2009, 07:50
  5. Using Mac Frameworks in Qt App
    By yogeshgokul in forum Qt Programming
    Replies: 16
    Last Post: 10th February 2008, 04:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.