This is a simple test project that began by adding a wxPanel to a wxFrame, then a few controls.
This autogenerated code line causes the error on build:
Panel1->Connect(wxEVT_PAINT,(wxObjectEventFunction)&wxPanel4Frame::OnPanel1Paint,0,this);
Build Log:
-------------- Build: Release in wxPanel4 (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.0.2\include -IC:\wxWidgets-3.0.2\lib\gcc_lib\mswu -c "C:\Documents and Settings\Stv.XPWS02\Desktop\Briefcase\Cpp Projects\CodeBlocks\wxWidgets_projs\wxPanel4\dlg.cpp" -o obj\Release\dlg.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.0.2\include -IC:\wxWidgets-3.0.2\lib\gcc_lib\mswu -c "C:\Documents and Settings\Stv.XPWS02\Desktop\Briefcase\Cpp Projects\CodeBlocks\wxWidgets_projs\wxPanel4\wxFrame1.cpp" -o obj\Release\wxFrame1.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.0.2\include -IC:\wxWidgets-3.0.2\lib\gcc_lib\mswu -c "C:\Documents and Settings\Stv.XPWS02\Desktop\Briefcase\Cpp Projects\CodeBlocks\wxWidgets_projs\wxPanel4\wxFrame2.cpp" -o obj\Release\wxFrame2.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -IC:\wxWidgets-3.0.2\include -IC:\wxWidgets-3.0.2\lib\gcc_lib\mswu -c "C:\Documents and Settings\Stv.XPWS02\Desktop\Briefcase\Cpp Projects\CodeBlocks\wxWidgets_projs\wxPanel4\wxPanel4Main.cpp" -o obj\Release\wxPanel4Main.o
mingw32-g++.exe -LC:\wxWidgets-3.0.2\lib\gcc_lib -L"C:\Program Files\CodeBlocks\MinGW\bin" -o bin\Release\wxPanel4.exe obj\Release\dlg.o obj\Release\wxFrame1.o obj\Release\wxFrame2.o obj\Release\wxPanel4App.o obj\Release\wxPanel4Main.o obj\Release\resource.res -s -mthreads -lwxmsw30u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows
obj\Release\wxPanel4Main.o:wxPanel4Main.cpp:(.text+0x5adf): undefined reference to `wxPanel4Frame::OnPanel1Paint(wxPaintEvent&)'
obj\Release\wxPanel4Main.o:wxPanel4Main.cpp:(.text+0x9c5f): undefined reference to `wxPanel4Frame::OnPanel1Paint(wxPaintEvent&)'
collect2: ld returned 1 exit status
Process terminated with status 1 (3 minute(s), 26 second(s))
2 error(s), 0 warning(s) (3 minute(s), 26 second(s))
----------------------- end build log ------------------------------------------
When I comment the Panel1 line, the Build is without errors. But later during other file edits, my comment marks (//) mysteriously disappear.
When deleted, the line reappeared.
So I need to define a reference to 'wxPanel4Frame::OnPanelPaint(wxPaintEvent&)' I am not sure where or how.
The project EXE file works perfectly with the line commented.
I can post more code if necessary.
(using C::B 13.12, wxWidgets 3.0.2, Win XP)
Any suggestions appreciated.