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] Qt Creator: linker error when trying to use TaskHub API
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Qt Creator: linker error when trying to use TaskHub API

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

    I am trying to create custom plugin that will add new issues to Issues pane, however when I am trying to use TaskHub API from built-in ProjectExplorer plugin I get unresolved symbol linker error:

    @
    mypluginplugin.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl ProjectExplorer::TaskHub::addCategory(class Core::Id,class QString const &,bool)" (_imp?addCategory@TaskHub@ProjectExplorer@@SAXVId@Core@@AEBVQString@@_N@Z) referenced in function "public: virtual bool __cdecl MyPlugin::Internal::MyPluginPlugin::initialize(class QStringList const &,class QString *)" (?initialize@MyPluginPlugin@Internal@MyPlugin@@UEAA_NAEBVQStringList@@PEAVQString@@@Z)
    @

    That is how I use it, in my myplugin.cpp:

    @
    #include <projectexplorer/taskhub.h>
    ...
    ProjectExplorer::TaskHub::addCategory(
    Core::Id("Unit tests"),
    QLatin1String("Unit tests"));
    ...
    @

    My .pro file:
    @

    QTC_PLUGIN_DEPENDS +=
    coreplugin
    projectexplorer
    @

    I have checked out latest source code of qt creator from the repository, built it and my custom plugin works if I use only api from coreplugin, but I get linker error for everything else.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      gosuwachu
      wrote on last edited by
      #2

      I solved the problem by adding:
      @
      QMAKE_CFLAGS += $$QMAKE_CFLAGS_MT
      QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_MT
      @

      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