Good morning. I am updating from CodeLite 12.3.0 to 17.4.0, and also to MinGW GCC 64 bit 7.1.0. I am using wxWidgets as well.
I have a CodeLite workspace with three projects, two C and one C++. The C projects appear to build fine (can't test them until the C++ project is built). The C++ project won't build. When the compiler compiles the first C++ file (Channel_Settings_Class.cpp), it goes to process the windows.h file (see below).
Code: Select all
#include <stdio.h> // 1 aa
#include <tchar.h> // 1 ab
// #include <C:\MinGW\x86_64-7.1.0-release-posix-seh-rt_v5-rev2\mingw64\x86_64-w64-mingw32\include\tchar.h> // 1 ab
#include <windows.h> // 1 ac
// #include <C:\MinGW\x86_64-7.1.0-release-posix-seh-rt_v5-rev2\mingw64\x86_64-w64-mingw32\include\windows.h> // 1 ac
#include "FTD3XX.h" // 2 ab
When MinGW processes the windows.h file, I get the error messages below when it tries to pull in the winuser.h file.
Code: Select all
C:/MinGW/x86_64-7.1.0-release-posix-seh-rt_v5-rev2/mingw64/bin/mingw32-make.exe -j4 -e -f "Main.mk" MakeIntermediateDirs && C:/MinGW/x86_64-7.1.0-release-posix-seh-rt_v5-rev2/mingw64/bin/mingw32-make.exe -j4 -e -f "Main.mk" ./Debug/Channel_Settings_Class.cpp.o
----------Building project:[ Main - Debug ] (Single File Build)----------
C:/MinGW/x86_64-7.1.0-release-posix-seh-rt_v5-rev2/mingw64/bin/g++.exe -c "F:/SBIR_Phase_II/Main/Channel_Settings_Class.cpp" -g -O0 -Wall -IC:/wxWidgets/lib/gcc_dll/mswud -IC:/wxWidgets/include -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -o ./Debug/Channel_Settings_Class.cpp.o -I. -IC:/MinGW/include -IC:/wxWidgets/include -I. -I../Background -I../Behind_the_Scenes -I../Main -I../Resources -IG:/PF/IRT/UHSD/v3.a.3
In file included from C:/MinGW/x86_64-7.1.0-release-posix-seh-rt_v5-rev2/mingw64/x86_64-w64-mingw32/include/windows.h:72:0,
from F:/SBIR_Phase_II/Main/Channel_Settings_Class.cpp:28:
C:/wxWidgets/include/wx/msw/winundef.h: In function 'HWND__* CreateDialog(HINSTANCE, LPCTSTR, HWND, DLGPROC)':
C:/wxWidgets/include/wx/msw/winundef.h:46:20: error: cannot convert 'LPCTSTR {aka const char*}' to 'LPCWSTR {aka const wchar_t*}' for argument '2' to 'HWND__* CreateDialogParamW(HINSTANCE, LPCWSTR, HWND, DLGPROC, LPARAM)'
return CreateDialogW(hInstance, pTemplate, hwndParent, pDlgProc);
^
In file included from C:/wxWidgets/include/wx/afterstd.h:16:0,
from C:/wxWidgets/include/wx/stringimpl.h:67,
from C:/wxWidgets/include/wx/unichar.h:15,
from C:/wxWidgets/include/wx/strvararg.h:19,
from C:/wxWidgets/include/wx/string.h:37,
from C:/wxWidgets/include/wx/memory.h:15,
from C:/wxWidgets/include/wx/object.h:19,
from C:/wxWidgets/include/wx/wx.h:15,
from F:/SBIR_Phase_II/Main/Digital_Count_Class.h:32,
from F:/SBIR_Phase_II/Main/Channel_Settings_Class.h:28,
from F:/SBIR_Phase_II/Main/MainFrame_Class.h:31,
from F:/SBIR_Phase_II/Main/utg.h:29,
from F:/SBIR_Phase_II/Main/Channel_Settings_Class.cpp:36:
C:/wxWidgets/include/wx/msw/winundef.h: In function 'HFONT__* CreateFont(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCTSTR)':
C:/wxWidgets/include/wx/msw/winundef.h:77:48: error: cannot convert 'LPCTSTR {aka const char*}' to 'LPCWSTR {aka const wchar_t*}' for argument '14' to 'HFONT__* CreateFontW(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCWSTR)'
family, facename);
^
In file included from C:/MinGW/x86_64-7.1.0-release-posix-seh-rt_v5-rev2/mingw64/x86_64-w64-mingw32/include/windows.h:72:0,
from F:/SBIR_Phase_II/Main/Channel_Settings_Class.cpp:28:
C:/wxWidgets/include/wx/msw/winundef.h: In function 'HWND__* CreateWindow(LPCTSTR, LPCTSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)':
C:/wxWidgets/include/wx/msw/winundef.h:102:20: error: cannot convert 'LPCTSTR {aka const char*}' to 'LPCWSTR {aka const wchar_t*}' for argument '2' to 'HWND__* CreateWindowExW(DWORD, LPCWSTR, LPCWSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)'
return CreateWindowW(lpClassName, lpWndClass, dwStyle, x, y, w, h,
^
In file included from C:/wxWidgets/include/wx/afterstd.h:16:0,
from C:/wxWidgets/include/wx/stringimpl.h:67,
from C:/wxWidgets/include/wx/unichar.h:15,
from C:/wxWidgets/include/wx/strvararg.h:19,
from C:/wxWidgets/include/wx/string.h:37,
from C:/wxWidgets/include/wx/memory.h:15,
from C:/wxWidgets/include/wx/object.h:19,
from C:/wxWidgets/include/wx/wx.h:15,
from F:/SBIR_Phase_II/Main/Digital_Count_Class.h:32,
from F:/SBIR_Phase_II/Main/Channel_Settings_Class.h:28,
from F:/SBIR_Phase_II/Main/MainFrame_Class.h:31,
from F:/SBIR_Phase_II/Main/utg.h:29,
from F:/SBIR_Phase_II/Main/Channel_Settings_Class.cpp:36:
C:/wxWidgets/include/wx/msw/winundef.h: In function 'HMENU__* LoadMenu(HINSTANCE, LPCTSTR)':
C:/wxWidgets/include/wx/msw/winundef.h:119:44: error: cannot convert 'LPCTSTR {aka const char*}' to 'LPCWSTR {aka const wchar_t*}' for argument '2' to 'HMENU__* LoadMenuW(HINSTANCE, LPCWSTR)'
return LoadMenuW(instance, name);
^
C:/wxWidgets/include/wx/msw/winundef.h: In function 'HWND__* FindText(LPFINDREPLACE)':
C:/wxWidgets/include/wx/msw/winundef.h:134:43: error: cannot convert 'LPFINDREPLACE {aka tagFINDREPLACEA*}' to 'LPFINDREPLACEW {aka tagFINDREPLACEW*}' for argument '1' to 'HWND__* FindTextW(LPFINDREPLACEW)'
return FindTextW(lpfindreplace);
^
C:/wxWidgets/include/wx/msw/winundef.h: In function 'HICON__* LoadIcon(HINSTANCE, LPCTSTR)':
C:/wxWidgets/include/wx/msw/winundef.h:310:51: error: cannot convert 'LPCTSTR {aka const char*}' to 'LPCWSTR {aka const wchar_t*}' for argument '2' to 'HICON__* LoadIconW(HINSTANCE, LPCWSTR)'
return LoadIconW(hInstance, lpIconName);
^
C:/wxWidgets/include/wx/msw/winundef.h: In function 'HBITMAP__* LoadBitmap(HINSTANCE, LPCTSTR)':
C:/wxWidgets/include/wx/msw/winundef.h:323:55: error: cannot convert 'LPCTSTR {aka const char*}' to 'LPCWSTR {aka const wchar_t*}' for argument '2' to 'HBITMAP__* LoadBitmapW(HINSTANCE, LPCWSTR)'
return LoadBitmapW(hInstance, lpBitmapName);
^
mingw32-make.exe: *** [Main.mk:104: Debug/Channel_Settings_Class.cpp.o] Error 1
==== build ended with errors (7 errors, 4 warnings) ===
These errors occur from the MinGW h files. I have always assumed these files should never be edited by a user like me. I don't know what to do to get rid of these errors.
Could there be another h file I should include before including the windows.h file? If so, what should it be?
Could I be missing or using the wrong path for the compilation process? My current Environment Variables are:
Code: Select all
set CodeLiteDir=C:\CodeLite
set WXCFG=gcc_dll/mswud
set WXWIN=C:\wxWidgets
My Windows 10 system path includes the directories (among others):
Code: Select all
C:\MinGW\x86_64-7.1.0-release-posix-seh-rt_v5-rev2\mingw64\bin;
C:\MinGW\x86_64-7.1.0-release-posix-seh-rt_v5-rev2\mingw64\include;
C:\wxWidgets\include;
C:\wxWidgets\lib\gcc_dll;
Or should I be using a different MinGW entirely?
Suggestions?
Colleen