如何使用 wxwidgets 设置 crosstool-ng
How to setup crosstool-ng with wxwidgets
我想为我的 gui 应用程序设置 ct-ng,现在我想使用 wxwidgets。
为了设置交叉工具,我使用了:
# 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."
我该怎么办?
您需要尝试“--host”和“--target”配置选项。
只需尝试“../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-shared --enable-unicode”。
顺便说一句,“--enable-unicode”应该默认打开。所以你可以放弃它。
此外,如果您的软件需要 C++11,您应该将库编译为:
CXXFLAGS="-std=c++11" ../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-shared --enable-unicode
我想为我的 gui 应用程序设置 ct-ng,现在我想使用 wxwidgets。
为了设置交叉工具,我使用了:
# 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."
我该怎么办?
您需要尝试“--host”和“--target”配置选项。
只需尝试“../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-shared --enable-unicode”。
顺便说一句,“--enable-unicode”应该默认打开。所以你可以放弃它。
此外,如果您的软件需要 C++11,您应该将库编译为:
CXXFLAGS="-std=c++11" ../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-shared --enable-unicode