Assignee
Type
bug
Priority
major
Status
new
Watchers
1

QxtNetwork cant resolve imports from QxtCore

Anonymous avatarAnonymous created an issue

Something weird is happening to me. I built static versions of Qt and Qxt and now linking them to my program fails. I build dll that links to both QxtCore and QxtNetwork.

c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxtrpcpeer.o):moc_qxtrpcpeer.cpp:(.text+0x15): undefined reference to `_imp___ZN13QxtRPCService16staticMetaObjectE'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxtrpcpeer.o):moc_qxtrpcpeer.cpp:(.text+0x124): undefined reference to `_imp___ZN13QxtRPCService11qt_metacallEN11QMetaObject4CallEiPPv'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxtrpcpeer.o):moc_qxtrpcpeer.cpp:(.text+0x18b): undefined reference to `_imp___ZN13QxtRPCService11qt_metacastEPKc'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxtrpcpeer.o):moc_qxtrpcpeer.cpp:(.text$_ZN10QxtRPCPeerD1Ev[QxtRPCPeer::~QxtRPCPeer()]+0x23): undefined reference to `_imp___ZN13QxtRPCServiceD2Ev'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxtrpcpeer.o):moc_qxtrpcpeer.cpp:(.text$_ZN10QxtRPCPeerD0Ev[QxtRPCPeer::~QxtRPCPeer()]+0x24): undefined reference to `_imp___ZN13QxtRPCServiceD2Ev'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxtrpcpeer.o):qxtrpcpeer.cpp:(.text+0xf): undefined reference to `_imp___ZNK13QxtRPCService17connectionManagerEv'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxtrpcpeer.o):qxtrpcpeer.cpp:(.text+0x6a): undefined reference to `_imp___ZNK13QxtRPCService17connectionManagerEv'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxtrpcpeer.o):qxtrpcpeer.cpp:(.text+0x175): undefined reference to `_imp___ZN13QxtRPCServiceC2EP7QObject'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxtrpcpeer.o):qxtrpcpeer.cpp:(.text+0x1b8): undefined reference to `_imp___ZN13QxtRPCService20setConnectionManagerEP28QxtAbstractConnectionManager'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxtrpcpeer.o):qxtrpcpeer.cpp:(.text+0x1db): undefined reference to `_imp___ZN13QxtRPCServiceC2EP7QObject'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxtrpcpeer.o):qxtrpcpeer.cpp:(.text+0x21e): undefined reference to `_imp___ZN13QxtRPCService20setConnectionManagerEP28QxtAbstractConnectionManager'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxtrpcpeer.o):qxtrpcpeer.cpp:(.text$_ZN17QxtRPCPeerPrivate12getTcpSocketEv[QxtRPCPeerPrivate::getTcpSocket()]+0xe5): undefined reference to `_imp___ZN13QxtRPCService9setDeviceEP9QIODevice'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxttcpconnectionmanager.o):moc_qxttcpconnectionmanager.cpp:(.text+0x17): undefined reference to `_imp___ZN28QxtAbstractConnectionManager16staticMetaObjectE'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxttcpconnectionmanager.o):moc_qxttcpconnectionmanager.cpp:(.text+0x26): undefined reference to `_imp___ZN28QxtAbstractConnectionManager11qt_metacallEN11QMetaObject4CallEiPPv'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxttcpconnectionmanager.o):moc_qxttcpconnectionmanager.cpp:(.text+0x5d): undefined reference to `_imp___ZN28QxtAbstractConnectionManager11qt_metacastEPKc'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxttcpconnectionmanager.o):moc_qxttcpconnectionmanager.cpp:(.text$_ZN23QxtTcpConnectionManagerD1Ev[QxtTcpConnectionManager::~QxtTcpConnectionManager()]+0x23): undefined reference to `_imp___ZN28QxtAbstractConnectionManagerD2Ev'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(moc_qxttcpconnectionmanager.o):moc_qxttcpconnectionmanager.cpp:(.text$_ZN23QxtTcpConnectionManagerD0Ev[QxtTcpConnectionManager::~QxtTcpConnectionManager()]+0x24): undefined reference to `_imp___ZN28QxtAbstractConnectionManagerD2Ev'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxttcpconnectionmanager.o):qxttcpconnectionmanager.cpp:(.text+0x7b): undefined reference to `_imp___ZN28QxtAbstractConnectionManager10disconnectEy'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxttcpconnectionmanager.o):qxttcpconnectionmanager.cpp:(.text+0x394): undefined reference to `_imp___ZN28QxtAbstractConnectionManager13addConnectionEP9QIODevicey'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxttcpconnectionmanager.o):qxttcpconnectionmanager.cpp:(.text+0x516): undefined reference to `_imp___ZN28QxtAbstractConnectionManagerC2EP7QObject'
c:/QtSDK/QtSources/4.8.3_static/lib\libQxtNetwork.a(qxttcpconnectionmanager.o):qxttcpconnectionmanager.cpp:(.text+0x54e): undefined reference to `_imp___ZN28QxtAbstractConnectionManagerC2EP7QObject'`_imp___ZN28QxtAbstractConnectionManagerC2EP7QObject'

And it is being linked using following command (copied from QtCreator output panel)

g++ -static -static-libgcc -Wl --gc-sections -Wl,-s -shared -Wl,--out-implib,c:/src/Proj/ServerDLL/../bin/release//libServerDLL.a -o ../bin/release/ServerDLL.dll ../obj/ServerDLL/release/serverdll.o  -L'./lib' -L'c:/QtSDK/QtSources/4.8.3_static/lib' -LC:/QtSDK/QtSources/4.8.3_static/lib -lQxtNetwork -lQxtCore -lQtNetwork -lQtCore -lssleay32 -llibeay32 -lgdi32 -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -Lc:/src/lib/openssl-1.0.1c

And pro file as simple as it gets:

CONFIG += qxt shared
QXT    += core network
QT     += core network
QT     -= gui

TARGET = ServerDLL
TEMPLATE = lib

DEFINES += SERVERDLL_LIBRARY

SOURCES += serverdll.cpp

HEADERS += serverdll.h\
        ServerDLL_global.h

QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections -fno-exceptions -s
QMAKE_LFLAGS   += -Wl --gc-sections

If unresolved functions are called directly from my dll project they do not produce any errors, this happens only when QxtNetwork (and i suspect other parts of library) try to resolve stuff from QxtCore.

Comments (2)

  1. Log in to comment »
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.