Hello,

I lost some hours trying to set up wxWidgets and starting a simple program using Code::Blocks.
wxWidgets is installed and built, following this tutorial.
But when I start a new project I get into some message saying: "A matching debug configuration cannot be found in the wxWidgets directory you specified. Would you like to link tihs target against the release binaries instead? (Debugging the executable will still be possible.)"
I chose yes or no and get to the next step.
"This means that debug target will not build. Are you sure you want to continue?"
Choosing yes.
Project starts. I try to build it and get some errors:

-------------- Build: Debug in wxw1 (compiler: GNU GCC Compiler)---------------

windres.exe -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\lib\gcc_dll\mswu -J rc -O coff -i C:\Users\sst5clj\MyFolder\code\cbl\_wxw\wxw1\resource.rc -o obj\Debug\resource.res
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -std=c++0x -IC:\wxWidgets-2.8.12\include -IC:\wxWidgets-2.8.12\lib\gcc_dll\mswu -c C:\Users\sst5clj\MyFolder\code\cbl\_wxw\wxw1\wxw1App.cpp -o obj\Debug\wxw1App.o
In file included from C:\wxWidgets-2.8.12\include/wx/string.h:55:0,
                 from C:\wxWidgets-2.8.12\include/wx/memory.h:16,
                 from C:\wxWidgets-2.8.12\include/wx/object.h:20,
                 from C:\wxWidgets-2.8.12\include/wx/event.h:17,
                 from C:\wxWidgets-2.8.12\include/wx/app.h:20,
                 from C:\Users\sst5clj\MyFolder\code\cbl\_wxw\wxw1\wxw1App.h:13,
                 from C:\Users\sst5clj\MyFolder\code\cbl\_wxw\wxw1\wxw1App.cpp:18:
C:\wxWidgets-2.8.12\include/wx/buffer.h: In constructor 'wxCharBuffer::wxCharBuffer(const char*)':
C:\wxWidgets-2.8.12\include/wx/buffer.h:127:1: error: 'strdup' was not declared in this scope
C:\wxWidgets-2.8.12\include/wx/buffer.h: In member function 'wxCharBuffer& wxCharBuffer::operator=(const char*)':
C:\wxWidgets-2.8.12\include/wx/buffer.h:127:1: error: 'strdup' was not declared in this scope
C:\wxWidgets-2.8.12\include/wx/buffer.h: In constructor 'wxWCharBuffer::wxWCharBuffer(const wchar_t*)':
C:\wxWidgets-2.8.12\include/wx/buffer.h:134:1: error: '_wcsdup' was not declared in this scope
C:\wxWidgets-2.8.12\include/wx/buffer.h: In member function 'wxWCharBuffer& wxWCharBuffer::operator=(const wchar_t*)':
C:\wxWidgets-2.8.12\include/wx/buffer.h:134:1: error: '_wcsdup' was not declared in this scope
In file included from C:\wxWidgets-2.8.12\include/wx/memory.h:16:0,
                 from C:\wxWidgets-2.8.12\include/wx/object.h:20,
                 from C:\wxWidgets-2.8.12\include/wx/event.h:17,
                 from C:\wxWidgets-2.8.12\include/wx/app.h:20,
                 from C:\Users\sst5clj\MyFolder\code\cbl\_wxw\wxw1\wxw1App.h:13,
                 from C:\Users\sst5clj\MyFolder\code\cbl\_wxw\wxw1\wxw1App.cpp:18:
C:\wxWidgets-2.8.12\include/wx/string.h: In function 'int Stricmp(const char*, const char*)':
C:\wxWidgets-2.8.12\include/wx/string.h:141:31: error: 'strcasecmp' was not declared in this scope
In file included from C:\wxWidgets-2.8.12\include/wx/gdicmn.h:20:0,
                 from C:\wxWidgets-2.8.12\include/wx/event.h:21,
                 from C:\wxWidgets-2.8.12\include/wx/app.h:20,
                 from C:\Users\sst5clj\MyFolder\code\cbl\_wxw\wxw1\wxw1App.h:13,
                 from C:\Users\sst5clj\MyFolder\code\cbl\_wxw\wxw1\wxw1App.cpp:18:
C:\wxWidgets-2.8.12\include/wx/list.h: In constructor 'wxListKey::wxListKey(const wxChar*)':
C:\wxWidgets-2.8.12\include/wx/list.h:406:36: error: '_wcsdup' was not declared in this scope
C:\wxWidgets-2.8.12\include/wx/list.h: In constructor 'wxListKey::wxListKey(const wxString&)':
C:\wxWidgets-2.8.12\include/wx/list.h:408:44: error: '_wcsdup' was not declared in this scope
Process terminated with status 1 (0 minute(s), 3 second(s))
7 error(s), 0 warning(s) (0 minute(s), 3 second(s))

Can anyone help? I set up the $(#wx) variable properly.
I followed C::B forums but still can't get it working. Out of ideas.

First, build your code::blocks to be debuggable. There is probably a build option for that. Next, build wx to be debuggable as well. Finally, rebuild your project from scratch.

More information required. It seems you are building this with GCC in Windows. Is this the MingW compiler, or in Cygwin?

It is mingw...
Ermmm... I just use installed C::B, I didn't built it.
For the wxwidgets I used :
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport

Should I rebuild with BUILD=debug?

OK... now is working... sort of :P
I rebuilt using BUILD=release, and choose only create release. Compiling it failed saying :
C:\wxWidgets-3.0.0\include/wx/platform.h:189:22: fatal error: wx/setup.h: No such file or directory

I found some "fix" on the tutorial page but is not working:
"You're missing an important compiler search path in your build options. Make sure you choose the correct wxWidgets build configuration when running the wxWidgets project wizard. If re-running the wizard isn't an option, then open your project's build options and add "$(#wx.lib)\gcc_dll\mswu" (assuming a monolithic Unicode DLL build) or "$(#wx.lib)\gcc_lib\mswu" (assuming a multilib Unicode build)to the compiler search paths."

I'm doing something wrong and I don't know what...

This still looks strange to me but I got it working. It only works with new wxwidgets projects + wxSmith.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.