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. Win 32 lib

Win 32 lib

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 486 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    tony1803
    wrote on last edited by
    #1

    Hello guys! I am building an app to comunicate with a position encoder through a device. Commands can be sent to this device in c++, using their library and headers. From their manual, I understand that their library is written as a 32 bit one (correct me if i’m wrong). If i write the code i visual express it works pretty fine, but when i try to import the .dll and .lib to qt, i first get this error: collect2-ld-returned-5-exit-status. When i apply the solution i found on a lot of sites, i get another error: Unable to start program, path or permission wrong?
    I cannot find any solution to this one, and i am preeety sure the path to the debug executable is correct. Also, when i try to run the executable on it’s own, i get a windows error saying that windows cant run this program.

    Ps: it has size 0

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you using a 32bit build of Qt ?
      How did you "import" the library ?

      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
      0
      • T Offline
        T Offline
        tony1803
        wrote on last edited by tony1803
        #3

        using 64 bit qt build
        win32 {
        LIBS += "C:/Users/Tony/Documents/untitled/lib_name.dll"
        LIBS += "C:/Users/Tony/Documents/untitled/lib_name.lib"
        }
        And i get -> collect2.exe: error: ld returned 5 exit status

        When i also add
        mingw {
        contains(QT_ARCH, x86_64): {
        LIBS+=-Wl,--no-gc-sections
        }
        }
        I get -> Failed to start program. Path or permissions wrong?
        As i mentioned, the executable is built, but is 0kb in size

        jsulmJ 1 Reply Last reply
        0
        • T tony1803

          using 64 bit qt build
          win32 {
          LIBS += "C:/Users/Tony/Documents/untitled/lib_name.dll"
          LIBS += "C:/Users/Tony/Documents/untitled/lib_name.lib"
          }
          And i get -> collect2.exe: error: ld returned 5 exit status

          When i also add
          mingw {
          contains(QT_ARCH, x86_64): {
          LIBS+=-Wl,--no-gc-sections
          }
          }
          I get -> Failed to start program. Path or permissions wrong?
          As i mentioned, the executable is built, but is 0kb in size

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @tony1803 You can't use 32bit libraries in a 64bit application.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • T Offline
            T Offline
            tony1803
            wrote on last edited by
            #5

            Solved when switching to a 32bit qt build. Thank you guys!

            1 Reply Last reply
            1

            • Login

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