Forum Post
Index > Lgi > Building LGI with MinGW

Author/Date Building LGI with MinGW
Pie_Sniper
12/05/2007 8:44pm
Hi, I've been looking for a good GUI library for a long time, and it looks like LGI might be it. However, I'm swamped with illegal conversion errors when trying to build it with MinGW in Code::Blocks (on Windows XP). I've gotten through most of them, but I just can't figure this one out:

...
src\common\Lgi\GProcess.cpp:535: error: invalid conversion from `char16*' to `WCHAR*'
src\common\Lgi\GProcess.cpp:535: error: cannot convert `WCHAR*' to `_SECURITY_ATTRIBUTES*' for argument `3' to `BOOL CreateProcessW(const WCHAR*, WCHAR*, _SECURITY_ATTRIBUTES*, _SECURITY_ATTRIBUTES*, BOOL, DWORD, void*, const WCHAR*, _STARTUPINFOW*, _PROCESS_INFORMATION*)'
...
:: === Build finished: 2 errors, 14 warnings ===

The code in question:

Ok = CreateProcessW(0,
Buf, // command line
NULL, // process security attributes <--- The LINE in question
NULL, // primary thread security attributes
TRUE, // handles are inherited
Flags, // Flags
NULL, // use parent's environment
StartingPath, // use parent's current directory
(WCHAR*)&SiW, // STARTUPINFO pointer
&piProcInfo); // receives PROCESS_INFORMATION

If someone could help me get this sorted out, I'd be most greatful. :)
Pie_Sniper
12/05/2007 8:47pm
Er, sorry about that; I placed the error on the wrong line:
Ok = CreateProcessW(0,
Buf, // command line
(WCHAR*)NULL, // process security attributes
NULL, // primary thread security attributes <--- The LINE in question
TRUE, // handles are inherited
Flags, // Flags
NULL, // use parent's environment
StartingPath, // use parent's current directory
(WCHAR*)&SiW, // STARTUPINFO pointer
&piProcInfo); // receives PROCESS_INFORMATION

fret
14/05/2007 6:12am
I've fixed the mingw build to work on my machine. But I found a raft of other related issues that you will no doubt bang your head on if you use the same dev environment that I use to do mingw work. That is LgiIde and it's makefiles.

You might not, but I though while I'm in there I should fix it all up.

The changes will be releases as v3.01 in the next day or so. And I will post a binary of LgiIde and LgiRes a few days later as well.

Most of the compile issues came from "char16" being defined as "unsigned short" where in fact mingw wants it defined as "wchar_t". So I made a conditional compile define around the typedef in question. Most of the rest of the issues where bit rot stuff because I compile with VC++ most of the time. e.g. string literals being assigned to "char*" and gcc warning about removing the "const" part of the literal.
Pie_Sniper
18/05/2007 5:08am
All right, thanks for the info.
Reply