main.cpp に保存されている wxWidget サンプル アプリケーション ( http://www.wxwidgets.org/docs/tutorials/hello.htm ) とのリンクに問題があります。私はそれをコンパイルしてリンクしようとします:
g++ `wx-config --cxxflags --libs` main.cpp
私が得る出力は次のとおりです。
/tmp/ccFHWUaX.o: In function `wxCreateApp()':
main.cpp:(.text+0x31): undefined reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'
/tmp/ccFHWUaX.o: In function `main':
main.cpp:(.text+0x91): undefined reference to `wxEntry(int&, char**)'
/tmp/ccFHWUaX.o: In function `MyFrame::MyFrame(wxString const&, wxPoint const&, wxSize const&)':
main.cpp:(.text+0x1d2): undefined reference to `wxFrameNameStr'
main.cpp:(.text+0x267): undefined reference to `wxEmptyString'
main.cpp:(.text+0x2ea): undefined reference to `wxEmptyString'
main.cpp:(.text+0x366): undefined reference to `wxMenuBar::wxMenuBar()'
main.cpp:(.text+0x3d1): undefined reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
main.cpp:(.text+0x3da): undefined reference to `wxStatusLineNameStr'
main.cpp:(.text+0x407): undefined reference to `wxFrame::CreateStatusBar(int, long, int, wxString const&)'
main.cpp:(.text+0x44f): undefined reference to `wxFrameBase::SetStatusText(wxString const&, int)'
main.cpp:(.text+0x533): undefined reference to `wxFrame::~wxFrame()'
(and many lines more...)
WxWidgets-2.8 は ubuntu リポジトリを使用してインストールされ、そのライブラリは /usr/lib/x86_64-linux-gnu にあります。また、次のようにライブラリ パスを指定してビルドしようとしました。
-L/usr/lib/x86_64-linux-gnu/
ただし、これは出力を変更しません。私は自分の問題を multiarch のせいにしていましたが、実際には、それがどのように機能するのか正確にはわかりません。
サンプルを正しくビルドする方法を教えてもらえますか?
ありがとうマイケル