Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QLibray load fails : no suitable image found

QLibray load fails : no suitable image found

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 716 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mourad_bilog
    wrote on 21 Feb 2018, 15:27 last edited by
    #1

    Hello everybody,
    I'm trying to load a dylib library using QLibrary load function

    QString strLibrary = QString("%1/secure.dylib").arg(qApp->applicationDirPath());
    
    myLib = new QLibrary(strLibrary);
    if(QLibrary::isLibrary(strLibrary)) // returs true
            qDebug() << "it's a valid library" ; // this message is shown
    

    but

    myLib->load()
    

    returns the following error :

    Cannot load library /Users/admin/SourceMediintel/build-autonome-Desktop_Qt_5_5_1_clang_64bit-Debug/Autonome.app/Contents/MacOS/secure.dylib: (dlopen(/Users/admin/SourceMediintel/build-autonome-Desktop_Qt_5_5_1_clang_64bit-Debug/Autonome.app/Contents/MacOS/secure.dylib, 5): no suitable image found.  Did find:\n\t/Users/admin/SourceMediintel/build-autonome-Desktop_Qt_5_5_1_clang_64bit-Debug/Autonome.app/Contents/MacOS/secure.dylib: no matching architecture in universal wrapper)
    

    I've verified the the secure.dylib properties with file and I've the following messages :

    /Users/admin/SourceMediintel/build-autonome-Desktop_Qt_5_5_1_clang_64bit-Debug/Autonome.app/Contents/MacOS/secure.dylib: Mach-O universal binary with 2 architectures
    /Users/admin/SourceMediintel/build-autonome-Desktop_Qt_5_5_1_clang_64bit-Debug/Autonome.app/Contents/MacOS/secure.dylib (for architecture ppc):	Mach-O dynamically linked shared library ppc
    /Users/admin/SourceMediintel/build-autonome-Desktop_Qt_5_5_1_clang_64bit-Debug/Autonome.app/Contents/MacOS/secure.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
    

    I'm on Qt 5.5 x64

    Can anyone tell me what's wrong and how to fix it

    thanks in advance
    Best regards

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Pablo J. Rogina
      wrote on 21 Feb 2018, 15:42 last edited by Pablo J. Rogina
      #2

      @mourad_bilog said in QLibray load fails : no suitable image found:

      Mach-O dynamically linked shared library ppc
      Mach-O dynamically linked shared library i386

      Not very familiar with dylib files, but if you're on x64 architecture, it looks like you're missing the right binary for you, as it's stated here as well:

      no matching architecture in universal wrapper

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 21 Feb 2018, 21:26 last edited by SGaist
        #3

        Hi,

        @Pablo-J-Rogina is right, your framework was built for 32bit processors. You have to rebuild it for x86-64.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • M Offline
          M Offline
          mourad_bilog
          wrote on 22 Feb 2018, 07:43 last edited by
          #4

          Thanks for your clarifications.
          It's true that the library was build on another Mac OS and now I'm on a x64 Mac.
          So I'll rebuild it.

          Regards

          1 Reply Last reply
          0

          4/4

          22 Feb 2018, 07:43

          • Login

          • Login or register to search.
          4 out of 4
          • First post
            4/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved