Search code examples
c++user-interfaceg++codeblockswxwidgets

CodeBlocks wxWidgets project cannot find the wxWidgets directory


I'm using CodeBlocks to work with the wxWidgets library, but I'm having problems with the library. When I create a wxWidgets project it gives a warning saying:

"A corresponding Release configuration cannot be found in the wxWidgets directory you specified. This means that the Release target of your project will not be built. Are you sure you want to continue with these settings?"

the wxWidgets im using is in the path: C:\wxWidgets-3.2.2.1

the compiler: TDM GCC

using: wxSmith, Frame based

I reinstalled/build(with make) the library several times, compiler and codeblocks, variable in system path etc

I used:

mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1

to build the library

I'll try the things I find on the internet and in the error messages and update here


Solution

  • All right guys, i found finally the solution to fix this matter.

    The problem is that codeblocks has updated wxWidgets project until 3.1 versions.

    Now wxWidgets is in the 3.2 version.

    Then based on the following content from the wxWidgets forum:

    https://forums.wxwidgets.org/viewtopic.php?f=20&t=42301

    The codeblocks wxWidgets project has a script which have the instruction to search a specific version of the file -lwxmsw.

    In the case just search for the 31u version. But the wxWidgets just has the -lwxmsw32u.

    So do you have two options:

    Download an acceptable version or edit the script as I did.

    When creating the project, if you use the right mouse button, options will appear, and one of them is to change the script. And then will open the wizard.script

    Around lines 340-350 will be the instruction about the specific file:

    
            if (IsUnicode)
                lib_unic_suffix = _T("u");
            else
                lib_unic_suffix = _T("");
    
            if (WxVersion == 0)
                lib_wxver = _T("26");
            else if (WxVersion == 1)
                lib_wxver = _T("28");
            else if (WxVersion == 2)
                lib_wxver = _T("30");
            else if (WxVersion == 3)
                lib_wxver = _T("31");
    
    

    You can add a part for 3.2 or you can change the one for 3.1 to find the file for version 3.2.

    If you decide to create a new part, you will have to mess with several parts of the script. Since I am only using the library for simple daily use, changing the string was enough to not get the mentioned error anymore.

    So i changed to:

    else if (WxVersion == 3)
        lib_wxver = _T("32");
    

    My project compiled with no more errors.