Author Topic: A matching debug configuration cannot be found in the wxWidgets directory...  (Read 31927 times)

Offline ljones

  • Single posting newcomer
  • *
  • Posts: 7
I've built wxWidgets 2.8.12 using using the mingw32 version of GNU Make 3.82 on Windows 7 x64 SP1. The commands used were

Code
cd "C:\libraries\wxWidgets-2.8.12\build\msw"
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=debug SHARED=1 MONOLITHIC=1 UNICODE=1 clean
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=debug SHARED=1 MONOLITHIC=1 UNICODE=1
rename gcc_mswuddll debug
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 clean
mingw32-make -f makefile.gcc CXXFLAGS="-fno-keep-inline-dllexport" BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1
rename gcc_mswudll release

So in the "C:\libraries\wxWidgets2.8.12\build\msw" directory I have a folder named "release" and a folder named "debug."

I set the wxWidgets base directory variable to "C:\libraries\wxWidgets-2.8.12" and try to create a new wxWidgets project, checking the "wxWidgets is built as a monolithic library" and "Enable unicode" boxes along the way. On clicking "Next" to start the project, I'm greeted with the warning "A matching debug configuration cannot be found in the wxWidgets directory you specified. This means the debug target of your project will not build."

I've searched the forum, but all the answers I've run across have had to do with the libraries not actually being built. I've also tried copying the "debug" and "release" folders I built into the base directory with the same results. I'm sure I'm just missing something silly, but I can't for the life of me figure out what it is. Any help would be appreciated.


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
I've searched the forum, but all the answers I've run across have had to do with the libraries not actually being built. I've also tried copying the "debug" and "release" folders I built into the base directory with the same results. I'm sure I'm just missing something silly, but I can't for the life of me figure out what it is. Any help would be appreciated.
C::B matches the file name with your configuration. If you rename the file this does not work anymore. Why do you do that? Would you rename other SDK libraries in the same way? Like rename OpenGL into "release", too?

So you have two options now: Either you change the wizard (by right-clicking on it an select "edit") so it finds you renamed libs or you just stick with the libs as they have been build which is the better options.

Btw: Renaming the file will make it impossible to compile for different wxWidgets flavours.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ljones

  • Single posting newcomer
  • *
  • Posts: 7
Just rebuilt everything without changing any names. Same problem.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Just rebuilt everything without changing any names. Same problem.
Full build log, please?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ljones

  • Single posting newcomer
  • *
  • Posts: 7

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Debug build: http://pastebin.com/FRGKtvRE
Release build: http://pastebin.com/sN3KTZTs
LOL... I meant he build log of your application inside C::B, not wxWidgets (but leave it there for reference...).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ljones

  • Single posting newcomer
  • *
  • Posts: 7
When I click "Next" through the "matching debug configuration..." warning, I get an identical warning for the Release build. Attempts to compile give me:

Code
-------------- Build: Debug in test ---------------

Compiling: testApp.cpp
In file included from C:\libraries\wxWidgets-2.8.12\include/wx/defs.h:21:0,
                 from C:\libraries\wxWidgets-2.8.12\include/wx/event.h:15,
                 from C:\libraries\wxWidgets-2.8.12\include/wx/app.h:20,
                 from M:\cppstuff\wxfirst\test\testApp.h:13,
                 from M:\cppstuff\wxfirst\test\testApp.cpp:18:
C:\libraries\wxWidgets-2.8.12\include/wx/platform.h:196:22: fatal error: wx/setup.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
 

I have setup.h files in several directories within the wxWidgets library directory, but copying each of those into "C:\libraries\wxWidgets-2.8.12\include/wx/" gives me various errors as well.
Copying C:\libraries\wxWidgets-2.8.12\include\msvc\wx\setup.h, C:\libraries\wxWidgets-2.8.12\include\wx\univ\setup.h, C:\libraries\wxWidgets-2.8.12\include\wx\msw\setup.h, C:\libraries\wxWidgets-2.8.12\include\wx\msw\wince\setup.h, C:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswu\wx\setup.h, C:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswud\wx\setup.h, or C:\libraries\wxWidgets-2.8.12\contrib\include\wx\deprecated\setup.h to "C:\libraries\wxWidgets-2.8.12\include/wx/" results in
Code
-------------- Build: Debug in test ---------------

Linking executable: bin\Debug\test.exe
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw28u
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxpng
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxjpeg
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxtiff
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxzlib
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
5 errors, 0 warnings


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6036
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator

Code
-------------- Build: Debug in test ---------------

Linking executable: bin\Debug\test.exe
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw28u
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxpng
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxjpeg
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxtiff
c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/ld.exe: cannot find -lwxzlib
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
5 errors, 0 warnings
From the log above, I see that your project is configured with multiply wx libs, but you have only monolithic wx library. (you build it with MONOLITHIC=1)
Mostly I guess you need to change your project configurations, or you need to run the project wizard to create a wx app which links to monolithic wx library.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ljones

  • Single posting newcomer
  • *
  • Posts: 7
From the log above, I see that your project is configured with multiply wx libs, but you have only monolithic wx library. (you build it with MONOLITHIC=1)
Mostly I guess you need to change your project configurations, or you need to run the project wizard to create a wx app which links to monolithic wx library.

I'm not sure if this covers what you're telling me, but as I said in the original post, I checked the "wxWidgets is built as a monolithic library" box when creating the project. Based on search results, I added "C:\libraries\wxWidgets-2.8.12\lib\gcc_dll" as a Linker search directory. After doing this and copying the setup.h from "C:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswud\wx" (debug build, mswu is the release) into "C:\libraries\wxWidgets-2.8.12\include\wx", it builds as expected, but then it tells me "wxmsw28u_gcc_custom.dll is missing" from my computer when I try to run the resulting binary.

