Неопределенное соответствие с wxWidgets в коде::Blocks

#codeblocks #wxwidgets

#codeblocks #wxwidgets

Вопрос:

Я загрузил готовые двоичные файлы wxWidgets 3.1.2 и поместил их в свою minGW папку. В Code::Blocks я запускаю мастер создания приложения wxWidgets просто для того, чтобы проверить, работает ли wxWidgets. Я начал создавать проект, и мне показали несколько серий ошибок, которые я исправил.

Но я не смог получить эти ошибки:

     ||=== Build: Debug in x (compiler: GNU GCC Compiler) ===|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o||in function `WinMain':|
C:UsersAadhishDocumentsProjectsxxApp.cpp|17|undefined reference to `__imp__Z7wxEntryP11HINSTANCE__S0_Pci'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o||in function `xApp::OnInit()':|
C:UsersAadhishDocumentsProjectsxxApp.cpp|23|undefined reference to `__imp__Z22wxInitAllImageHandlersv'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o||in function `xApp::xApp()':|
C:UsersAadhishDocumentsProjectsxxApp.h|15|undefined reference to `__imp__ZN5wxAppC2Ev'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x10)||undefined reference to `wxApp::GetClassInfo() const'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x80)||undefined reference to `wxApp::GetEventTable() const'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x88)||undefined reference to `wxApp::GetEventHashTable() const'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0xb0)||undefined reference to `wxApp::Initialize(intamp;, wchar_t**)'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0xc8)||undefined reference to `wxAppBase::OnRun()'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0xe0)||undefined reference to `wxAppBase::OnExit()'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0xf0)||undefined reference to `wxApp::CleanUp()'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x108)||undefined reference to `wxAppBase::OnInitCmdLine(wxCmdLineParseramp;)'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x110)||undefined reference to `wxAppBase::OnCmdLineParsed(wxCmdLineParseramp;)'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x150)||undefined reference to `wxApp::OnExceptionInMainLoop()'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x190)||undefined reference to `wxApp::WakeUpIdle()'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x198)||undefined reference to `wxAppBase::ProcessIdle()'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x1b8)||undefined reference to `wxAppBase::CreateTraits()'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x1c0)||undefined reference to `wxAppBase::OnInitGui()'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x1c8)||undefined reference to `wxAppBase::SafeYield(wxWindow*, bool)'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x1d0)||undefined reference to `wxAppBase::SafeYieldFor(wxWindow*, long)'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x1e0)||undefined reference to `wxAppBase::GetTopWindow() const'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x1e8)||undefined reference to `wxAppBase::GetDisplayMode() const'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x200)||undefined reference to `wxAppBase::GetLayoutDirection() const'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o:xApp.cpp:(.rdata$_ZTV4xApp[_ZTV4xApp] 0x210)||undefined reference to `wxAppBase::SetActive(bool, wxWindow*)'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxApp.o||in function `xApp::~xApp()':|
C:UsersAadhishDocumentsProjectsxxApp.h|15|undefined reference to `__imp__ZN5wxAppD2Ev'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `xFrame::xFrame(wxWindow*, int)':|
C:UsersAadhishDocumentsProjectsxxMain.cpp|64|undefined reference to `__imp_wxDefaultSize'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|64|undefined reference to `__imp_wxDefaultPosition'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|64|undefined reference to `__imp__ZN7wxFrame6CreateEP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|65|undefined reference to `__imp__ZN9wxMenuBarC1Ev'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|67|undefined reference to `__imp__ZN10wxMenuItemC1EP6wxMenuiRK8wxStringS4_10wxItemKindS1_'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|71|undefined reference to `__imp__ZN10wxMenuItemC1EP6wxMenuiRK8wxStringS4_10wxItemKindS1_'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|74|undefined reference to `__imp__ZN11wxFrameBase10SetMenuBarEP9wxMenuBar'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|80|undefined reference to `__imp__ZN11wxFrameBase12SetStatusBarEP11wxStatusBar'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|82|undefined reference to `__imp_wxEVT_MENU'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|83|undefined reference to `__imp_wxEVT_MENU'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:UsersAadhishDocumentsProjectsxxMain.cpp|55|undefined reference to `__imp__ZN7wxFrameD2Ev'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `xFrame::~xFrame()':|
C:UsersAadhishDocumentsProjectsxxMain.cpp|87|undefined reference to `__imp__ZN7wxFrameD2Ev'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `xFrame::OnQuit(wxCommandEventamp;)':|
C:UsersAadhishDocumentsProjectsxxMain.cpp|95|undefined reference to `__imp__ZN12wxWindowBase5CloseEb'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `xFrame::OnAbout(wxCommandEventamp;)':|
C:UsersAadhishDocumentsProjectsxxMain.cpp|101|undefined reference to `__imp__Z12wxMessageBoxRK8wxStringS1_lP8wxWindowii'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `__static_initialization_and_destruction_0':|
C:UsersAadhishDocumentsProjectsxxMain.cpp|50|undefined reference to `__imp__ZN7wxFrame13sm_eventTableE'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `wxWindowBase::GetBestVirtualSize() const':|
C:MinGWincludewxwidgetsincludewxwindow.h|525|undefined reference to `__imp__ZNK12wxWindowBase11GetBestSizeEv'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `wxWindowBase::CanBeFocused() const':|
C:MinGWincludewxwidgetsincludewxwindow.h|738|undefined reference to `__imp__ZNK12wxWindowBase9IsEnabledEv'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `wxWindowBase::HasCapture() const':|
C:MinGWincludewxwidgetsincludewxwindow.h|1032|undefined reference to `__imp__ZN12wxWindowBase10GetCaptureEv'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `wxWindowBase::GetDefaultAttributes() const':|
C:MinGWincludewxwidgetsincludewxwindow.h|1113|undefined reference to `__imp__ZN12wxWindowBase25GetClassDefaultAttributesE15wxWindowVariant'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `wxWindowBase::DoGetBestClientSize() const':|
C:MinGWincludewxwidgetsincludewxwindow.h|1817|undefined reference to `__imp_wxDefaultSize'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `wxWindow::ShowWithEffect(wxShowEffect, unsigned int)':|
C:MinGWincludewxwidgetsincludewxmswwindow.h|89|undefined reference to `__imp__ZN8wxWindow17MSWShowWithEffectEb12wxShowEffectj'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `wxWindow::HideWithEffect(wxShowEffect, unsigned int)':|
C:MinGWincludewxwidgetsincludewxmswwindow.h|94|undefined reference to `__imp__ZN8wxWindow17MSWShowWithEffectEb12wxShowEffectj'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `wxWindow::MSWEndDeferWindowPos()':|
C:MinGWincludewxwidgetsincludewxmswwindow.h|756|undefined reference to `__imp_wxDefaultPosition'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:MinGWincludewxwidgetsincludewxmswwindow.h|757|undefined reference to `__imp_wxDefaultSize'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: objDebugxMain.o||in function `wxTopLevelWindowBase::IsActive()':|
C:MinGWincludewxwidgetsincludewxtoplevel.h|201|undefined reference to `__imp__ZN12wxWindowBase9FindFocusEv'|
c:mingwbin..libgccx86_64-w64-mingw328.2.0........x86_64-w64-mingw32binld.exe: C:MinGWincludewxwidgetsincludewxtoplevel.h|201|undefined reference to `__imp__ZNK12wxWindowBase12IsDescendantEPS_'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|
  

