PDA

View Full Version : QextSerialPort



Diph
13th September 2008, 15:14
I'm trying to do a program which sends information to serial port. I have a problem using QextSerialPort class. I don't understand how to add it to my current project. Just add headers and cpp-files or do I have to build it? I'm currently using this (http://wiki.qtcentre.org/index.php?title=Paul%27s_autoBuild:_Qt4_with_Visua l_Studio) how-to with my projects and it seems to work but I have no idea how to make it work with QextSerialPort.

jpn
13th September 2008, 15:16
Take a look at project files of QextSerialPort examples. They include a shared .pri file which contains all the "magic":


LIBS += ...
INCLUDEPATH += ...

You need to link the lib and pass suitable paths for the compiler to find headers.

Diph
13th September 2008, 17:24
Sorry I don't quite understand. Do you mean that there should be QextSerialPort lib-file and I should link it with my project?

Ps. If you know good tutorials how to set Visual Studio properly I would appreciate it. Every site seems to do it differently and now I'm a bit confused how to proceed.

jpn
13th September 2008, 17:28
Sorry I don't quite understand. Do you mean that there should be QextSerialPort lib-file and I should link it with my project?
Yes, QextSerialPort is a library. You should start with compiling it. Once you have done that, take a look at the examples. The examples are ordinary applications using the library. You should do it the same way.

Diph
13th September 2008, 19:51
Yes, QextSerialPort is a library. You should start with compiling it. Once you have done that, take a look at the examples. The examples are ordinary applications using the library. You should do it the same way.
Now I have compiled it. I have libqextserialport.a and qextserialport.dll files in build directory. Do I have to put these files somewhere and how do I set Visual Studio project settings correctly. If I'm correct I don't have to use pro-file because of autoBuild program.

jpn
13th September 2008, 20:18
Now I have compiled it. I have libqextserialport.a and qextserialport.dll files in build directory. Do I have to put these files somewhere and how do I set Visual Studio project settings correctly. If I'm correct I don't have to use pro-file because of autoBuild program.
I have no idea what is an autoBuild program. Visual Studio has been officially supported by qmake since Qt 4.3.2. All I need to take care is to maintain the cross-platform project (.pro) file. Typing "qmake -tp vc" makes qmake to generate a Visual Studio project file for me. That's the way I maintain my projects in Windows. The huge benefit is that based on the .pro file qmake is also able to generate Makefiles for other compilers on various platforms. A Visual Studio project file is not much of use in Linux or Mac.

So, if I would do it, I would simply fill in the necessary LIBS and INCLUDEPATH to the .pro and regenerate the .vcproj and voilà ! :)