如何使用wxwidgets设置crosstool-ng

时间:2016-12-27 17:28:21

标签: wxwidgets embedded-linux crosstool-ng

我想为我的gui应用程序设置ct-ng,现在我想使用wxwidgets。

为了设置crosstool,我使用了:

# Install prerequisites:
apt-get -y install gcc gperf bison flex gawk  libtool automake     libncurses5-dev texinfo

# Setup toolchain
# instructions from https://github.com/crosstool-ng/crosstool-ng
cd toolchain/crosstool-ng
./bootstrap
./configure --prefix=$HOME/.local
make && make install

echo -ne "\n\nif [ -d \"$HOME/.local/bin\" ]; then\n  PATH=\"$HOME/.local/bin:$PATH\"\nfi" >> ~/.profile
source ~/.profile

mkdir ../tc/
cd ../tc/
ct-ng list-samples
ct-ng x86_64-w64-mingw32
ct-ng build # lasts 30 minutes...

##################### WxWidgets ######################
cd ../wxWidgets/
sh autogen.sh
./configure --prefix="$HOME/prefix" --enable-static --disable-shared --build=x86_64-w64-mingw32 --enable-unicode --without-libtiff --without-libjpeg --with-expat=builtin --with-libpng=builtin
make

我找到的唯一方法是从github克隆wxwidgets并在脚本中按照上面的方式编译它。然后,我包括作为路径-I

WXWIDGET=../toolchain/wxWidgets/include/
$(CXX) -I$(FLEX) -I$(WXWIDGET) $(WXWIDGETSFLAGS) $(CPPFLAGS) $(header) $(src) $(obj3) -o $(OUTPUT)/$(bin)

编译时出现了数百个错误:

In file included from ../toolchain/wxWidgets/include/wx/platform.h:485:0,
             from ../toolchain/wxWidgets/include/wx/defs.h:20,
             from ../toolchain/wxWidgets/include/wx/string.h:24,
             from ../toolchain/wxWidgets/include/wx/artprov.h:14,
             from parser/include/gui.h:17,
             from parser/include/customdialogs.h:17:
../toolchain/wxWidgets/include/wx/chkconf.h:282:9: error: #error     "wxUSE_SECRETSTORE must be defined, please read comment near the top of this file."
  #       error "wxUSE_SECRETSTORE must be defined, please read comment near the top of this file."

我该怎么办?

1 个答案:

答案 0 :(得分:1)

你需要尝试" - 主持人"和" - 目标"配置选项。

试试" ../ configure --host = x86_64-w64-mingw32 --target = x86_64-w64-mingw32 --disable-shared --enable-unicode"。

BTW," - enable-unicode"应该默认打开。所以你可以放弃它。

此外,如果您的软件需要C ++ 11,则应将库编译为:

CXXFLAGS =" -std = C ++ 11" ../configure --host = x86_64-w64-mingw32 --target = x86_64-w64-mingw32 --disable-shared --enable-unicode