Also, is copying setup.h into the include directory really how I'm supposed to make it work? What's the point of a separate debug and release build in that case? Also, it still gives me both warnings when creating a new project.
« Last Edit: June 26, 2012, 04:59:44 am by ljones »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6036
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I checked the "wxWidgets is built as a monolithic library" box when creating the project. Based on search results, I added "C:\libraries\wxWidgets-2.8.12\lib\gcc_dll" as a Linker search directory. After doing this and copying the setup.h from "C:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswud\wx" (debug build, mswu is the release) into "C:\libraries\wxWidgets-2.8.12\include\wx", it builds as expected, but then it tells me "wxmsw28u_gcc_custom.dll is missing" from my computer when I try to run the resulting binary.
It looks like you have already build a exe, that's great!

Quote
Also, is copying setup.h into the include directory really how I'm supposed to make it work? What's the point of a separate debug and release build in that case? Also, it still gives me both warnings when creating a new project.
No, manually copying the setup.h is not necessary.
Did you set the "wx" variable correctly. If you set it correctly, you don't need to change anything after your create a wxWidgets project, you just click the "build" button, and it should build and run successfully.

See:
http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7256
Just rebuilt everything without changing any names. Same problem.
Full build log, please?

You still did not post the full build log, or better the relevant part of it.
Full build log means the build log with full commandline logging enabled.
See MortenMacFly's signature for a link, that tells you how to turn it on, or search the forum.

Offline ljones

  • Single posting newcomer
  • *
  • Posts: 7
Added "$(#wx.lib)\gcc_dll\mswu" and "$(#wx.lib)\gcc_dll\mswud" as compiler search directories and "$(#wx.lib)\gcc_dll" as a linker search directory and it all compiles now. It still gives me the warnings about matching configurations when creating a new project, but I guess that's just a minor annoyance at this point.

Build log:
Code
Build started on: 26-06-2012 at 10:20.30
Build ended on: 26-06-2012 at 10:20.35
-------------- Build: Debug in test2 ---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wno-attributes -Wall -g -IC:\libraries\wxWidgets-2.8.12\\include -IC:\libraries\wxWidgets-2.8.12\\contrib\include -IC:\libraries\wxWidgets-2.8.12\\lib\gcc_lib\mswu -IC:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswu -IC:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswud -c C:\Users\laj\Documents\cpp_problems\test2\test2App.cpp -o obj\Debug\test2App.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wno-attributes -Wall -g -IC:\libraries\wxWidgets-2.8.12\\include -IC:\libraries\wxWidgets-2.8.12\\contrib\include -IC:\libraries\wxWidgets-2.8.12\\lib\gcc_lib\mswu -IC:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswu -IC:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswud -c C:\Users\laj\Documents\cpp_problems\test2\test2Main.cpp -o obj\Debug\test2Main.o
windres.exe -i C:\Users\laj\DOCUME~1\CPP_PR~1\test2\resource.rc -J rc -o obj\Debug\resource.res -O coff -IC:\libraries\wxWidgets-2.8.12\\include -IC:\libraries\wxWidgets-2.8.12\\lib\gcc_lib\mswu
mingw32-g++.exe -LC:\libraries\wxWidgets-2.8.12\\lib\gcc_lib -LC:\libraries\wxWidgets-2.8.12\lib\gcc_dll -o bin\Debug\test2.exe obj\Debug\test2App.o obj\Debug\test2Main.o obj\Debug\resource.res -mthreads -lwxmsw28u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows
Output size is 428.18 KB
Process terminated with status 0 (0 minutes, 4 seconds)
0 errors, 0 warnings

Still getting the dll error at runtime.

edit: Found the .dll files in "C:\libraries\wxWidgets-2.8.12\lib\gcc_dll". Made sure the "Use wxWidgets DLL", "wxWidgets is built as a monolithic library", and "Enable unicode" boxes were all checked at the end of project creation. Between this and the added compiler & linker search directories mentioned above, warnings are gone and code compiles and runs as expected. Thanks.

edit2: Unsure if it's possible/how to mark solved.
« Last Edit: June 26, 2012, 05:34:16 pm by ljones »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Code
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wno-attributes -Wall -g -IC:\libraries\wxWidgets-2.8.12\\include -IC:\libraries\wxWidgets-2.8.12\\contrib\include -IC:\libraries\wxWidgets-2.8.12\\lib\gcc_lib\mswu -IC:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswu -IC:\libraries\wxWidgets-2.8.12\lib\gcc_dll\mswud -c C:\Users\laj\Documents\cpp_problems\test2\test2App.cpp -o obj\Debug\test2App.o
Still getting the dll error at runtime.
That doesn't surprise. Make sure you are not mixing too much path's and settings here. What you do currently is to compile with default wxWidgets unicode settings but tell the compiler/linker to search for includes/libs in debug folders, too (which is very bad). You have to understand that you need to use specific flags and include folders for each different build of wxWidgets. Don't mix them. If unsure, compile at command line first and then transfer the settings to the IDE.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ljones

  • Single posting newcomer
  • *
  • Posts: 7
That doesn't surprise. Make sure you are not mixing too much path's and settings here. What you do currently is to compile with default wxWidgets unicode settings but tell the compiler/linker to search for includes/libs in debug folders, too (which is very bad). You have to understand that you need to use specific flags and include folders for each different build of wxWidgets. Don't mix them. If unsure, compile at command line first and then transfer the settings to the IDE.

Not sure I'm following. Like I said, it's working now, but if this is going to be an issue, would simply removing ""$(#wx.lib)\gcc_dll\mswud"" and leaving only ""$(#wx.lib)\gcc_dll\mswu" in the compiler search directories be enough to mitigate it?