2

我正在尝试在 Mac OS X 10.8.3 上使用 wxWidgets-2.9.4 在 Xcode 中配置一个项目。我使用以下选项配置了 wxWidgets:

./configure --enable-debug --disable-shared --enable-unicode --with-osx_cocoa --enable-monolithic

然后成功编译库。所有演示都运行良好。

我使用 wx-config 获得的标志配置了我的项目。尤其是:

./wx-config --libs
-L/wxWidgets/wxWidgets-2.9.4/build-release/lib   -framework IOKit -framework Carbon -   framework Cocoa -framework AudioToolbox -framework System -framework OpenGL /wxWidgets/wxWidgets-2.9.4/build-release/lib/libwx_osx_cocoau-2.9.a -framework WebKit -lwxregexu-2.9 -lwxtiff-2.9 -lwxjpeg-2.9 -lwxpng-2.9 -lz -lpthread

./wx-config --cxxflags
-I/wxWidgets/wxWidgets-2.9.4/build-release/lib/wx/include/osx_cocoa-unicode-static-2.9 -  I/wxWidgets/wxWidgets-2.9.4/include -D_FILE_OFFSET_BITS=64 -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__

当我尝试构建我的项目时,我得到了许多未定义的符号:

Undefined symbols for architecture x86_64:
"wxOnAssert(char const*, int, char const*, char const*, wchar_t const*)", referenced from:
  wxMouseState::ButtonIsDown(wxMouseButton) const   in Canvas.o
  wxControlContainerBase::SetContainerWindow(wxWindow*)       in Canvas.o
  wxCloseEvent::Veto(bool)  in GeoTecDocView.o
  wxMouseState::ButtonIsDown(wxMouseButton) const   in GeoTecDocView.o
  wxBufferedDC::InitCommon(wxDC*, int)   in GeoTecDocView.o
  wxBoxSizer::wxBoxSizer(int)in GeoTecDocView.o
  wxArrayString::Item(unsigned long)in GeoTecWxDoc.o
  ...
  "wxOnAssert(char const*, int, char const*, char const*, char const*)", referenced from:
  wxEventFunctorMethod<wxEventTypeTag<wxCommandEvent>, wxEvtHandler, wxEvent, wxEvtHandler>::operator()(wxEvtHandler*, wxEvent&)in DocManager.o
  wxEventFunctorMethod<wxEventTypeTag<wxCommandEvent>, wxEvtHandler, wxEvent, wxEvtHandler>::wxEventFunctorMethod(void (wxEvtHandler::*)(wxEvent&), wxEvtHandler*)in DocManager.o
  wxEventTableEntryBase::wxEventTableEntryBase(int, int, wxEventFunctor*, wxObject*)in DocManager.o
  wxEventFunctorMethod<wxEventTypeTag<wxCommandEvent>, wxEvtHandler, wxEvent, wxEvtHandler>::operator()(wxEvtHandler*, wxEvent&)in GeoTecApp.o
  wxEventFunctorMethod<wxEventTypeTag<wxCommandEvent>, wxEvtHandler, wxEvent, wxEvtHandler>::wxEventFunctorMethod(void (wxEvtHandler::*)(wxEvent&), wxEvtHandler*)in GeoTecApp.o
  wxEventTableEntryBase::wxEventTableEntryBase(int, int, wxEventFunctor*, wxObject*)in GeoTecApp.o
  wxEventFunctorMethod<wxEventTypeTag<wxKeyEvent>, wxEvtHandler, wxEvent, wxEvtHandler>::operator()(wxEvtHandler*, wxEvent&)in GeoTecDocView.o
  ...
  "wxMessageBox(wxString const&, wxString const&, long, wxWindow*, int, int)", referenced from:
  GeoTecMainFrame::OnCancellaTutti(wxCommandEvent&)        in GeoTecDocView.o
  GeoTecMainFrame::OnCancellaLineaCedimenti(wxCommandEvent&)        in GeoTecDocView.o
  GeoTecMainFrame::OnRicalcolaOra(wxCommandEvent&)        in GeoTecDocView.o
  GeoTecMainFrame::AggiornaFinestre()       in GeoTecDocView.o
  GeoTecMainFrame::OnAbout(wxCommandEvent&)       in GeoTecDocView.o
  GeoTecMainFrame::OnRemoveObject(GTGraphicObject*)        in GeoTecDocView.o
  StratigrafiaDialog::Validate()      in GTDialogs.o
  ...
  "wxFileSelector(wxString const&, wxString const&, wxString const&, wxString const&, wxString const&, int, wxWindow*, int, int)", referenced from:
  GeoTecMainFrame::OnImporta(wxCommandEvent&)       in GeoTecDocView.o
  "wxGet_wxConvLibcPtr()", referenced from:
  wxGet_wxConvLibc()     in Canvas.o
  wxGet_wxConvLibc()     in GeoTecApp.o
  wxGet_wxConvLibc()     in GeoTecDocView.o
  wxGet_wxConvLibc()     in GeoTecWxDoc.o
  wxGet_wxConvLibc()     in GlobalParameters.o
  wxGet_wxConvLibc()     in GTDialogs.o
  wxGet_wxConvLibc()     in GTPrint.o
  ...
  "wxBell()", referenced from:
  StrisciaIndefinitaDialog::Calcola(wxCommandEvent&)       in GTDialogs.o
  NumberValidator::OnChar(wxKeyEvent&)       in Validators.o
  IntValidator::OnChar(wxKeyEvent&)       in Validators.o
  "wxEntry(int&, char**)", referenced from:
  _main in GeoTecApp.o
  "wxCheckBox::Create(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)", referenced from:
  wxCheckBox::wxCheckBox(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)in GTDialogs.o
  "wxClientDC::wxClientDC(wxWindow*)", referenced from:
  Canvas::OnMouseMove(wxMouseEvent&)       in Canvas.o
  Canvas::OnMouseLeftUp(wxMouseEvent&)       in Canvas.o
  GeoTecCanvas::OnMouseMove(wxMouseEvent&)        in GeoTecDocView.o
  GeoTecCanvas::OnMouseLeftUp(wxMouseEvent&)        in GeoTecDocView.o
  GeoTecCanvas::OnMouseLeftDown(wxMouseEvent&)        in GeoTecDocView.o
  GeoTecCanvas::OnMouseDClick(wxMouseEvent&)        in GeoTecDocView.o
  RiepilogoStratigrafieCanvas::OnMouseLeftDown(wxMouseEvent&)        in RiepilogoStratigrafieView.o
  ...
  "wxDocument::LoadObject(std::basic_istream<char, std::char_traits<char> >&)", referenced from:
  GeoTecWxDoc::LoadObject(std::basic_istream<char, std::char_traits<char> >&)in GeoTecWxDoc.o
  "wxDocument::RemoveView(wxView*)", referenced from:
  vtable for GeoTecWxDocin GeoTecWxDoc.o
  "wxDocument::SaveObject(std::basic_ostream<char, std::char_traits<char> >&)", referenced from:
  GeoTecWxDoc::SaveObject(std::basic_ostream<char, std::char_traits<char> >&)in GeoTecWxDoc.o
 "wxDocument::SetFilename(wxString const&, bool)", referenced from:
  GeoTecWxDoc::SaveAs()      in GeoTecWxDoc.o
 "wxDocument::ms_classInfo", referenced from:
  __static_initialization_and_destruction_0(int, int)in GeoTecWxDoc.o
 "wxDocument::NotifyClosing()", referenced from:
  vtable for GeoTecWxDocin GeoTecWxDoc.o

还有更多。

如果我使用 wxMac-2.8.12,该项目工作正常,但我遇到了一些图形问题,所以我想尝试新版本。

谢谢你的帮助。前夕

4

1 回答 1

0

您可能只为 x86 构建了 wxWidgets。无论如何,您肯定为单一架构构建了它,而您的 Xcode 项目可能设置为同时为 x86 和 x86_64 构建。

如果您确实需要 64 位版本的应用程序,您应该使用--enable-universal_binary=x86,x86_64选项重新配置 wxWidgets。但我建议仅在 32 位中构建 Xcode 项目(即仅用于 x86),至少在开发期间是这样。

于 2013-05-16T19:59:44.473 回答