Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

CodeBlocks Compiling

(1/3) > >>

gagraceffa:
Hi all
I'm trying to compile the latest release of CodeBlocks on Windows but I get errors in compiling. I want to understand which versions of MinGW, WXwidget and CodeBlocks do I need to successfully compile. The error messages are like the following:

||=== Build: tinyXML in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: AutoRevision in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: ConsoleRunner in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Squirrel in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Squirrel std lib in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: SqPlus in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: scintilla in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: wxpropgrid in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: sdk in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: src in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Abbreviations in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: AStyle in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Autosave in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Compiler depslib in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Compiler in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Debugger in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Code-completion in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
C:\wxMSW-2.8.12\wxMSW-2.8.12\lib\gcc_dll\mswu\wx\setup.h|207|warning: "wxUSE_STL" redefined|
:0|0|note: this is the location of the previous definition|
C:\wxMSW-2.8.12\wxMSW-2.8.12\include\wx\msw\private.h||In destructor 'ClassRegistrar::~ClassRegistrar()':|
C:\wxMSW-2.8.12\wxMSW-2.8.12\include\wx\msw\private.h|695|error: cannot convert 'wxString' to 'LPCSTR {aka const char*}' for argument '1' to 'BOOL UnregisterClassA(LPCSTR, HINSTANCE)'|
C:\wxMSW-2.8.12\wxMSW-2.8.12\include\wx\msw\private.h||In function 'wxString wxGetFullModuleName(HMODULE)':|
C:\wxMSW-2.8.12\wxMSW-2.8.12\include\wx\msw\private.h|781|error: cannot convert 'wxStringBuffer' to 'LPSTR {aka char*}' for argument '2' to 'DWORD GetModuleFileNameA(HINSTANCE, LPSTR, DWORD)'|
||=== Build failed: 2 error(s), 1 warning(s) (0 minute(s), 18 second(s)) ===|

Many thanks

Giacomo

stahta01:
If you are trying to build Code::Blocks using wxUSE_STL=1 you are likely going to fail no matter what versions you use.

I would suggest wxWidgets version 3.0.3 and what ever GCC mingw compiler version you wish to try that is at least as new as the GCC compiler that was package with CB 16.01. I think it was GCC 4.9.2 TDM 32 bit.

Note: Most MinGW64 GCC compilers have issues building monolithic wxWidgets (except for TDM builds) needed by the Code::Blocks projects under windows OS.

Tim S.

riban:
I am seeing same results with wxUSE_STL = 0.

I worked around it by changing private.h (just for the offending build targets):

Replace line 680 with:
--- Code: ---m_clsname = wxString::FromUTF8(wc.lpszClassName);
--- End code ---
Replace line 695 with:
--- Code: ---if ( !::UnregisterClass(m_clsname.mb_str(), wxhInstance) )
--- End code ---
Replace wxGetFullModuleName at line 773 with:
--- Code: --- inline wxString wxGetFullModuleName(HMODULE hmod)
{
    wxString fullname;
    char cName[MAX_PATH];
    if ( !::GetModuleFileName
            (
                hmod,
                cName,
                MAX_PATH
            ) )
    {
        wxLogLastError(_T("GetModuleFileName"));
    }
    fullname = wxString::FromUTF8(cName);
    return fullname;
}
--- End code ---

This was rather irksome but allowed me to build the project. We need to resolve this issue. It only affects some build targets even though others use the same private.h file so these functions do work but maybe some configuration difference between the build targets.

stahta01:
@riban: I suggest you post a build log with the issue.
Post the compiler version info.
Post the wxWidgets version info.
Edit: Post the command used to build wxWidgets or your source of the already built wx library.
Post the Code::Blocks source code version info.

Tim S.

stahta01:
FYI: If you are trying to build [with] an ANSI instead of an Unicode wxWidgets then state that fact!!

Tim S.

Navigation

[0] Message Index

[#] Next page

Go to full version