Hello and thanks for your quick reply.
I was finally able to compile the CSerialDevice library for VS2008 (I'm not sure yet it works with virtual ports though), and thought I'd just describe my steps to make it work for below in the post (I've also included all the CMakeLists files). Now I have also compiled the SerialDeviceInfo example, but using virtual ports on my PC, it seems that they are not recognized. I still need to check things out a bit, but would anybody have insights on that matter?
Unrelated question : now that the project is on Gitorious, is this website the place where I should post these remarks/questions, or should I ask them on Gitorious ?
1) I downloaded the latest version of the library on Gitorious
2) I included a missing #include <QObject> header where missing
3) I corrected a PCVOID error by adding a #define PCVOID LPCVOID in nativeserialengine.h
4) In the cmake file, the moc files can either be created using:
* qt4_wrap_cpp(MOC_SRCS ${MOC_SRCS}) : it creates some moc_xxx.cxx files included at the end of serialnotifier_p_win.cpp and serialdevicewatcher_p_win.cpp. Even after replacing the #include "moc_xxx.cpp" by "moc_xxx.cxx" at the end of the files to remove compiler errors, I couldn't remove the errors mentioned in the previous posts, I think that it is due to a problem of compiling order (it seems that vs2008 creates the moc_xxx.cxx files but then does not compile them.
* qt4_automoc(${SRCS}) : to make this work,
- I had to add at the beginning of every file inheriting QObject a #include "myclass.moc" (abstractserial.cpp, abstractserialengine.cpp, nativeserialengine.cpp, serialnotifier.cpp, serialdeviceinfo.cpp serialdevicewatcher.cpp
- I had to remove the #include "moc_xxx.cxx" at the end of serialnotifier_p_win.cpp and serialdevicewatcher_p_win.cpp.
After all this I still had a linker error: __declspec(dllimport) public: static class QString __cdecl QString::fromWCharArray(wchar_t const *,int). This is due to a wrong setting in the default config properties of vs2008: you need to set properties->configuration options->C++-> language->"treat wchar_t as integrated type" or some name like that to NO (actually, I think that this is only needed in the qserialdeviceinfoLib project but i haven't confirmed).
This option can be set through the CMakes using this:
set_target_properties(qserialdeviceinfoLib PROPERTIES COMPILE_FLAGS "/Zc:wchar_t-")
Bookmarks