The code compiles and runs fine on Linux (wxGTK), however I get a linking error when building it on Windows:
On the Header file
Code: Select all
// Custome events go here
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE(wxEVT_P_LIST_NEW, 7777)
DECLARE_EVENT_TYPE(wxEVT_P_LIST_ITEM, 7778)
DECLARE_EVENT_TYPE(wxEVT_P_JOIN_ROOM, 7779)
END_DECLARE_EVENT_TYPES()
#define EVT_P_LIST_NEW(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_P_LIST_NEW, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
(wxObject *) NULL \
),
#define EVT_P_LIST_ITEM(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_P_LIST_ITEM, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
(wxObject *) NULL \
),
#define EVT_P_JOIN_ROOM(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_P_JOIN_ROOM, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
(wxObject *) NULL \
),
Code: Select all
// Custome events definition
DEFINE_EVENT_TYPE(wxEVT_P_LIST_NEW)
DEFINE_EVENT_TYPE(wxEVT_P_LIST_ITEM)
DEFINE_EVENT_TYPE(wxEVT_P_JOIN_ROOM)
Code: Select all
g++ -Wall -I/usr/local/lib/wx/include/msw-ansi-release-2.6 -I/usr/local/include/wx-2.6 -D__WXMSW__ -mthreads -DWXUSINGDLL=1 -DNO_GCC_PRAGMA "-DIISLAND_PREFIX=\"/home/user/iisland\"" -o iisland.exe iisland-MyApp.o iisland-Login.o iisland-PictureWindow.o iisland-hyperlink.o iisland-Protocol.o iisland-Utils.o iisland-SysTray.o iisland-RoomList.o iisland-RoomsList.o iisland-ChatCentral.o -L/usr/local/lib -mthreads -Wl,--subsystem,windows -mwindows -lwx_msw_xrc-2.6 -lwx_msw_qa-2.6 -lwx_msw_html-2.6 -lwx_msw_adv-2.6 -lwx_msw_core-2.6 -lwx_base_xml-2.6 -lwx_base_net-2.6 -lwx_base-2.6
iisland-Protocol.o(.text+0x19b8):Protocol.cpp: undefined reference to `_imp__wxEVT_P_LIST_NEW'
iisland-Protocol.o(.text+0x1ac7):Protocol.cpp: undefined reference to `_imp__wxEVT_P_LIST_ITEM'
iisland-Protocol.o(.text+0x1e59):Protocol.cpp: undefined reference to `_imp__wxEVT_P_JOIN_ROOM'
iisland-RoomsList.o(.text+0x1366):RoomsList.cpp: undefined reference to `_imp__wxEVT_P_LIST_NEW'
iisland-RoomsList.o(.text+0x13a4):RoomsList.cpp: undefined reference to `_imp__wxEVT_P_LIST_ITEM'
collect2: ld returned 1 exit status
make[1]: *** [iisland.exe] Error 1