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. unresolved external symbol "public: static struct QMetaObject const QtNodes::BasicGraphicsScene::staticMetaObject"

unresolved external symbol "public: static struct QMetaObject const QtNodes::BasicGraphicsScene::staticMetaObject"

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 209 Views
  • 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.
  • J Offline
    J Offline
    james b-s
    wrote on last edited by james b-s
    #1

    I'm trying to use QtNodes. I installed QtNodes, and Qt5.14. I built a little test application using visual studio 2019 on Windows 10. Built it and got it working.

    I then tried integrating my code with our product. I copied the qtnodes.lib and the qtnodes source code to the build server. When I try to build, I get

    error LNK2001: unresolved external symbol "public: static struct QMetaObject const QtNodes::BasicGraphicsScene::staticMetaObject" (?staticMetaObject@BasicGraphicsScene@QtNodes@@2UQMetaObject@@B)
    

    BasicGraphicsScene is part of the qtnodes library. I do derive from BasicGraphicsScene (indirectly), but I don't have anything in my code that needs moc'ing.

    I've verified that the link on the build server is using the qtnodes.lib that I created and which works on my laptop. I've verified with dumpbin that the undefined symbol exists in the library.

    Version      : 0
    Machine      : 8664 (x64)
    TimeDateStamp: CAAA5512
    SizeOfData   : 0000004B
    DLL name     : QtNodes.dll
    Symbol name  : ?staticMetaObject@BasicGraphicsScene@QtNodes@@2UQMetaObject@@B (public: static struct QMetaObject const QtNodes::BasicGraphicsScene::staticMetaObject)
    Type         : data
    Name type    : name
    Hint         : 311
    Name         : ?staticMetaObject@BasicGraphicsScene@QtNodes@@2UQMetaObject@@B
    

    The problem goes away if I comment out the line where I instantiate MyDataFlowGraphicsScene. MyDataFlowGraphicsScene inherits from DataFlowGraphicsScene which inherits from BasicGraphicsScene.

    here is clearly some significant build difference between my laptop and our build server, but it isn't clear what it might be. As I said, the library is included in the link and the undefined symbol is in the library. That should be enough. And this is the only undefined symbol. I would think that any significant difference would result in lots of undefined symbols.

    There are a couple of differences between what the build server does and what I do on my laptop.

    • Both are using vs2019, but the build server uses a makefile while my laptop builds directly within visual studio.

    • The build server is running windows 10, while I have windows 11 on my laptop.

    • The build server is using a release version of qt while I have a debug version.

    • The build server is using a licensed copy qt 5.15 while I have an unlicensed 5.14

    • On my laptop, multibyte is set, rather than Unicode. I don't know what the build server is set to.

    Some of those above differences might be significant, but I would think any significant difference would result in a different mangled name for BasicGraphicsScene::staticMetaObject.

    Any suggestions as to what to check/try next or what the problem could be, will be appreciated.

    Update: I managed to build qtnodes with qt5.15. It didn't make a difference. I've tried both static and dynamic libraries. No difference.

    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