Game Development Community

Please help! cannot compile with mingw..

by gamer_goof · in Technical Issues · 02/12/2008 (4:17 pm) · 4 replies

This is driving me crazy I am so close yet so far.

Working with the following:

MinGW 5.1.3
MSYS 1.0.10
TGE SDK 1.5.1 & 1.5.2 (just trying to compile with a clean install of either SDK, both get same results)

First I install torque to directory D:\Torque\TGE_1_5_2
Then installed MinGW to directorty D:\MinGW\
Next installed MSYS (which asked for the install location of MinGW)

Next I added D:\MinGW\bin to my systems PATH and then renamed
D:\MinGW\bin\mingw32-make.exe to D:\MinGW\bin\make.exe

Next I launched MSYS and vi'd the /etc/fstab
changed C:MinGW /mingw to D:\MinGW /mingw

created the following directorys
D:\Torque\TGE_1_5_2\engine\out.GCC3.DEBUG\gui
D:\Torque\TGE_1_5_2\engine\out.GCC3.RELEASE\gui

I have tested both command lines

make -f mk/configure.mk OS=WIN32 BUILD=RELEASE COMPILER=GCC3
make -f mk/configure.mk OS=WIN32 BUILD=DEBUG COMPILER=GCC3

both seemt to give the desired results...

And after all that my compiles seems to get most of the way through, it takes the make command:

==========================================================
$ make -f mk/configure.mk OS=WIN32 BUILD=DEBUG COMPILER=GCC3

Current Configuration: this config is VALID
OS: WIN32
COMPILER: GCC3
BUILD: DEBUG
DIR.OBJ: out

To change the current configuration type:

make -f mk/configure.mk {arguments, ...}

required arguments:
OS={WIN32 BEOS LINUX OpenBSD FreeBSD Solaris}
COMPILER={CW6 VC6 GCC2 GCC3 GCC3.4 GCC4}
BUILD={DEBUG RELEASE}

optional arguments:
DIR.OBJ={path to store intermediate obj files}

Note: all arguments are case sensitive.
=====================================================================
But then when I start the make script it always fails:
=====================================================================
$ make
Creating library out.GCC3.DEBUG/lpng_DEBUG.a
Creating library out.GCC3.DEBUG/zlib_DEBUG.a
Creating library out.GCC3.DEBUG/ljpeg_DEBUG.a
Creating library out.GCC3.DEBUG/lungif_DEBUG.a
--> Compiling platformWin32/winWindow.cc
platformWin32/winWindow.cc:35: error: invalid initializer
make.exe[1]: *** [out.GCC3.DEBUG/platformWin32/winWindow.obj] Error 1
D:\MinGW\bin\make.exe: *** [default] Error 2
=====================================================================

So does anyone know what this error is about?

--> Compiling platformWin32/winWindow.cc
platformWin32/winWindow.cc:35: error: invalid initializer
make.exe[1]: *** [out.GCC3.DEBUG/platformWin32/winWindow.obj] Error 1
D:\MinGW\bin\make.exe: *** [default] Error 2


anyone else out there use mingw that could post the process you go through to compile or
can tell me what I am missing in my process? Any help appreciated.

