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. Linking .lib file generated with MSVC in Qt Creator that uses gcc
Forum Updated to NodeBB v4.3 + New Features

Linking .lib file generated with MSVC in Qt Creator that uses gcc

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 649 Views 3 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
    AathakA
    wrote on 3 Dec 2022, 22:27 last edited by
    #1

    Hi, I need to use a library generated with MSVC in my GCC project, what are the solutions and their pros and cons?

    P 1 Reply Last reply 3 Dec 2022, 23:37
    0
    • A AathakA
      3 Dec 2022, 22:27

      Hi, I need to use a library generated with MSVC in my GCC project, what are the solutions and their pros and cons?

      P Offline
      P Offline
      posktomten
      wrote on 3 Dec 2022, 23:37 last edited by
      #2

      @AathakA
      Unfortunately, that is not possible.

      posktomten

      1 Reply Last reply
      2
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 4 Dec 2022, 19:50 last edited by
        #3

        Hi,

        There are two cases:

        1. C++ library ? No way as @posktomten wrote
        2. C library ? Nothing special to do, use it and link to it

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

        S 1 Reply Last reply 5 Dec 2022, 08:09
        1
        • S SGaist
          4 Dec 2022, 19:50

          Hi,

          There are two cases:

          1. C++ library ? No way as @posktomten wrote
          2. C library ? Nothing special to do, use it and link to it
          S Offline
          S Offline
          SimonSchroeder
          wrote on 5 Dec 2022, 08:09 last edited by
          #4

          @SGaist Well, since a C library works one could write a wrapper around the MSVC C++ library (using an MSVC compiler) and then use the C bridge from within GCC. Also, the name mangling (Microsoft calls it 'decorated names') seems to be well documented, so you could call the mangled name by hand/write a bridge class that internally calls the mangled name. It is definitely messy and tedious to use a library compiled for a different compiler.

          Did find just this: https://gcc-help.gcc.gnu.narkive.com/8ikYYHZN/convert-gcc-under-cygwin-name-mangling-to-vc-name-mangling
          Besides the name mangling there is additional problems with the C++ ABI. This leaves only a C wrapper to interface between MSVC C++ and GCC C++.

          1 Reply Last reply
          1

          1/4

          3 Dec 2022, 22:27

          • Login

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