Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
I have successfully built and debugged my wxWidgets GUI under Windows 10, Visual Studio 2019. I'm now attempting to migrate my project to Linux Mint. Unfortunately I'm seeing complication errors. Here are the steps that I have taken so far:
Tested the installation using the samples provided.
Installed Code::Blocks along with the wxSmith plugin.
Created a new wxWidgets project (3.0.x was the latest version avialable in the options) and imported my project files.
Added the `wx-config --cxxflags` and `wx-config --libs` compiler flags to the Project Build Options.
Checked that the IDE does indeed see the wxWidgets header files (and other dependencies in my project).
Initially I was getting compilation errors relating to the BOOL variable being declared. I think that this #define exists only in the Windows version of wxWidgets? Anyhow, I replaced all instances of BOOL with bool. Now I'm seeing several compilation errors relating to wxWidgets macros. I'm posting the list of errors below:
||=== Build: Debug in PomiarWiazki_wxWidgets_Linux (compiler: GNU GCC Compiler) ===|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cApp.h|2|warning: ignoring #pragma warning [-Wunknown-pragmas]|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cMain.h|2|warning: ignoring #pragma warning [-Wunknown-pragmas]|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.h|2|warning: ignoring #pragma warning [-Wunknown-pragmas]|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cInformation.h|2|warning: ignoring #pragma warning [-Wunknown-pragmas]|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.h|2|warning: ignoring #pragma warning [-Wunknown-pragmas]|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.cpp|4|error: ISO C++ forbids taking the address of a bound member function to form a pointer to member function. Say ‘&cDiagnostics::OnButtonClickedReset’ [-fpermissive]|
/usr/local/include/wx-3.1/wx/event.h|91|note: in definition of macro ‘wxDECLARE_EVENT_TABLE_ENTRY’|
/usr/local/include/wx-3.1/wx/event.h|4381|note: in expansion of macro ‘wx__DECLARE_EVT2’|
/usr/local/include/wx-3.1/wx/event.h|4577|note: in expansion of macro ‘wx__DECLARE_EVT1’|
/usr/local/include/wx-3.1/wx/event.h|4144|note: in expansion of macro ‘wxEVENT_HANDLER_CAST’|
/usr/local/include/wx-3.1/wx/event.h|4577|note: in expansion of macro ‘wxCommandEventHandler’|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.cpp|4|note: in expansion of macro ‘EVT_BUTTON’|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.cpp|5|error: ISO C++ forbids taking the address of a bound member function to form a pointer to member function. Say ‘&cDiagnostics::OnDiagnosticsResetTimer’ [-fpermissive]|
/usr/local/include/wx-3.1/wx/event.h|91|note: in definition of macro ‘wxDECLARE_EVENT_TABLE_ENTRY’|
/usr/local/include/wx-3.1/wx/event.h|4381|note: in expansion of macro ‘wx__DECLARE_EVT2’|
/usr/local/include/wx-3.1/wx/timer.h|192|note: in expansion of macro ‘wx__DECLARE_EVT1’|
/usr/local/include/wx-3.1/wx/timer.h|189|note: in expansion of macro ‘wxEVENT_HANDLER_CAST’|
/usr/local/include/wx-3.1/wx/timer.h|192|note: in expansion of macro ‘wxTimerEventHandler’|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.cpp|5|note: in expansion of macro ‘EVT_TIMER’|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.cpp|6|error: ISO C++ forbids taking the address of a bound member function to form a pointer to member function. Say ‘&cDiagnostics::OnClose’ [-fpermissive]|
/usr/local/include/wx-3.1/wx/event.h|91|note: in definition of macro ‘wxDECLARE_EVENT_TABLE_ENTRY’|
/usr/local/include/wx-3.1/wx/event.h|4381|note: in expansion of macro ‘wx__DECLARE_EVT2’|
/usr/local/include/wx-3.1/wx/event.h|4383|note: in expansion of macro ‘wx__DECLARE_EVT1’|
/usr/local/include/wx-3.1/wx/event.h|4412|note: in expansion of macro ‘wx__DECLARE_EVT0’|
/usr/local/include/wx-3.1/wx/event.h|4185|note: in expansion of macro ‘wxEVENT_HANDLER_CAST’|
/usr/local/include/wx-3.1/wx/event.h|4412|note: in expansion of macro ‘wxCloseEventHandler’|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.cpp|6|note: in expansion of macro ‘EVT_CLOSE’|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.cpp||In constructor ‘cDiagnostics::cDiagnostics(const uint8_t*, const char*, int, bool*, bool*, bool*, bool*, bool*, int32_t*, int32_t*, uint16_t*, uint16_t*, wxMenu*)’:|
/usr/local/include/wx-3.1/wx/chartype.h|225|error: converting to execution character set: Invalid or incomplete multibyte or wide character|
/usr/local/include/wx-3.1/wx/cpp.h|18|note: in definition of macro ‘wxCONCAT_HELPER’|
/home/ksawery/repos/PomiarWiazki_wxWidgets_Linux/PomiarWiazki_wxWidgets_Linux/cDiagnostics.cpp|97|note: in expansion of macro ‘wxT’|
||=== Build failed: 4 error(s), 5 warning(s) (0 minute(s), 4 second(s)) ===|
I've not previously seen that error message from an event table, so it's not a standard Linux issue. (OTOH if you were using Bind() it would be happening because your compiler can't cope with 'cDiagnostics::OnClose' as its second parameter; it wants '&cDiagnostics::OnClose'.)
Can you post the relevant event table(s) and event handler signatures?
I replaced some instances of wxT with _T, and it seems to work ok now. I still have other unexpected bugs in the application, but at least it compiles successfully now.
It is possible that the string contained a random special character, due to foreign characters being pushed and pulled from GitHub. So that might have been the real issue - which I accidentally fixed by correcting typos.