Our GNU/Linux distribution is Archlinux.
A little history
When we started with wxWidgets, we did it around 2007, we started with Ubuntu, at that time we downloaded and compiled wxWidgets1. Starting 2008 we changed distro to ArchLinux, also at work we moved to Fedora. One of the great gems come inside ArchLinux is yaourt, which did more easy the work of compiling wxWidgets.
Intalling wxWidgets on ArchLinux is done with the next command.
sudo pacman -S wxgtk
Intalling wxMSW is also easy with the next command
yaourt -S mingw32-wxmswThose are the available versions for wxMSW2 on Archlinux:
aur/mingw32-wxmsw 2.8.9-1 (Out of Date) (2) wxMSW is a port of wxWidgets for MS Windows aur/ mingw32-wxmsw-static 2.8.11-1 wxMSW is a port of wxWidgets for MS Windows. Static version
After installing mingw32-wxmsw-static 2.8.11-1. We hurry up to compile our inventory system when running it on Windows/XP, we realized our login window did not have the superior bar3.
What to Do?, We decided to install the last version 2.9.1, but such a version is distributed just for windows on an exe compressed file.
The Decision
We decided to compile 2.9.1. even it is just distributed for windows.
- Download wxMSW-2.9.1-Setup.exe.
- Also download the source code src
- We installed it on windows4. We choose to put it on folder wxMSW-2.9.1.
- Compress the described folder in the previous step and bring it to Archlinux.
- On Archlinux we have a folder ~/abs/wxmsw/src, uncompress there for having ~/abs/wxmsw/src/wxMSW-2.9.1.
- Download the PKGBUILD. In our case we downloaded the previous version (2.8.11) and we adapted it to 2.9.1.
- Start compilation with5:
makepkg
We are doing a list of every problem we face when compiling:
- First issue
PKGBUILD: line 32: ./configure: Permission denied
- Solve it with
chmod 755 configure
- Solve it with
- Second issue
config.status: error: cannot find input file: contrib/Makefile.in
- Looking at the sources[?], we can discover that folder is in src/tiff. Replace with the source code from step 2 the tiff folder 6.
- Third issue
./src/expat/lib/xmlparse.c:97:2: error: #error memmove does not exist on this platform, nor is a substitute available
- After googling, the answer is to add to the compilation parameters
-O2 -fno-strict-aliasing -DHAVE_MEMMOVE=1 -DXML_DTD
We must locate us in the folder src/wxMSW-2.9.1 and use the command
i486-mingw32-gcc -c -o wxexpat_xmlparse.o -DNDEBUG -I./src/expat -D_LARGEFILE_SOURCE=unknown -I~/abs/wxmsw/src/wxMSW-2.9.1/lib/wx/include/i486-mingw32-msw-unicode-2.9 -I./include -mthreads -Wall -Wundef -mthreads -march=i686 -mtune=generic -O2 -fno-strict-aliasing -DHAVE_MEMMOVE=1 -DXML_DTD -pipe ./src/expat/lib/xmlparse.c
- After googling, the answer is to add to the compilation parameters
- Fourth issue (similar to the previous one)
Creating library file: ~/abs/wxmsw/src/wxMSW-2.9.1/lib/libwx_baseu_xml-2.9-i486-mingw32.dll.a ~/abs/wxmsw/article_tmp/src/wxMSW-2.9.1/lib/libwxexpat-2.9-i486-mingw32.a(wxexpat_xmlparse.o):xmlparse.c:(.text+0x7ab1): undefined reference to `_XmlPrologStateInitExternalEntity'
- After digging in the code we pointed out the file
xmrole.c. The solution is to recompile this file with the same
parameters given on the previous step.
-O2 -fno-strict-aliasing -DHAVE_MEMMOVE=1 -DXML_DTD
i486-mingw32-gcc -c -o wxexpat_xmlrole.o -DNDEBUG -I./src/expat -D_LARGEFILE_SOURCE=unknown -I~/abs/wxmsw/src/wxMSW-2.9.1/lib/wx/include/i486-mingw32-msw-unicode-2.9 -I./include -mthreads -Wall -Wundef -mthreads -march=i686 -mtune=generic -O2 -fno-strict-aliasing -DHAVE_MEMMOVE=1 -DXML_DTD -pipe ./src/expat/lib/xmlrole.c
- After digging in the code we pointed out the file
xmrole.c. The solution is to recompile this file with the same
parameters given on the previous step.
Finally. The wxMSW 2.9.1. is compiled and ready to be installed.
After installing, we proceed to cross compile our inventory system, the bug3 mentioned is gone. Happy Coding
1. Compiling inside Ubuntu help us to notice wxWidgets applications can be distribuced with static and dynamic libraries.
2. 2.9.1 is not available for installation.
3. It is a bug for wxMSW 2.8.11.
4. There must be a way of not installing it on windows, just to inspect the exe on GNU/Linux and copy form It.
5. At this moment. We did not realize this process was going to take more than an hour on o Pentium M processor.
6. If you just replace contrib you are going to find more errors.
Last change: 22.11.2011 20:03 |