Results 1 to 11 of 11

Thread: Compiling a dll (TEMPLATE =LIB) with MSVC2012 leads to unresolved external symbol

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,316
    Thanks
    315
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Compiling a dll (TEMPLATE =LIB) with MSVC2012 leads to unresolved external symbol

    Yes, this will work. I presume that at some point in loading the plugin, you call some type of "initialize()" method and pass in a pointer to a concrete instance of the virtual class, right?

    If you look at the Qt Creator architecture, the main application is pretty much just a plugin loader. All of the functionality of Creator is moved into plugin DLLs, one of which (Core) is required to be present. The other plugins ask Core to do things for them, through virtual interfaces. Your implementation basically merges Core aand the main app together.

  2. #2
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Compiling a dll (TEMPLATE =LIB) with MSVC2012 leads to unresolved external symbol

    Quote Originally Posted by d_stranz View Post
    Yes, this will work. I presume that at some point in loading the plugin, you call some type of "initialize()" method and pass in a pointer to a concrete instance of the virtual class, right?
    Yes exactly. I load the plugin from my main widget (which is a MainWindow, derived from MainWindowInterface, itself derived from QMainWindow), and do something like
    pluginLoader->instance()->init((MainWindowInterface *)this);

    After that the plugin has a concrete instance of my widget, and can use whatever methods or even slots that are defined as virtual in MainWindowInterface.h. That way I don't need to link it against MainWindow's actual code.

Similar Threads

  1. Qt5 and MSVC2012 - unresolved external error
    By Blood9999 in forum Newbie
    Replies: 2
    Last Post: 16th February 2013, 20:26
  2. unresolved external symbol for QGLWidget
    By Wasabi in forum Newbie
    Replies: 1
    Last Post: 13th May 2011, 11:56
  3. unresolved external symbol
    By gridolfi in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2009, 17:58
  4. unresolved external symbol
    By tgreaves in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2009, 19:49
  5. Unresolved External Symbol
    By munna in forum General Discussion
    Replies: 1
    Last Post: 10th May 2006, 19:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.