Results 1 to 2 of 2

Thread: Qt 4.6.1 from Windows/Linux to Mac OS X - .dylib vs .so?

  1. #1
    Join Date
    Feb 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Unhappy Qt 4.6.1 from Windows/Linux to Mac OS X - .dylib vs .so?

    Hello,

    I have been battling with compiling a test C++ application on OS X, v10.6 "Snow Leopard". We're mostly Windows developers, though we have experience with Linux as well, and have compiled a few internal software projects on Linux as well as Free/OpenBSD.

    In my projects, I currently only use Qt functionality that is present in the QtCore module, as such, I need to link against libQtCore.4.so on Linux and QtCore4.dll on Windows. This works fine on Windows/Linux, no problems.

    I have since moved on to OSX, and I'm having a hard time, mostly because I'm confused about the .dylib libraries that Qt produces there. Or, better, I'm confused about the .dylib concept in general.

    I compiled Qt from source, with the "-no-framework" option, as I was hoping that this would yield a libQtCore.4.so file. No such luck however, as it only generates a libQtCore.4.dylib file.

    Consequently, the linker complains:

    ld: library not found for -lQtCore

    At this point I am unsure as to whether Qt supplies .so files at all? So I suppose my questions would be:

    * Can I compile Qt on OS X so that it generates .so files?
    * If so, can I still create a GUI-based app just linking against those .so files?

    * If I can't, then how do I link against those .dylib files with g++ / ld?

    * Can I link against .so and .dylib files at the same time?

    I've been unsuccessful with this for several hours now, and any help and pointers to the right direction would be appreciated.


    /IJFK.

  2. #2
    Join Date
    Feb 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.6.1 from Windows/Linux to Mac OS X - .dylib vs .so?

    As it turns out, the reason why the linker couldn't find libQtCore.4.dylib is because I had passed the library search directory with a space. Instead of supplying

    g++ -o myapp -L/path/to/qt/lib

    I had specified

    g++ -o myapp -L /path/to/qt/lib

    which worked on Linux/BSD, but apparently not on OS X. Seems to be working now. Apparently the linker will automatically link against a .dylib file and there is nothing special that needs to be done.

Similar Threads

  1. Qt Windows v.s. Qt Linux
    By ehsu in forum Qt Tools
    Replies: 1
    Last Post: 7th October 2009, 13:37
  2. Deployment Procedure On Windows On Linux and Windows
    By Harshith J.V. in forum Installation and Deployment
    Replies: 4
    Last Post: 9th July 2009, 11:27
  3. can Qt (on linux) use a windows dll?
    By JeanC in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2008, 10:26
  4. Qt on Windows and Linux
    By Shuchi Agrawal in forum Newbie
    Replies: 4
    Last Post: 12th April 2007, 09:26
  5. QT 3 (linux) to 4(windows XP)
    By deekayt in forum Qt Programming
    Replies: 1
    Last Post: 17th October 2006, 18:30

Tags for this Thread

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.