User forums > General (but related to Code::Blocks)

[SOLVED] CodeBlocks with wxWidgets compiler failed.

(1/3) > >>

bleakwind:
I rebuild wxWidgets about 6,7 times, 2days, and it's still compiler failed.
Please help me...

My OS is Win7
codeblocks-17.12mingw-setup.exe
wxWidgets-3.1.2.zip



Here is compiler message:


--- Code: ----------------- Build: Debug in abc (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -ID:\wxWidgets\include -ID:\wxWidgets\lib\gcc_lib\mswu -c E:\Project\cb\abc\abcApp.cpp -o obj\Debug\abcApp.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -ID:\wxWidgets\include -ID:\wxWidgets\lib\gcc_lib\mswu -c E:\Project\cb\abc\abcMain.cpp -o obj\Debug\abcMain.o
windres.exe -ID:\wxWidgets\include -ID:\wxWidgets\lib\gcc_lib\mswu  -J rc -O coff -i E:\Project\cb\abc\resource.rc -o obj\Debug\resource.res
mingw32-g++.exe -LD:\wxWidgets\lib\gcc_lib -o bin\Debug\abc.exe obj\Debug\abcApp.o obj\Debug\abcMain.o  obj\Debug\resource.res -mthreads  -lwxmsw31u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -mwindows
obj\Debug\abcApp.o: In function `WinMain@16':
E:/Project/cb/abc/abcApp.cpp:17: undefined reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'
obj\Debug\abcApp.o: In function `Z11wxCreateAppv':
E:/Project/cb/abc/abcApp.cpp:17: undefined reference to `wxAppConsoleBase::CheckBuildOptions(char const*, char const*)'
obj\Debug\abcApp.o: In function `ZN6abcApp6OnInitEv':
E:/Project/cb/abc/abcApp.cpp:23: undefined reference to `wxInitAllImageHandlers()'
E:/Project/cb/abc/abcApp.cpp:28: undefined reference to `wxDialog::ShowModal()'
obj\Debug\abcApp.o: In function `ZN23wxCriticalSectionLockerC1ER17wxCriticalSection':
D:/wxWidgets/include/wx/thread.h:307: undefined reference to `wxCriticalSection::Enter()'
obj\Debug\abcApp.o: In function `ZN23wxCriticalSectionLockerD1Ev':
D:/wxWidgets/include/wx/thread.h:312: undefined reference to `wxCriticalSection::Leave()'
obj\Debug\abcApp.o: In function `ZN16wxAppConsoleBase22SetInitializerFunctionEPFP12wxAppConsolevE':
D:/wxWidgets/include/wx/app.h:454: undefined reference to `wxAppConsoleBase::ms_appInitFn'
obj\Debug\abcApp.o: In function `ZN16wxAppConsoleBase11GetInstanceEv':
D:/wxWidgets/include/wx/app.h:462: undefined reference to `wxAppConsoleBase::ms_appInstance'
obj\Debug\abcApp.o: In function `ZN6abcAppC1Ev':
E:/Project/cb/abc/abcApp.h:15: undefined reference to `wxApp::wxApp()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x8): undefined reference to `wxApp::GetClassInfo() const'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x14): undefined reference to `wxObject::CreateRefData() const'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x18): undefined reference to `wxObject::CloneRefData(wxRefCounter const*) const'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x24): undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x28): undefined reference to `wxEvtHandler::QueueEvent(wxEvent*)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x30): undefined reference to `wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x34): undefined reference to `wxEvtHandler::TryBefore(wxEvent&)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x38): undefined reference to `wxEvtHandler::TryAfter(wxEvent&)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x40): undefined reference to `wxApp::GetEventTable() const'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x44): undefined reference to `wxApp::GetEventHashTable() const'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x48): undefined reference to `wxEvtHandler::DoSetClientObject(wxClientData*)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x4c): undefined reference to `wxEvtHandler::DoGetClientObject() const'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x50): undefined reference to `wxEvtHandler::DoSetClientData(void*)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x54): undefined reference to `wxEvtHandler::DoGetClientData() const'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x58): undefined reference to `wxApp::Initialize(int&, wchar_t**)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x64): undefined reference to `wxAppBase::OnRun()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x68): undefined reference to `wxAppConsoleBase::OnLaunched()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x70): undefined reference to `wxAppBase::OnExit()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x78): undefined reference to `wxApp::CleanUp()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x80): undefined reference to `wxAppConsoleBase::Exit()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x84): undefined reference to `wxAppBase::OnInitCmdLine(wxCmdLineParser&)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x88): undefined reference to `wxAppBase::OnCmdLineParsed(wxCmdLineParser&)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x8c): undefined reference to `wxAppConsoleBase::OnCmdLineHelp(wxCmdLineParser&)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x90): undefined reference to `wxAppConsoleBase::OnCmdLineError(wxCmdLineParser&)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x94): undefined reference to `wxAppConsoleBase::SetCLocale()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x98): undefined reference to `wxAppConsoleBase::FilterEvent(wxEvent&)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0x9c): undefined reference to `wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xa0): undefined reference to `wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xa4): undefined reference to `wxAppConsoleBase::OnUnhandledException()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xa8): undefined reference to `wxApp::OnExceptionInMainLoop()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xac): undefined reference to `wxAppConsoleBase::StoreCurrentException()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xb0): undefined reference to `wxAppConsoleBase::RethrowStoredException()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xb4): undefined reference to `wxAppConsoleBase::ProcessPendingEvents()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xb8): undefined reference to `wxAppConsoleBase::Pending()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xbc): undefined reference to `wxAppConsoleBase::Dispatch()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xc0): undefined reference to `wxAppConsoleBase::MainLoop()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xc4): undefined reference to `wxAppConsoleBase::ExitMainLoop()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xc8): undefined reference to `wxApp::WakeUpIdle()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xcc): undefined reference to `wxAppBase::ProcessIdle()'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xd4): undefined reference to `wxAppConsoleBase::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)'
obj\Debug\abcApp.o:abcApp.cpp:(.rdata$_ZTV6abcApp[__ZTV6abcApp]+0xd8): undefined reference to `wxAppConsoleBase::OnAssert(wchar_t const*, int, wchar_t const*, wchar_t const*)'
Process terminated with status 1 (0 minute(s), 5 second(s))
50 error(s), 0 warning(s) (0 minute(s), 5 second(s))
--- End code ---

