[Solved] QtSerialPort building problem
-
I recently had a similar problem, where the compiler will say it can't find the header files.
This error occurred when trying to compile and install the library. I was able to resolve this with the following steps:
Follow the build steps from the wiki. You will encounter errors saying that the header files are missing, but ignore them and proceed with make install.
Copy the file c:/Users/N/Downloads/qtserialport/src/serialport/q4tsupport/serialport.prf to c:/QtSDK/Desktop/Qt/4.8.1/mingw/mkspecs/features/serialport.prf for some reason, this step is supposed to be automatic but didn't occur on my system.
At this point Qt Creator should be able to detect the header files and properly link your projects
-
ok i tried the suggestion of the last post.
Before building the library i created following dirs inside the debug and release folder include/QtAddOnSerialPort to minimize the occouring errors.
Now i followed the step by step building instruction from the wiki.
Ignoring all the occouring errors.
Checked the content of c:/QtSDK/Desktop/Qt/4.8.1/mingw/mkspecs/features/ an suprisingly noticed that serialport.prf was allready copied to this directory. It can't be there due to an previous attempt of building this because i reinstalled the whole qt installation before building the library again.
Now building my project where i wanna use this lib.
It aborts with
@
cannot find -lSerialPort
@
I'm not sure if there are some files missing now in the Qt installation. From my point of view the make install process copied all files properly.Edit: The error occurs just with release build configuration, with debug configuration everything is built fine :)
Edit2: mingw32-make -d inside the release folder of lib itself aborts due to:
@
c:/qtsdk/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lSerialPort
@ -
You can compile and run projects in debug? If so, nice!
Can you check your lib folder for the existance of these files?
c:/QtSDK/Desktop/Qt/4.8.1/mingw/libThe ones below are for the release version:
- SerialPort.prl
- SerialPort1.dll
- SerialPort1.lib
And these are for debug:
- SerialPortd.prl
- SerialPortd1.dll
- SerialPortd1.lib
- SerialPortd1.pdb
If none of these are present, it might be due to a difference in how mingw and visual c++ store libraries, try looking for libSerialPort.so.1.0.0
-
- Success way:
On Wiki says, that should be building and installation in current order: 1. Build release or/and debug version (in any order) 2. Install release or/and debug version (in any order) 2) Bad way: ~~~~~~~~~ The main observation is that you can not do: 1. Build release 2. Install release 3. Build debug 4. Install debug Or conversely with 1,2 and 3,4. This will build error like: cannot find -lSerialPort. Reason this bad building because into the Qt already been installed some files, e.g.: /mkspecs/features/serialport.prf ~~~~~~~~~ In resulting, after success building and installing, Qt should be exists files: "<qt/path>/bin/": SerialPort1.dll and SerialPortd1.dll "<qt/path>/lib/": libSerialPort1.a and libSerialPortd1.a, SerialPort.prl and SerialPortd.prl, SerialPort1.dll and SerialPortd1.dll "<qt/path>/include/QtAddOnSerialPort": serialport.h, serialportinfo.h, serialport-global.h "<qt/path>/mkspecs/features": serialport.prf
-
Allright all the files which should be there for the release build are missing in my qt installation.
@kurzulis: I followed the way discribed on the wiki page, yeah and i tried to build my lib exactly in the order you mentioned.
Finally i figured out what the problem for my special case is. I found a path to the Atmel AVR toolchain in my path variable. That was the case because i also do some 8-bit microcontroller development. Therefore i accidantely used the mingw32 binaries of the AVR toolchain for building my lib and that cause all these errors. Now everything works fine. Many Thanks guys!