Hi, I use Qt 4.7.4 on Win7 with Visual Studio 2010(64bit).
I wanted to install QextSerialPort as static library, and I followed the instructions here.
It says:
Usage(3):Shared or Static Library Without Installation
If I don't want to install the library to my system. How should I do?
It's easy too. ;-)
1. ã€Config】 Write a config.pri file.(read config_example.pri for reference):
shared library
static library
2. ã€Build】 Changed to subdirectory buildlib, run
qmake
make
qmake
make
To copy to clipboard, switch view to plain text mode
shared or static library will be generated.
3. ã€Usage】 Add following line to your qmake project file:
# xxxx.pro
include(pathToPri/qextserialport.pri)
# xxxx.pro
include(pathToPri/qextserialport.pri)
To copy to clipboard, switch view to plain text mode
My question: What did I do wrong when I did the following:
And yet another thing: Is it possible that I have to install certain drivers before I install QextSerialPort ?
So I started with the config.pri file.
It now looks like this:
# This is an example config.pri for building and using qextserialport.
#
# When using the qextserialport, all you need is to add following line
# in your .pro file:
# include(pathToQextserialport/src/qextserialport.pri)
#
# uncomment the following line if you want to use qextserialport as library
QEXTSERIALPORT_LIBRARY = yes
# uncomment the following line too if you want to use it as static library
QEXTSERIALPORT_STATIC = yes
# comment following line if you always want to enable "udev" under linux
# QEXTSERIALPORT_WITH_UDEV = yes
# This is an example config.pri for building and using qextserialport.
#
# When using the qextserialport, all you need is to add following line
# in your .pro file:
# include(pathToQextserialport/src/qextserialport.pri)
#
# uncomment the following line if you want to use qextserialport as library
QEXTSERIALPORT_LIBRARY = yes
# uncomment the following line too if you want to use it as static library
QEXTSERIALPORT_STATIC = yes
# comment following line if you always want to enable "udev" under linux
# QEXTSERIALPORT_WITH_UDEV = yes
To copy to clipboard, switch view to plain text mode
I run qmake in the buildlib directory, then nmake. (I copied qmake.exe in that folder, then worked with Visual Studio Command Prompt x64. I guess this is not the usual way to do this?)
Anyway, it did its job without errors.
Then I edited my .pro file to look like this:
(I added include(QExtSerialPort/src/qextserialport.pri))
#Schnarchdaten_Reader
#--------------------------------------------------
TEMPLATE = app
CONFIG += qt
QT += core gui
#--------------------------------------------------
HEADERS += schnarchdaten_reader.h\
datentyp.h\
Buffer.h\
qcustomplot.h
#--------------------------------------------------
SOURCES += main.cpp\
schnarchdaten_reader.cpp\
Datentyp.cpp\
Buffer.cpp\
qcustomplot.cpp
#--------------------------------------------------
include(QExtSerialPort/src/qextserialport.pri)
#--------------------------------------------------
FORMS += schnarchdaten_reader.ui
#--------------------------------------------------
TARGET = Schnarchdaten_Reader
#--------------------------------------------------
#Schnarchdaten_Reader
#--------------------------------------------------
TEMPLATE = app
CONFIG += qt
QT += core gui
#--------------------------------------------------
HEADERS += schnarchdaten_reader.h\
datentyp.h\
Buffer.h\
qcustomplot.h
#--------------------------------------------------
SOURCES += main.cpp\
schnarchdaten_reader.cpp\
Datentyp.cpp\
Buffer.cpp\
qcustomplot.cpp
#--------------------------------------------------
include(QExtSerialPort/src/qextserialport.pri)
#--------------------------------------------------
FORMS += schnarchdaten_reader.ui
#--------------------------------------------------
TARGET = Schnarchdaten_Reader
#--------------------------------------------------
To copy to clipboard, switch view to plain text mode
Now I create a new project in Visual Studio by Qt->Open .pro-file
My new project is being put together.
But when I try to Compile and Run, I get that weird message "error LNK1104: File"\.obj" can't be opened."
Though, the QextSerialPort class is getting recognized and I can use it to create objects and use functions.
I tried to change my .pro modification to include(Schnarchdaten_Reader/QExtSerialPort/src/qextserialport.pri)
I think this is wrong, because my projects directory is: like this:
Schnarchdaten_Reader
.pro file
QExtSerialPort
folders and files of QExtSerialPort
But: After doing the same stuff as described above I can at least start the project, but as soon as I make a new QextSerialPort Object I get Linker errors refering to QextSerialPort.
Which would be the right setting for that?
I have spent the whole day trying to fix that, so any help/guess/hint is highly appreciated.
Sorry for the long post and thank you very much for reading it! 
Greetings
sHs
Bookmarks