I build wxWidgets use
mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=1 UNICODE=1 BUILD=debug
mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=1 UNICODE=1 BUILD=release
And it has no error.

Here is my wxWidgets dir:


--- Code: ---D:\wxWidgets\lib>tree /F /A
卷 SSD_D 的文件夹 PATH 列表
卷序列号为 1AA0-FB8C
D:.
|   abicheck.sh
|   vms.opt
|   vms_gtk.opt
|   vms_gtk2.opt
|   vms_x11_univ.opt
|
\---gcc_lib
    |   libwxexpat.a
    |   libwxexpatd.a
    |   libwxjpeg.a
    |   libwxjpegd.a
    |   libwxmsw31u.a
    |   libwxmsw31ud.a
    |   libwxmsw31ud_gl.a
    |   libwxmsw31u_gl.a
    |   libwxpng.a
    |   libwxpngd.a
    |   libwxregexu.a
    |   libwxregexud.a
    |   libwxscintilla.a
    |   libwxscintillad.a
    |   libwxtiff.a
    |   libwxtiffd.a
    |   libwxzlib.a
    |   libwxzlibd.a
    |
    +---mswu
    |   |   build.cfg
    |   |
    |   \---wx
    |       |   setup.h
    |       |
    |       \---msw
    |               rcdefs.h
    |
    \---mswud
        |   build.cfg
        |
        \---wx
            |   setup.h
            |
            \---msw
                    rcdefs.h

--- End code ---

Here is Codeblocks's some setting:


--- Code: ---[ ] Use wxWidgets DLL
[Y] wxWidgets is build as a monolithic library
[Y] Enable Unicode

--- End code ---

BlueHazzard:
Are you sure you use the same compiler? To get more information you could add the -v parameter to the linker options and see if it gives you some errors...

bleakwind:

--- Quote from: BlueHazzard on August 20, 2019, 08:17:18 am ---Are you sure you use the same compiler? To get more information you could add the -v parameter to the linker options and see if it gives you some errors...

--- End quote ---

Thanks for your reply.

My os is win7, I use Codeblocks's gcc.

Put this to Path:
D:\CodeBlocks\MinGW\bin

BlueHazzard:
And you have no other compiler installed? or in the path?

bleakwind:

--- Quote from: BlueHazzard on August 20, 2019, 08:49:58 am ---And you have no other compiler installed? or in the path?

--- End quote ---

None.


--- Code: ---C:\Users\Bleakwind>mingw32-g++.exe -v
Using built-in specs.
COLLECT_GCC=mingw32-g++.exe
COLLECT_LTO_WRAPPER=D:/CodeBlocks/MinGW/bin/../libexec/gcc/mingw32/5.1.0/lto-wrapper.exe
Target: mingw32
Configured with: ../../../src/gcc-5.1.0/configure --build=mingw32 --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --disable-symvers --enable-cxx-flags='-fno-function-sections -fno-data-sections -DWINPTHREAD_STATIC' --prefix=/mingw32tdm --with-local-prefix=/mingw32tdm --with-pkgversion=tdm-1 --enable-sjlj-exceptions --with-bugurl=http://tdm-gcc.tdragon.net/bugs
Thread model: posix
gcc version 5.1.0 (tdm-1)

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version