I'm having a problem compiling my app for windows (using mingw32 in MXE), i get several of the following errors just on the first source file. I vaguely remember solving something like this maybe 3 or 4 years ago, but i can't remember at all what caused the problem.
Various google search results in my browser history (and some other ones) say stuff about order of include files with OpenGL, #define'ing the token 'UNICODE' from the build system, and a few other things i've tried, but no luck.
Here's the compiler output on one of the src files:
Code: Select all
GNU C++11 (GCC) version 5.4.0 (i686-w64-mingw32.static)
compiled by GNU C version 4.7.2, GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 19c0564a5a5cc655914b93344281471a
In file included from /usr/src/lng-cashflow/src/ui.h:47:0,
from /usr/src/lng-cashflow/src/main.h:21,
from /usr/src/lng-cashflow/src/main.cpp:2:
/usr/src/lng-cashflow/src/wxwidgets/prefsdialog.h:47:0: warning: "ID_TREECTRL" redefined
#define ID_TREECTRL 10009
^
In file included from /usr/src/lng-cashflow/src/ui.h:45:0,
from /usr/src/lng-cashflow/src/main.h:21,
from /usr/src/lng-cashflow/src/main.cpp:2:
/usr/src/lng-cashflow/src/wxwidgets/mainwindow.h:42:0: note: this is the location of the previous definition
#define ID_TREECTRL 10003
^
In file included from /net/deimos/usr/lib/mxe/usr/i686-w64-mingw32.static/include/windows.h:72:0,
from /net/deimos/usr/src/sigslot/sigslot_qt.h:90,
from /usr/src/lng-cashflow/src/main.h:18,
from /usr/src/lng-cashflow/src/main.cpp:2:
/usr/mxe/include/wx-3.1/wx/msw/winundef.h: In function 'HWND__* CreateDialog(HINSTANCE, LPCTSTR, HWND, DLGPROC)':
/usr/mxe/include/wx-3.1/wx/msw/winundef.h:48:20: error: cannot convert 'LPCTSTR {aka const wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'HWND__* CreateDialogParamA(HINSTANCE, LPCSTR, HWND, DLGPROC, LPARAM)'
return CreateDialogA(hInstance, pTemplate, hwndParent, pDlgProc);
^
In file included from /usr/mxe/include/wx-3.1/wx/defs.h:33:0,
from /usr/mxe/include/wx-3.1/wx/wx.h:14,
from /usr/src/lng-cashflow/src/ui.h:6,
from /usr/src/lng-cashflow/src/main.h:21,
from /usr/src/lng-cashflow/src/main.cpp:2:
/usr/mxe/include/wx-3.1/wx/msw/winundef.h: In function 'HFONT__* CreateFont(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR)':
/usr/mxe/include/wx-3.1/wx/msw/winundef.h:82:48: error: cannot convert 'LPCTSTR {aka const wchar_t*}' to 'LPCSTR {aka const char*}' for argument '14' to 'HFONT__* CreateFontA(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCSTR)'
family, facename);
^
In file included from /net/deimos/usr/lib/mxe/usr/i686-w64-mingw32.static/include/windows.h:72:0,
from /net/deimos/usr/src/sigslot/sigslot_qt.h:90,
from /usr/src/lng-cashflow/src/main.h:18,
from /usr/src/lng-cashflow/src/main.cpp:2:
/usr/mxe/include/wx-3.1/wx/msw/winundef.h: In function 'HWND__* CreateWindow(LPCTSTR, LPCTSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)':
/usr/mxe/include/wx-3.1/wx/msw/winundef.h:105:20: error: cannot convert 'LPCTSTR {aka const wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'HWND__* CreateWindowExA(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)'
return CreateWindowA(lpClassName, lpWndClass, dwStyle, x, y, w, h,
^
In file included from /usr/mxe/include/wx-3.1/wx/defs.h:33:0,
from /usr/mxe/include/wx-3.1/wx/wx.h:14,
from /usr/src/lng-cashflow/src/ui.h:6,
from /usr/src/lng-cashflow/src/main.h:21,
from /usr/src/lng-cashflow/src/main.cpp:2:
/usr/mxe/include/wx-3.1/wx/msw/winundef.h: In function 'HMENU__* LoadMenu(HINSTANCE, LPCTSTR)':
/usr/mxe/include/wx-3.1/wx/msw/winundef.h:121:44: error: cannot convert 'LPCTSTR {aka const wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'HMENU__* LoadMenuA(HINSTANCE, LPCSTR)'
return LoadMenuA(instance, name);
^
/usr/mxe/include/wx-3.1/wx/msw/winundef.h: In function 'HWND__* FindText(LPFINDREPLACE)':
/usr/mxe/include/wx-3.1/wx/msw/winundef.h:136:43: error: cannot convert 'LPFINDREPLACE {aka tagFINDREPLACEW*}' to 'LPFINDREPLACEA {aka tagFINDREPLACEA*}' for argument '1' to 'HWND__* FindTextA(LPFINDREPLACEA)'
return FindTextA(lpfindreplace);
^
/usr/mxe/include/wx-3.1/wx/msw/winundef.h: In function 'HICON__* LoadIcon(HINSTANCE, LPCTSTR)':
/usr/mxe/include/wx-3.1/wx/msw/winundef.h:312:51: error: cannot convert 'LPCTSTR {aka const wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'HICON__* LoadIconA(HINSTANCE, LPCSTR)'
return LoadIconA(hInstance, lpIconName);
^
/usr/mxe/include/wx-3.1/wx/msw/winundef.h: In function 'HBITMAP__* LoadBitmap(HINSTANCE, LPCTSTR)':
/usr/mxe/include/wx-3.1/wx/msw/winundef.h:325:55: error: cannot convert 'LPCTSTR {aka const wchar_t*}' to 'LPCSTR {aka const char*}' for argument '2' to 'HBITMAP__* LoadBitmapA(HINSTANCE, LPCSTR)'
return LoadBitmapA(hInstance, lpBitmapName);
^
src/CMakeFiles/lng_cashflow.dir/build.make:66: recipe for target 'src/CMakeFiles/lng_cashflow.dir/main.cpp.obj' failed
make[2]: *** [src/CMakeFiles/lng_cashflow.dir/main.cpp.obj] Error 1
make[2]: Leaving directory '/tmp/lng-build/windoze'
CMakeFiles/Makefile2:176: recipe for target 'src/CMakeFiles/lng_cashflow.dir/all' failed
make[1]: *** [src/CMakeFiles/lng_cashflow.dir/all] Error 2
make[1]: Leaving directory '/tmp/lng-build/windoze'
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2