Results 1 to 2 of 2

Thread: DLL loading problem on Mac OSX

  1. #1
    Join Date
    Mar 2010
    Location
    Auckland, NZ
    Posts
    121
    Thanks
    9
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default DLL loading problem on Mac OSX

    My Qt app uses QLibrary to access a function in a DLL (actually .dylib). The program works fine on Windows and Linux, but I'm having trouble loading the DLL on Mac OSX.

    QLibrary myLib(dll_path);

    fails to load the DLL. Apparently it can't find it, although I can't be totally sure, since

    errStr = myLib.errorString();

    returns "Unknown error"

    In any case I don't know where the app looks to find the DLL. I started by putting it in /usr/local/lib, Unix-style. I then put it in the same directory as the executable, then I tried putting it in the package, in Contents/Plugins, and adding this to main.cpp

    app.addLibraryPath(app.applicationDirPath() + "/../Plugins");

    but the load always fails. Can someone help?

  2. #2
    Join Date
    Mar 2010
    Location
    Auckland, NZ
    Posts
    121
    Thanks
    9
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: DLL loading problem on Mac OSX

    The answer: DLL built for i386, different architecture from the main program build. I only discovered this when I gave up on the runtime loading, and tried to load the DLL at compile time - the linker immediately gave me the info I needed in an error message.

Similar Threads

  1. Problem loading QPixmap on Qt 4.2 in Symbian s60
    By Tito in forum Qt Programming
    Replies: 9
    Last Post: 11th May 2010, 13:30
  2. Problem loading a dll
    By hubbobubbo in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2010, 16:56
  3. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 19:05
  4. Problem Loading GIF
    By ScoOteR in forum Newbie
    Replies: 3
    Last Post: 6th June 2007, 10:09
  5. QMYSQL loading problem
    By ridgesoft in forum Qt Programming
    Replies: 7
    Last Post: 20th May 2007, 14:47

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.