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.
  • AathakAA Offline
    AathakAA Offline
    AathakA
    wrote on 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?

    posktomtenP 1 Reply Last reply
    0
    • AathakAA AathakA

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

      posktomtenP Offline
      posktomtenP Offline
      posktomten
      wrote on last edited by
      #2

      @AathakA
      Unfortunately, that is not possible.

      posktomten

      1 Reply Last reply
      2
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on 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
        1
        • SGaistS SGaist

          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 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

          • Login

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