1

I want to setup the ct-ng for my gui application and now I want to use wxwidgets.

For setting up the crosstool, I have used:

# 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

The only way I have found is to clone wxwidgets from github and compile it as above in the script. Then, I included as path -I

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

Hundreds of errors appearing while compiling:

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."

What should I do?

j35t3r
  • 1,254
  • 2
  • 19
  • 53
  • 1
    why do you need to call "sh autogen.sh"? Also, it is recommended to do a build in the build directory and not in the root wxWidgets one. So, I would do:" cd ../wxWidgets && mkdir buildCrosstool && cd buildCrosstool && ../configure && make". Also, is "secret store" functionality defined for your environment? – Igor Dec 27 '16 at 18:19
  • @Igor If I do not execute sh autogen.sh, there will no ./configure appear. What is the "secret store" functionality? But, all in all, I think those hints will not help me that my project will have the right includes... – j35t3r Dec 27 '16 at 18:44
  • all you need to do is just clone the wxWIdgets repository. configure script should be there. Are you sure you are grabbing from the proper repo? Everything you need to build the library should be there. I would remove the wxWidgets directory completely, clone it second time and post the contents of the wxWidgets/ directory. – Igor Dec 27 '16 at 20:30
  • Ok. it is working just with ./configure && make -j https://s29.postimg.org/kvt62hd4n/Screenshot_20161227_232546.png What should I do next? – j35t3r Dec 27 '16 at 22:26
  • Never ever do compilation in the root folder of any *nix package. That's why I suggested to create a separate build directory. So after you follow the suggestion and the build will finish successfully, all you will need to do is: cd wxWidgets/buildCrosstool/samples/minimal && make && ./minimal". If minimal sample will execute - you are done, library built correctly. Now you can start developing you own application. Just look at the code of the minimal sample and do the coding appropriately. – Igor Dec 28 '16 at 01:24
  • if the sample does not start or won't compile, please post the exact command used to build the sample and the error message as it appears on the screen exactly (do Copy'n'Paste unless it's not in English). – Igor Dec 28 '16 at 01:27
  • yeah ok. it is compiling. But I get the same errors as above if I change CXX=g++ to my crosstool CXX=x86_64-w64-mingw32-c++. – j35t3r Dec 28 '16 at 09:38
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/131676/discussion-between-peter-and-igor). – j35t3r Dec 28 '16 at 09:38

1 Answers1

1

You need to try "--host" and "--target" configure options.

Just try "../configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-shared --enable-unicode".

BTW, "--enable-unicode" should be turned on by default. So you can drop it.

Also, if you software required C++11, you should compile the library as:

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

Igor
  • 5,620
  • 11
  • 51
  • 103