#1
02/13/2008 (9:15 am)
******Then I run make and get the following (removed -w from my commands to show the warnings.
(here is MOST of the make output, but the forum will not let me add too many characters. )
$ make
Creating library out.GCC3.DEBUG/lpng_DEBUG.a
Creating library out.GCC3.DEBUG/zlib_DEBUG.a
Creating library out.GCC3.DEBUG/ljpeg_DEBUG.a
Creating library out.GCC3.DEBUG/lungif_DEBUG.a
--> Compiling platformWin32/winWindow.cc
In file included from platformWin32/winWindow.cc:13:
./platform/event.h:128: warning: invalid access to non-static data member 'PacketReceiveEvent::data' of NULL object
./platform/event.h:128: warning: (perhaps the 'offsetof' macro was used incorrectly)
./platform/event.h:130: warning: invalid access to non-static data member 'ConnectedReceiveEvent::data' of NULL object
./platform/event.h:130: warning: (perhaps the 'offsetof' macro was used incorrectly)
./platform/event.h:132: warning: invalid access to non-static data member 'ConsoleEvent::data' of NULL object
./platform/event.h:132: warning: (perhaps the 'offsetof' macro was used incorrectly)
In file included from platformWin32/winWindow.cc:21:
./core/unicode.h:103:22: warning: no newline at end of file
In file included from ./dgl/gFont.h:29,
from ./gui/core/guiTypes.h:10,
from ./gui/core/guiControl.h:25,
from ./gui/core/guiCanvas.h:16,
from platformWin32/winWindow.cc:22:
./dgl/gTexManager.h:469:26: warning: no newline at end of file
platformWin32/winWindow.cc:34: warning: invalid conversion from 'const wchar_t*' to 'const UTF16*'
platformWin32/winWindow.cc:35: error: invalid initializer
platformWin32/winWindow.cc: In static member function 'static bool Platform::excludeOtherInstances(const char*)':
platformWin32/winWindow.cc:110: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:110: warning: initializing argument 3 of 'void* CreateMutexW(_SECURITY_ATTRIBUTES*, BOOL, const WCHAR*)'
platformWin32/winWindow.cc: In static member function 'static void Platform::restartInstance()':
platformWin32/winWindow.cc:163: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:163: warning: initializing argument 1 of 'BOOL CreateProcessW(const WCHAR*, WCHAR*, _SECURITY_ATTRIBUTES*, _SECURITY_ATTRIBUTES*, BOOL, DWORD, void*, const WCHAR*, _STARTUPINFOW*, _PROCESS_INFORMATION*)'
platformWin32/winWindow.cc: In static member function 'static bool Platform::checkOtherInstances(const char*)':
platformWin32/winWindow.cc:184: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:184: warning: initializing argument 3 of 'void* CreateMutexW(_SECURITY_ATTRIBUTES*, BOOL, const WCHAR*)'
platformWin32/winWindow.cc: In static member function 'static void Platform::AlertOK(const char*, const char*)':
platformWin32/winWindow.cc:217: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:217: warning: initializing argument 2 of 'int MessageBoxW(HWND__*, const WCHAR*, const WCHAR*, UINT)'
platformWin32/winWindow.cc:217: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:217: warning: initializing argument 3 of 'int MessageBoxW(HWND__*, const WCHAR*, const WCHAR*, UINT)'
platformWin32/winWindow.cc: In static member function 'static bool Platform::AlertOKCancel(const char*, const char*)':
platformWin32/winWindow.cc:231: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:231: warning: initializing argument 2 of 'int MessageBoxW(HWND__*, const WCHAR*, const WCHAR*, UINT)'
platformWin32/winWindow.cc:231: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:231: warning: initializing argument 3 of 'int MessageBoxW(HWND__*, const WCHAR*, const WCHAR*, UINT)'
platformWin32/winWindow.cc: In static member function 'static bool Platform::AlertRetry(const char*, const char*)':
platformWin32/winWindow.cc:245: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:245: warning: initializing argument 2 of 'int MessageBoxW(HWND__*, const WCHAR*, const WCHAR*, UINT)'
platformWin32/winWindow.cc:245: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:245: warning: initializing argument 3 of 'int MessageBoxW(HWND__*, const WCHAR*, const WCHAR*, UINT)'
platformWin32/winWindow.cc: In static member function 'static void Platform::disableKeyboardTranslation()':
platformWin32/winWindow.cc:359: warning: passing NULL used for non-pointer converting 2 of 'HIMC ImmAssociateContext(HWND__*, HIMC)'
platformWin32/winWindow.cc: In function 'void processKeyMessage(UINT, WPARAM, LPARAM)':
platformWin32/winWindow.cc:455: warning: invalid conversion from 'U16*' to 'WCHAR*'
platformWin32/winWindow.cc:455: warning: initializing argument 4 of 'int ToUnicode(UINT, UINT, BYTE*, WCHAR*, int, UINT)'
platformWin32/winWindow.cc: In function 'void InitWindowClass()':
platformWin32/winWindow.cc:985: warning: invalid conversion from 'const UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc: In function 'HWND__* CreateOpenGLWindow(U32, U32, bool)':
platformWin32/winWindow.cc:1039: warning: invalid conversion from 'const UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:1039: warning: initializing argument 2 of 'HWND__* CreateWindowExW(DWORD, const WCHAR*, const WCHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
platformWin32/winWindow.cc:1039: warning: invalid conversion from 'UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:1039: warning: initializing argument 3 of 'HWND__* CreateWindowExW(DWORD, const WCHAR*, const WCHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
platformWin32/winWindow.cc: In static member function 'static bool Platform::openWebBrowser(const char*)':
platformWin32/winWindow.cc:1571: warning: invalid conversion from 'wchar_t*' to 'const UTF16*'
platformWin32/winWindow.cc:1571: warning: initializing argument 1 of 'const U32 convertUTF16toUTF8(const UTF16*, UTF8*, U32)'
platformWin32/winWindow.cc:1612: warning: invalid conversion from 'UTF16*' to 'WCHAR*'
platformWin32/winWindow.cc:1612: warning: initializing argument 2 of 'BOOL CreateProcessW(const WCHAR*, WCHAR*, _SECURITY_ATTRIBUTES*, _SECURITY_ATTRIBUTES*, BOOL, DWORD, void*, const WCHAR*, _STARTUPINFOW*, _PROCESS_INFORMATION*)'
platformWin32/winWindow.cc: At global scope:
platformWin32/winWindow.cc:1621: warning: invalid conversion from 'const wchar_t*' to 'const UTF16*'
platformWin32/winWindow.cc: In static member function 'static const char* Platform::getLoginPassword()':
platformWin32/winWindow.cc:1630: warning: invalid conversion from 'const UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:1630: warning: initializing argument 2 of 'LONG RegOpenKeyExW(HKEY__*, const WCHAR*, DWORD, REGSAM, HKEY__**)'
platformWin32/winWindow.cc: In static member function 'static bool Platform::setLoginPassword(const char*)':
platformWin32/winWindow.cc:1653: warning: invalid conversion from 'const UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:1653: warning: initializing argument 2 of 'LONG RegOpenKeyExW(HKEY__*, const WCHAR*, DWORD, REGSAM, HKEY__**)'
platformWin32/winWindow.cc: In function 'bool cisKoreanBuild(SimObject*, S32, const char**)':
platformWin32/winWindow.cc:1675: warning: invalid conversion from 'const UTF16*' to 'const WCHAR*'
platformWin32/winWindow.cc:1675: warning: initializing argument 2 of 'LONG RegOpenKeyExW(HKEY__*, const WCHAR*, DWORD, REGSAM, HKEY__**)'
make.exe[1]: *** [out.GCC3.DEBUG/platformWin32/winWindow.obj] Error 1
D:\MinGW\bin\make.exe: *** [default] Error 2
#2
02/13/2008 (9:21 am)
Hmmm, basically stuck at the exact same spot that this post ended with

http://www.garagegames.com/mg/forums/result.thread.php?qt=13261
#3
02/13/2008 (11:07 am)
Why dont you use the free Microsoft Compiler?
It compiles fine for me with it~!
#4
02/13/2008 (10:59 pm)
Thanks :) followed the getting stated post. mingw in the trash.