qmake defines UNICODE in the makefile. I have erased this option and mingw compiled succesfully!
On 7/29/06, Earnie Boyd <> wrote:
Quoting Joel Prieto <>:

> Hi. I have a problem using serial port under WINDOWS. I have mingw compiler,
> but when it compiles several errors appears. Can anybody help me?. I've
> tried with others libraries to open serial port, buy I am still having the
> same error message.
> int openport(char *comport, HANDLE * cfd)
> {
>    *cfd =
> CreateFile(comport, GENERIC_READ | GENERIC_WRITE, 0, NULL,
> ....................
> }
> serial.cpp: In function `int openport(char*, void**)':
> serial.cpp:68: error: cannot convert `char*' to `const WCHAR*' for argument
> `1' to `void* CreateFileW(const WCHAR*, DWORD, DWORD, _SECURITY_ATTRIBUTES*,
> DWORD, DWORD, void*)'

You have two options:

1) Don't use UNICODE
2) Modify ``char *comport'' to read ``wchar *comport'' or ``tchar *comport''

Earnie Boyd

Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
MinGW-users mailing list

You may change your MinGW Account Options or unsubscribe at: