Results 1 to 12 of 12

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

  1. #1
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

    Default setlibrarypath does not seem to work on qtnamespace modified frameworks

    1 / using configure and make i built a new set of qtframework with a new namespace...
    ./configure -qtnamespace foo -qt-libjpeg

    all works fine so far...


    2/ to deploy i take care of my frameworks and that works fine

    3/ now for my jpeg plugin ...
    i create a 'myplugin' folder and i put the libqjpeg.dylib that was generated there

    in my code i have a QCoreApplication::setLibraryPaths("/myplugin");


    when i test my program .... the setLibraryPaths does not seemed to be used at all and the jpeg is loaded only if the frameworks are within /usr/local/Trolltech/Qt-4.8.2/lib which is not what i want at all when deployed

    (working with the standard qt without namespace change, i have no problem, so i must be missing something...)

    i am stuck here, have no clue what i am doing wrong, many thanks for all help

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

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

    Do you only configure a qt namespace for a single plugin?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

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

    no i was simplifying... i did the ones within imageformats

    ./configure -qtnamespace foo -qt-zlib -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

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

    so you have some of qt built with a namespace, and some built without a namespace.

    Do you not think that might be a problem?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

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

    which ones can be without namespace? i use all the .dylib generated after make, the console is not giving me any message either what i do not understand is that qt does not seem to look at the path i provide (it does when i use the standard version of qt), i am not even sure where qt is loading those dylib from

  6. #6
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

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

    I dont know what dylib is.

    If you want to build qt in a namespace I would expect that you have to build ALL of it in a namespace.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  7. #7
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

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

    the xx.dylib are the dll that are result of the make... and yes that is what i am thinking too... but i do not think the issue is there.

    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!!! (if i do the same with the standard frameworks, i have no problem all works fine the setLibraryPath pick the standard dll fine...)

  8. #8
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

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

    I shall find a brick wall to talk to. Dont mind me...
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  9. #9
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,320
    Thanks
    316
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    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.

  10. #10
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

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

    i never said that my dll are using a qt modified namespace and that my frameworks are standard... no no! they both are the result of the same make with the -qtnamespace

    this is what i did :

    1/ i built a qt version with modified namespace, installed it... tested it and i know that my program is using it.

    2/ i have deployed my program and my program is now using exclusively the qt modified namespace i built and this works fine. I have absolutely no standard qt anymore on my machine!

    3/ i now for deployment take the dylibs that have been built together with modified qtnamespace (i am assuming they use the qt modified namespace framework, i also need to deploy each of them, i did that hundreds of time with standard library, it is not new for me) I place them in a folder and use the setlibrarypath to point into this folder.... i can see that my (qt namespace modified dylibs are not loaded...)


    that is why i am asking is there something else you need to do to use qt namespace modified dll with qt namespace modified frameworks (assuming those qtnamespace are the same of course)

  11. #11
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,320
    Thanks
    316
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

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

    i can see that my (qt namespace modified dylibs are not loaded...)
    How did you prove to yourself that this statement is true?

    no i was simplifying... i did the ones within imageformats

    ./configure -qtnamespace foo -qt-zlib -qt-libpng -qt-libmng -qt-libtiff -qt-libjpeg
    In this previous post, you said that you only built part of Qt (the image support plugins) using the namespace, the rest was built using no namespace. Are you now saying that the entire Qt distribution was built using your namespace, and that everything you are compiling and linking to (dynamically or otherwise) is in the same namespace, including your application?

    Did you actually try the "using namespace;" declaration? Did it make any difference?
    <=== 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.

  12. #12
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

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

    no in previous posts if i quote myself i said " if using my qtnamespace modified frameworks i do a setLibraryPath toward the folder where those (namespace modified) xx.dylib are in my deployed version ... "

    yes everything is built using qtnamespace there is NO mixup... when i run in a non deployed version all works fine and in debug mode i can see that the QT_BEGINNAMESPACE works properly and use the qtnamespace modified frameworks.


    my issue is in deployment mode when i try to load the qtnamespace modified dll (who have been deployed too!) located in my own plugin folder using setLibraryPath those dll are not used.

    i know they are not used because again i am in deployment mode.. the only qt left are the (qtnamespace modified) frameworks located in my own framework folder. (i removed those that were installed with make install). Now if i try to use the (qtnamespace modified) qtjpeg.dylib located in my own plugin folder (that has been designated thru setLibraryPath) to open jpeg image , they are not opened.

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.