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. Error using include method with nzmqt: undefined reference to 'vtable for nzmqt::ZMQcontext'
Forum Updated to NodeBB v4.3 + New Features

Error using include method with nzmqt: undefined reference to 'vtable for nzmqt::ZMQcontext'

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 362 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.
  • D Offline
    D Offline
    Daniel Williams
    wrote on last edited by Daniel Williams
    #1

    I'm using Qt Creator 4.8.2 on ubuntu 16.04 with nzmqt 3.2.1 and 0mq 4.1.4-7.

    https://github.com/jonnydee/nzmqt

    I've started using nzmqt for use with my console application. I have been able to download the nzmqt code from github. They have excellent support for Qt with several .pro files for different uses including testing. I have been able to open all of their .pro file and successfully build and run them. All of the unit tests pass.

    Now, I'm trying to use the "include" method of working with their code. I have set up my .pro file and the compilation phase passes successfully. But, the linker gives errors:

    /home/inplant/scannerRD/builds/debug/InPlantScanner/IPSconsole/moc_ipsconsoleapp.o:-1: In function `nzmqt::ZMQContext::ZMQContext(QObject*, int)':
    
    /home/inplant/scannerRD/nzmqt/include/nzmqt/impl.hpp:355: error: undefined reference to `vtable for nzmqt::ZMQContext'
    
    
    /home/inplant/scannerRD/nzmqt/include/nzmqt/impl.hpp:359: error: undefined reference to `vtable for nzmqt::ZMQContext'
    
    /home/inplant/scannerRD/builds/debug/InPlantScanner/IPSconsole/moc_ipsconsoleapp.o:-1: In function `nzmqt::PollingZMQContext::PollingZMQContext(QObject*, int)':
    
    /home/inplant/scannerRD/nzmqt/include/nzmqt/impl.hpp:440: error: undefined reference to `vtable for nzmqt::PollingZMQContext'
    
    /home/inplant/scannerRD/nzmqt/include/nzmqt/impl.hpp:440: error: undefined reference to `vtable for nzmqt::PollingZMQContext'
    
    error: collect2: error: ld returned 1 exit status
    

    I have seen similar issues in other projects I have developed (not using nzmqt) and have been able to resolve the issues by ensuring that I have destructors defined for all my classes. I have checked the nzmqt classes and they have destructors and also the Q_OBJECT macro.

    Do you have any suggestions on what I might look at to resolve this?

    (Note: This relates to a post on the nzmqt issues site: https://github.com/jonnydee/nzmqt/issues/51 )

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Daniel Williams
      wrote on last edited by
      #2

      I switched to the static library method and it seems to be working with that.

      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