I am running Code::Blocks version 20.03 on Windows 7. The compiler I use is GCC default (don't know which version number).
Hope this helps.
Build log:
-------------- Build: Debug in AOR8600 (compiler: GNU GCC Compiler)---------------
g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -IC:\SDK\wx313CB\include -IC:\SDK\wx313CB\lib\gcc_lib\mswu -c C:\Users\X\Documents\MyCodeBlocks\AOR8600\AOR8600Main.cpp -o obj\Debug\AOR8600Main.o
g++.exe -LC:\SDK\wx313CB\lib\gcc_lib -o bin\Debug\AOR8600.exe obj\Debug\AOR8600App.o obj\Debug\AOR8600Main.o obj\Debug\portsEnum.o obj\Debug\Serial.o obj\Debug\resource.res -mthreads -static -lwxmsw31u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -loleacc -luxtheme -mwindows
C:\Users\X\Documents\MyCodeBlocks\AOR8600\AOR8600Main.cpp: In member function 'void AOR8600Frame::OnRecTimer(wxTimerEvent&)':
C:\Users\X\Documents\MyCodeBlocks\AOR8600\AOR8600Main.cpp:177:11: warning: unused variable 'n' [-Wunused-variable]
DWORD n=0;
^
obj\Debug\AOR8600Main.o: In function `AOR8600Frame::OnconnectButtonClick(wxCommandEvent&)':
C:/Users/X/Documents/MyCodeBlocks/AOR8600/AOR8600Main.cpp:201: undefined reference to `CSerial::Open(wchar_t const*, unsigned long, unsigned long, bool)'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 10 second(s))
2 error(s), 1 warning(s) (0 minute(s), 10 second(s))
Interestingly this is some bulls***** with the microsoft types...
what LPCTSTR is not clear for me and probably also the linker/compiler...
it is a (long) pointer to constant TCHAR string
and TCHAR is wchar_t if UNICODE is defined and char otherwise....
Somehow during compiling TCHAR seems to be wchar_t and during linking it seems to be char
If i modify your serial open function signature to
virtual LONG Open(const char* lpszDevice, DWORD dwInQueue = 0, DWORD dwOutQueue = 0, bool fOverlapped = SERIAL_DEFAULT_OVERLAPPED);
it links and compiles fine for me.
Ultimately this is not a codeblocks problem....
[EDIT:] i did not tested it, and i do not know what type or encoding (probably utf-16) LPCTSTR has during runtime. So you still can get some crash compiling it that way...
[EDIT2:] Probably some windows guru can help you better or bring light in the dark API