Do you link the right lib files to your code? Do you have build Qt static for release and debug mode?
Do you link the right lib files to your code? Do you have build Qt static for release and debug mode?
Hi Lykurg,
Linking fails both in debug and release mode. I have built Qt statically both for release and debug mode.
QtCreator makes my .pro file, and Qt core and gui are included. I just added stuff to use QextSerialPort (which is working by the way, so that's not the issue). I would be surprised if I had to manually add an extra LIB just to use a QTableWidget.
Qt Code:
QT += core gui TARGET = DibScan TEMPLATE = app SOURCES += main.cpp\ mainDialog.cpp HEADERS += mainDialog.h FORMS += mainDialog.ui INCLUDEPATH += ".\include" LIBS += -lqextserialport win32:DEFINES = _TTY_WIN_ QWT_DLL QT_DLLTo copy to clipboard, switch view to plain text mode
I don't see why the QTableWidgetItem::setText() function is no problem, but the text() function is. It should be in the same source file in Qt I would think.
Best regards,
Marc
Can't see "CONFIG += static" and I don't know QT_DLL exactly, but dll is not what you want when you link static. I am a little confused. ([WIKI]Building static Qt on Windows[/WIKI])
Last edited by Lykurg; 10th September 2010 at 16:27. Reason: spelling corrections
marcvanriet (10th September 2010)
Hi Lykurg,
Thanks, you pointed me in the right direction.
I just blindly copied the #win32EFINES = _TTY_WIN_ QWT_DLL QT_DLL from the example with QextSerialport to my .pro file. I tought it just had to do something with Qextserialport.
But the QT_DLL and QWT_DLL defines are of course not allowed for a static application. Everything works if I leave it out.
I'm not sure why I don't need the CONFIG += static line. I think it is because I modified the QMAKE_CFLAGS / CXXFLAGS / LFLAGS directly in the qmake.conf file in the mkspecs directory.
Best regards,
Marc
Bookmarks