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. Integrating a library .lib
Qt 6.11 is out! See what's new in the release blog

Integrating a library .lib

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.4k 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.
  • A Offline
    A Offline
    alecs26
    wrote on last edited by
    #1

    Hello,

    I am using Qt to design a desktop interface. I want to integrate a .lib that I have already built using Visual Studio.
    However I get LNK1257: code generation failed. This is surely because my visual studio library used VC++ compiler and Qt uses GCC.

    What would be my best options ? (for instance: transfer the code from my library directly in Qt, compile my library with GCC instead, anything else ?)

    Thank you so much,

    Alex

    K 1 Reply Last reply
    0
    • A alecs26

      Hello,

      I am using Qt to design a desktop interface. I want to integrate a .lib that I have already built using Visual Studio.
      However I get LNK1257: code generation failed. This is surely because my visual studio library used VC++ compiler and Qt uses GCC.

      What would be my best options ? (for instance: transfer the code from my library directly in Qt, compile my library with GCC instead, anything else ?)

      Thank you so much,

      Alex

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @alecs26

      It merely depends on the age of your Visual Studio. For newer versions you can get also precompiled Qt libs. For older version you may have to compile Qt libs yourself.

      You can use also the VS compilers from Qt creator.

      If you prefer to continue with GCC and Qt libs you need to recompile your libs with GCC.

      My personal chioce is the last one. I have changed a while ago from VS to MinGW on windows. However, the decision is with you.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      1
      • A Offline
        A Offline
        alecs26
        wrote on last edited by
        #3

        Perfect, thank you.
        I think I will try to import everything in Qt with GCC. It will also be easier to update and keep running in the future instead of having to manage the .lib with VStudio and the rest with Qt.

        Thank you !

        Alex

        K 1 Reply Last reply
        0
        • A alecs26

          Perfect, thank you.
          I think I will try to import everything in Qt with GCC. It will also be easier to update and keep running in the future instead of having to manage the .lib with VStudio and the rest with Qt.

          Thank you !

          Alex

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @alecs26

          The problem with VS is that you have to recompile for sure every time with a new compiler version. The VS compilers are only compatible as long as you stay within the same version e.g. VS2015.

          Note: Qt libs are the GUI framework and some additional stuff. This is often called simply Qt.
          Qt creator is simply an IDE which uses also Qt libs, but may be used also for other projects. In case you like to port to linux for instance the use Qt creator becomes handy. You do not need to learn another IDE.

          Vote the answer(s) that helped you to solve your issue(s)

          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