Я получил эту ошибку. Я знаю, что это ошибка с библиотеками. Я связал libwxbase31ud.a.

Надеюсь, я все объяснил.

Ответ №1:

У вас есть элементы пользовательского интерфейса, поэтому вам также нужна, по крайней мере, core библиотека (т.Е. libwxmsw31ud_core.a ). Есть библиотека список страниц, которые могут быть вам полезны. И вы можете перейти в папку, в которой в данный момент находится ваша libwxbase31ud.a библиотека, чтобы найти соответствующий файл для каждой библиотеки.

Еще одно хорошее место для поиска сведений о библиотеке — это makefile.gcc пример, который поставляется с wxWidgets.

Комментарии:

1. Я добавляю libwxmsw31ud_core.a в компоновщик. Проект успешно скомпилирован. Но когда я пытаюсь его запустить. Это показывает мне, что файлы ‘ wxmsw312ud_core_gcc810_x64.dll и wxbase312ud_gcc810_x64.dll отсутствуют. Таким образом, программа не может запуститься, переустановка программы может решить эту проблему.’ Я искал их . dll на моем компьютере, но я не смог ее найти.

2. Эти библиотеки DLL являются частью загруженного вами архива. Загляните во вложенную папку «lib / gcc810_x64_dll» вашей установки wxWidgets.

3. Я нашел один, но не могу найти другой @Xaviou

4. @Aadhish, вам следует скопировать эту DLL-библиотеку в папку, в которой находится ваше приложение, и повторить попытку. Также какую библиотеку вы нашли?

5. @Aadhish, создать библиотеку самостоятельно очень просто и прямолинейно. Почему бы не попробовать?