Results 1 to 5 of 5

Thread: How to load the libraries in the Frameworks folder of the app using QLibrary on MacX?

  1. #1
    Join Date
    Jan 2006
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default How to load the libraries in the Frameworks folder of the app using QLibrary on MacX?

    Hi,

    I have a program using the QLibrary to load some libraries dynamically in code. At first, I copied the program and its libraries to a directory, created a script file to set some environment variables like PATH, DYLD_LIBRARY_PATH,... then run that script file from Terminal window to start the application, it works well.

    But now, I want my application is able to be started from Finder window by double-clicking. So, I copied all libraries of the application to the Frameworks directory and used install_name_tool as mentioned in the document of Trolltech. Everything is ok but the libraries loaded by QLibrary don't work more, the QLibrary::load() method always return false. I have tried some different paths to those libraries in code but nothing changes.

    Is there anyway to load the libraries in Frameworks directory using QLibrary?

    Any help is appreciated.

    Thanks very much.

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: How to load the libraries in the Frameworks folder of the app using QLibrary on M

    Always in situation like that best way - to use exetnded program like FileMonitor, that can tell you where exactly your app try to find needed library.

    look here
    a life without programming is like an empty bottle

  3. #3
    Join Date
    Jan 2006
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to load the libraries in the Frameworks folder of the app using QLibrary on M

    Quote Originally Posted by zlatko
    Always in situation like that best way - to use exetnded program like FileMonitor, that can tell you where exactly your app try to find needed library.

    look here
    Thanks for your suggestion,

    I'm downloading that tool, but I have another question:

    Can I change folder that the app looks for needed libraries? I tried the QCoreApplication::addLibraryPaths(),... but it seems that those methods are only used for plugins.

  4. #4
    Join Date
    Jan 2006
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to load the libraries in the Frameworks folder of the app using QLibrary on M

    Quote Originally Posted by zlatko
    Always in situation like that best way - to use exetnded program like FileMonitor, that can tell you where exactly your app try to find needed library.

    look here
    Thanks for your suggestion,

    I'm downloading that tool, but I have another question:

    Can I change folder that the app looks for its libraries? I tried the QCoreApplication::addLibraryPaths(),... but it seems that those methods are only used for plugins.

  5. #5
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: How to load the libraries in the Frameworks folder of the app using QLibrary on M

    First what i can tell you now - you can use environment vars, actually in win its LIB. Add needed you path there...how you can set it from Qt....it must be diggered
    a life without programming is like an empty bottle

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.