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. [SOLVED] What is causing this linker error?
Qt 6.11 is out! See what's new in the release blog

[SOLVED] What is causing this linker error?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.9k 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.
  • S Offline
    S Offline
    Sibzor
    wrote on last edited by
    #1

    I am trying to include and use an external library inside my Qt Creator project. The lib was built in Visual Studio 2012 express so I have been sure to download the Visual Studio 2012 version of Qt.

    Just to confirm, inside my Build & Run options, I can clearly see 'Qt 5.3 MSVC2012 OpenGL 32bit' and I have tested to make sure that it is defiantly using the VS2012 compiler.

    If I build a small test project within VS2012, I get LNK4099 warnings e.g.:
    @
    ft800emud.lib(ft800emu_audio_driver_wasapi.obj) : warning LNK4099: PDB 'vc110.pdb' was not found with 'ft800emud.lib(ft800emu_audio_driver_wasapi.obj)' or at 'c:\users\me\documents\visual studio 2012\Projects\Project1\Debug\vc110.pdb'; linking object as if no debug info
    @
    But, the project builds, links and executes just fine like it should do.

    However, if I create the same project in Qt Creator, I get LNK2019 errors for the same functions that only gave warnings in VS2012:
    @
    ft800emud.lib(ft800emu_audio_driver_wasapi.obj):-1: error: LNK2019: unresolved external symbol __imp__CoCreateInstance@20 referenced in function "public: static void __cdecl FT800EMU::AudioDriverClass::begin(void)" (?begin@AudioDriverClass@FT800EMU@@SAXXZ)
    @
    Why do I get these LNK2019 errors instead of LNK4099 warnings when using Qt Creator and how can I resolve this?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sibzor
      wrote on last edited by
      #2

      I came back to update this as I have figured out what is going on.

      The problem is that VS includes ole32.lib in its additional dependencies by default, but Qt Creator does not.

      I added the following line to my .pro file and all was sorted:
      win32:LIBS += -lole32

      Not sure if this will ever help anyone but who knows :)

      1 Reply Last reply
      1
      • B Offline
        B Offline
        brckl
        wrote on last edited by
        #3

        It helped, thanks a lot!

        1 Reply Last reply
        0

        • Login

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