PDA

View Full Version : QtSerialPort + Qt 4.8.4 + Statically Compiled App Not Working



stonerbot613
8th May 2013, 00:43
I am developing an application that I'd like to statically compile so that I can distribute just one .exe file to my end users. It requires the use of serial port communication in order to accomplish all necessary tasks.

I've downloaded QtSerialPort (http://qt-project.org/wiki/QtSerialPort) and gotten it working with no issues on my standard compilation of Qt. However, when I compile the application in my static compilation of Qt (either debug or release mode), the application never runs. QtCreator gives the extremely helpful error "The program has unexpectedly finished."

I can run other apps under my statically compiled Qt just fine so I don't believe that is the source of the error. It feels like it's a library error dealing with QtSerialPort. I've copied the QtSerialPort libraries (libQtSerialPort.a) and includes into the appropriate locations under the Qt static directory tree. In my .pro project file, I've added the following lines:
CONFIG += static
CONFIG += serialport
LIBS += "C:/qt/qt-4.8.4-build-static/lib/libQtSerialPort.a"
INCLUDEPATH += "C:/qt/qt-4.8.4-build-static/include/"

A couple of questions to the group. Is there anything I'm doing wrong? Was QtSerialPort even designed to be compiled statically? If not, is there a way I can 'fudge' things to get it to work?

Thank you everybody.

amleto
8th May 2013, 01:19
I am developing an application that I'd like to statically compile so that I can distribute just one .exe file to my end users. It requires the use of serial port communication in order to accomplish all necessary tasks.

I've download

Do you know that if you do that then you must include your object code and/or another way for users to rebuild your app with a different versin of Qt?

kuzulis
8th May 2013, 09:10
Nobody compiled and didn't check library in a static form.

But I (as developer of library) periodically check library work by its direct connection through serialport-lib.pri the file.
Thus it is necessary to modify some #include and comment Q_DECL_IMPORT macro, otherwise in the process of
compilation there will be errors.

I think that it not a problem in library, a problem somewhere in your appendix therefore it unexpectedly finished.