Hey everyone! Today I managed to finish figuring out how to set up the build options for cross compiling, debugging and running windows executables for projects built with codeblocks using linux... As such, I decided it was time to sign up for the c::b forums and post a howto in case anyone else was interested in knowing what I did...
The following is how I did this on Ubuntu 'Dapper Drake' Linux:
Step 1:
Install MingW32 for linux
# sudo apt-get install mingw32
Step 2:
Settings->Compiler and debugger settings
Select GNU GCC Compiler and click the Copy button.
Name this: MingW32 Compiler
Step 3:
Click the Compiler tab and then click the #defines tab.
Add the following:
WINVER=0x0400
__WIN95__
__GNUWIN32__
STRICT
HAVE_W32API_H
__WXMSW__
__WINDOWS__
Click the Linker tab and the following under "Other Linker Options":
-lstdc++
-lgcc
-lodbc32
-lwsock32
-lwinspool
-lwinmm
-lshell32
-lcomctl32
-lctl3d32
-lodbc32
-ladvapi32
-lodbc32
-lwsock32
-lopengl32
-lglu32
-lole32
-loleaut32
-luuid
*Note: Not all of these are REQUIRED... As I have been recently messing with compiling apps for windows with ogl and dx9 support I have realized that there are some additions I have needed to add here... I will update accordingly when I know more.
Step 4:
Click the Directories tab and the Compiler tab.
Modify the path to read the following (where ix86 is your architecture type):
/usr/i586-mingw32msvc/include
Click the Directories tab and the Linker tab:
Modify the path to read the following (where ix86 is your architecture type):
/usr/i586-mingw32msvc/lib
Click the Directories tab and the Resource Compiler tab:
Modify the path to read the following (where ix86 is your architecture type):
/usr/i586-mingw32msvc/include
Step 5:
Click the Programs tab:
C compiler: i586-mingw32msvc-gcc
C++ compiler: i586-mingw32msvc-g++
Linker for dynamic libs: i586-mingw32msvc-g++
Linker for static libs: i586-mingw32msvc-ar
Debugger: i586-mingw32msvc-gdb **** MORE ON THIS LATER ****
Click OK and save your changes.
Step 6:
Ubuntu's mingw32 package and from what I can tell, MingW32 in general doesnt really have a solid gdb option for debugging natively in linux so we're going to work around this using wine and mingw32's latest insight build for windows
Install Wine
# sudo apt-get install wine
Step 7:
Download Insight here:
http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=82725&release_id=371590
Step 8:
Once you download insight.exe, extract the archive using wine:
I extracted this to my desktop
Step 9:
Move the insight folder to /opt
the path should now look like
Step 10:
create a shell script in /usr/bin:
(note: shell scripts should start with a hash (#) bang (!), ie: "# ! / bin / sh " [with no spaces] but when I add that the forum post tanks)
# sudo gedit /usr/bin/i586-mingw32msvc-gdb
and add the following:
wine /opt/insight/bin/gdb.exe "$@"
Save the file and quit gedit
Step 11:
# sudo chmod +x /usr/bin/i586-mingw32msvc-gdb
Now we have a way to execute the windows version of mingw32's gdb for windows in linux using our shell script wrapper
Step 12:
Create a new console application project in Codeblocks...
Using the wizard select the MingW32 Compiler option.
Step 13:
Right click the project and go to properties. Click the Targets tab and set the Output Filename to be whatever you want with a .exe file extension. Make sure the Type is a Console Application.
Step 14:
When I reached this step, compiled and tried to run my application I realized that for some reason codeblocks was trying to execute my .exe through /usr/bin/wine-auto (which I do not have)... So I created a simlink to wine:
# sudo ln -s /usr/bin/wine /usr/bin/wine-auto
Step 15:
Hit F9 in codeblocks and the hello world application runs!! YAY!
Set a breakpoint on line 5 and hit F8 and the application breaks in the debugger!! Woot!
Now you can successfully compile, execute, and debug windows applications in linux using codeblocks!!!
While this worked perfectly for me on my set up please try this yourself and let me know if I can update this howto in any way.
A special thanks to all the codeblocks developers... Code::Blocks is the most awesome IDE for linux I've ever used.
*Update: Added note about libraries
Step 14:
When I reached this step, compiled and tried to run my application I realized that for some reason codeblocks was trying to execute my .exe through /usr/bin/wine-auto (which I do not have)... So I created a simlink to wine:
# sudo ln -s /usr/bin/wine /usr/bin/wine-auto
Step 15:
Hit F9 in codeblocks and the hello world application runs!! YAY!
Set a breakpoint on line 5 and hit F8 and the application breaks in the debugger!! Woot!
Now you can successfully compile, execute, and debug windows applications in linux using codeblocks!!!
While this worked perfectly for me on my set up please try this yourself and let me know if I can update this howto in any way.
A special thanks to all the codeblocks developers... Code::Blocks is the most awesome IDE for linux I've ever used.
*Update: Added note about libraries
When pressing F9 I can't debug the program, I got this error:
run-detectors: unable to find an interpreter for /home...../hello.exe
I think this is the reason:
Settings->Environment->General settings->Terminal to launch console: xterm -T $TITLE -e
But I don't know how to make the debugger work.
?
OK, after running crossdev --target mingw32
I got#mingw32-g++ --version
mingw32-g++ (GCC) 4.2.2 (Gentoo 4.2.2 p1.0)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Next step : cross-build binutils, gcc, w32api et wxMSW ;)
EDIT: done (i'm in 64 bits) USE="-* contrib unicode xrc" ROOT=/data/mingw32-build/ CHOST=mingw32 CBUILD="x86_64-pc-linux-gnu" emerge -1av --nodeps sys-devel/binutils sys-devel/gcc w32api make wxGTK
but cross-compilation of code::blocks through emereg didn't worked:checking for wx-config... /usr/lib64/wx/config/gtk2-unicode-release-2.8
checking for wxWidgets version >= 2.6.0... no
I will take a look later.
Moreover, emerge installed binutils and gcc with too many symlinks I'll have to manually adjust.
Maybe I'll use the standard "./configure && make && make install" procedures.
I want to cross compile my wxwidgets application but there is nothing in this (good howto) about it, so I wanted to add that to this howto (and update it too).
By the way, I follow the howto but when I tried to debug the sample aplication (on the last step) I have the following output on the Debbuger window:
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: /home/cesar/CodeBlocks/probaMinGW32/
Adding source dir: /home/cesar/CodeBlocks/probaMinGW32/
Adding file: bin/Debug_L64/probaMinGW32.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.3
Error creating process Z:\home\cesar\CodeBlocks\probaMinGW32/bin/Debug_L64/probaMinGW32.exe, (error 32)
And, obviously, if I try to continue debuging (Next Instruction, Step into...) I obtain an error:
Continuing...
The program is not being run.
Debugger finished with status 1
Really, I do not want to debug Windows applications under linux, just compile them, but I do not want to post a buggy howto, or leave this buggy (actually) now that I find it for the users who will need it in the near future. So, if someone can help me, it would be appreciated.
I am using:
-Ubuntu 8.04 x86_64
-Code::Blocks svn5177
-MinGW32 4.2.1
-Insight 6.3
-Wine 1.0
Well, when I added the wxWidgets repository I use it as "gutsy-wx" instead "hardy-wx" because at that time wxWidgets have not an hardy repository, so I try to update it before trying your wiki-article and now it works.
I follow your article and now I can cross compile correctly wxWidgets applications. I have solved one modifying <wx/chkconf.h> which is best solved using --prefix=/usr/i586-mingw32msvc
as you do. The other error (wxUSE_DATAOBJ not defined) have been solved by any of the steps, but I don't what. The fact is that it works, so THANKS.
When I tried the debugger (insight) it reported the same errors, so I download the recent gdb as your wiki says (6.8-rc) and now the debugger don't crash, but it report some errors (with the sample console application as suggested by this topic howto):
Error while mapping shared library sections:
Error while reading shared library symbols:
Error while mapping shared library sections:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while mapping shared library sections:
Error while reading shared library symbols:
Error while reading shared library symbols:
Error while reading shared library symbols:
With only this little inconvenient, I can say that this howto is well superceded by your wiki-article. Thank you ;)
Eps, too early it seems to be finished.
I have confused the build target, the cross compiler one don't work. I'm confused about a section of your article: "Fixing build options".
In the Build options of the project you have to move `wx-config --cflags` from the global Compiler settings -> Other options to the one for the standard build targets (Debug and Release).
`wx-config --cflags`??? I didn't have that.
The appropriate calls to wx-config for the WinRelease must have the parameter: --host=i586-mingw32msvc included and should have the parameter --static set also.
If I understand you, I have to go to the Build options of WinRelease-target and then to Compiler settings -> Other options and add:
`wx-config --host=i586-mingw32msvc --static --prefix=/usr/i586-mingw32msvc`
If I do that I get this Build Messages:
/usr/include/wx-2.8/wx/platform.h|540|error: wx/msw/libraries.h: No such file or directory|
/usr/include/wx-2.8/wx/defs.h|2820|error: conflicting declaration ‘typedef struct GtkWidget* WXWidget’|
/usr/include/wx-2.8/wx/defs.h|2611|error: ‘WXWidget’ has a previous declaration as ‘typedef void* WXWidget’|
/usr/include/wx-2.8/wx/string.h|827|error: ‘wxChar& wxString::operator[](unsigned int)’ cannot be overloaded|
/usr/include/wx-2.8/wx/string.h|824|error: with ‘wxChar& wxString::operator[](size_t)’|
/usr/include/wx-2.8/wx/hashmap.h||In member function ‘wxLongToLongHashMap_wxImplementation_HashTable::Node** wxLongToLongHashMap_wxImplementation_HashTable::GetNodePtr(const long int&) const’:|
/usr/include/wx-2.8/wx/hashmap.h|714|warning: dereferencing type-punned pointer will break strict-aliasing rules|
/usr/include/wx-2.8/wx/clntdata.h||In member function ‘wxShadowObjectMethods_wxImplementation_HashTable::Node** wxShadowObjectMethods_wxImplementation_HashTable::GetNodePtr(const wxString&) const’:|
/usr/include/wx-2.8/wx/clntdata.h|20|warning: dereferencing type-punned pointer will break strict-aliasing rules|
/usr/include/wx-2.8/wx/clntdata.h||In member function ‘wxShadowObjectFields_wxImplementation_HashTable::Node** wxShadowObjectFields_wxImplementation_HashTable::GetNodePtr(const wxString&) const’:|
/usr/include/wx-2.8/wx/clntdata.h|25|warning: dereferencing type-punned pointer will break strict-aliasing rules|
/usr/include/wx-2.8/wx/gdicmn.h||In member function ‘wxStringToColourHashMap_wxImplementation_HashTable::Node** wxStringToColourHashMap_wxImplementation_HashTable::GetNodePtr(const wxString&) const’:|
/usr/include/wx-2.8/wx/gdicmn.h|544|warning: dereferencing type-punned pointer will break strict-aliasing rules|
/usr/include/wx-2.8/wx/filefn.h|398|error: zero width for bit-field ‘wxAssert_399::BadFileSizeType’|
/usr/include/wx-2.8/wx/image.h||In member function ‘wxImageHistogramBase_wxImplementation_HashTable::Node** wxImageHistogramBase_wxImplementation_HashTable::GetNodePtr(const long unsigned int&) const’:|
/usr/include/wx-2.8/wx/image.h|136|warning: dereferencing type-punned pointer will break strict-aliasing rules|
||=== Build finished: 6 errors, 5 warnings ===|
Firstly, I understand you that I have to put to Compiler settings -> Other options:
--host=i586-mingw32msvc --static --prefix=/usr/i586-mingw32msvc
but I obtain in the Build log:
Compiling: probaWxMinGWApp.cpp
i586-mingw32msvc-g++: unrecognized option '-pthread'
cc1plus: error: unrecognized command line option "-fhost=i586-mingw32msvc"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
so I try the other option.
What I am doing wrong?
This afternoon I will try to compile wxWidgets myself (one more time) if it fixes something.
I'm using wxWidgets on my application, so I need to cross compile with it.
I've created a new wxWidgets project with the wizard as you do in the wiki.
I've picked "libwxmws2.8dbg", "libwxmsw2.8dev", "wx2.8headers-msw" and "wx2.8-headers-msw-force-depends" from your repository.
I just take a look on synaptic and your wxMSW is 2.8.8.0 and my wxWidgets is 2.8.8.1 (from wxWidgets repository) so this can be the problem, as you write.
Then I try to compile wxWidgets myself with the ./configure of your wiki and obtain this:
Configured wxWidgets 2.8.8 for `i586-pc-mingw32msvc'
Which GUI toolkit should wxWidgets use? msw
Should wxWidgets be compiled into single library? no
Should wxWidgets be compiled in debug mode? no
Should wxWidgets be linked as a shared library? no
Should wxWidgets be compiled in Unicode mode? yes
What level of wxWidgets compatibility should be enabled?
wxWidgets 2.4 no
wxWidgets 2.6 yes
Which libraries should wxWidgets use?
jpeg builtin
png builtin
regex builtin
tiff builtin
zlib builtin
odbc no
expat builtin
libmspack no
sdl no
Why mine should not compile as a single library?
Well, I go to try it.
I agree with you that it is a little too much work. However, as I am going to need it, I give it another chance.
I started using wxWidgets 2.8.8.1 from wxWidgets repo and wxMSW 2.8.8.0 from your repo, I've configured Code::Blocks as your wiki-article says, using `wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static` in Compiler settings -> Other options of the Windows build target.
I found lots of errors, mostly in wx header files, saying that it can find include file /usr/include/wx-2.8/wx/msw/include-file.h and I thinked about fix all manually, but I was lazy so I finally compile wxMSW with the following options:
./configure --host=i586-mingw32msvc --enable-unicode --build=`./config.guess` --disable-shared
That is, yours without --prefix (it installs to /usr/local) and it get to work, only a few warnings, but it compiles and runs in Windows XP. I also add the flags to compiling and linking options for the MinGW32 compiler as suggested by http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux but it seems that they are not necessary.
Then, I try cross compiling my own project and I get problems with wxPropertyGrid (the same which Code::Blocks use) for the cross build, but that is already another story.
I've reinstalled Ubuntu (for the garbage generated with manual compiling wxWidgets) and decided to give a last chance to your wxMSW.
This time I see that I have set `wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static` in Compiler settings -> Other options but don't in Linker Settings -> Other options. But there is no change, it continues to search include files in /usr/include/wx-2.8/wx/msw/ so it can't compile.
Then I compile wxWidgets with the same configure options as I write in the last post and it get to work right (after uninstall your wxMSW).
I know that wxPropertyGrid is not part of wxWidgets. I wrote:
Then, I try cross compiling my own project and I get problems with wxPropertyGrid (the same which Code::Blocks use) for the cross build, but that is already another story.
only as a comment. This time I've could cross compile it with my windows release.
After that (I don't know if it is related with cross-compilation, but I get this error after setting Code-Blocks and my project for cross-compiling) I get this error building with the default Debug-target (wich I don't modify at any time):
cc1plus: error: no se reconoce la opción de línea de comando "-mthreads"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
Approximate translation:
cc1plus: error: unknown command line option "-mthreads"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
This only happens when I try to build the whole project (or Rebuild), not when building changes.
Any idea?
You are right.
After compiling (and installing) wxMSW, I've check the wx-config --list output and it was right.
But now, I recheck it and only obtain:
Default config is i586-mingw32msvc-msw-unicode-release-static-2.8
Default config will be used for output
I don't know when it changed, but it changed.
I'm trying to solve it by making a symbolic link to the right wx-config:
$ sudo ln -s /usr/lib/wx/config/gtk2-unicode-release-2.8 /usr/bin/wx-config
but I obtain the same as above with wx-config --list.
In contrast, if I try /usr/lib/wx/config/gtk2-unicode-release-2.8 --list I obtain:
Default config is gtk2-unicode-release-2.8
Default config will be used for output
Alternate matches:
base-unicode-debug-2.8
base-unicode-release-2.8
gtk2-unicode-debug-2.8
Also available in /usr:
i586-mingw32msvc-msw-unicode-release-static-2.8
Even if I copy it directly, I obtain the same result, I'm confused.
I will continue with it tomorrow. I think that is time to go to wxWidgets forum.
I can provide them, but I think that it is not necessary because the cause was found.
Thanks.
EDIT:
When compiling wxWidgets without --prefix it is installed in /usr/local. So when I type wx-config --list in the terminal the system uses the one which is in /usr/local/bin. The same applies when building in Code::Blocks.
So, if I want to cross-compile under linux, I should compile all wxWidgets libraries by myself (and get it to work)... It seems that I will install Code::Blocks in windows.
If the wx-config does not list the correct entries, it's a wxWidgets install issue.
What doesupdate-alternatives --list wx-config
show?
It should be something like:
/usr/lib/wx/config/base-unicode-release-2.8
/usr/lib/wx/config/gtk2-unicode-release-2.8
.
If not it might be that you did not install the exWidgets-dev packages correctly.
You can try to uninstall your self-compiled wxwidgets by running "make uninstall" from its source directory.
And then reinstall all wxWidgets-packages.
You should eventually purge them first.
From synaptic chose "remove completely", maybe it's not the exact text, but it should be something like this (my system uses german language).
Then install:
"libwxbase2.8-0", "libwxbase2.8-dev", "libwxgtk2.8-0", "libwxgtk2.8-dev", "wx2.8-headers", "wx2.8-i18n", "wx-common", "libwxmsw2.8-dev", "wx2.8-headers-msw" and if you need due to dependencies of "wx2.8-headers-msw" you have to install "wx2.8-headers-msw-force-depends".
(The debug-packages of wxWidgets are only needed if you want to debug wxWidgets itself.)
And of course you need "mingw32" and its dependencies "mingw32-binutils" and "mingw32-runtime".
That's the installation that works out of the box on all my debian systems with the setup described in my wiki-article (even on clean systems, where I never build wxWidgets or C::B from source).
update-alternatives --list wx-config
shows:
/usr/lib/wx/config/base-unicode-release-2.8
/usr/lib/wx/config/gtk2-unicode-release-2.8
/usr/lib/wx/config/base-unicode-debug-2.8
/usr/lib/wx/config/gtk2-unicode-debug-2.8
I did a "make uninstall" and "remove completely" the wxWidgets libraries yesterday, but I will try another time.
....
I obtain the same.
Of course, I have installed "mingw32" and its dependencies, if don't I won't be able to cross-compile for windows, and I can.
I tried exactly your wiki-article after reinstalling (before building wxWidgets), and it don't work for me, it can be because my system is not Debian, but Debian-based (Ubuntu).
I give another try to your binaries. This time I set:
Compiler settings -> Other options
`wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static` -U__WXGTK__ -U__WXGTK20__
Linker Settings -> Other options
`wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static`
Search directories->Compiler and ->Linker:
/usr/i586-mingw32msvc/include/wx-2.8
I also have to modify /usr/include/wx-2.8/wx/platform.h line 196 from this:
to this:
#ifdef __WXGTK__
# include "wx/setup.h"
#endif
#ifdef __WIN32__
# include "wx/msw/setup0.h"
#endif
If I don't do that I get this error: "wxClipboard requires wxDataObject". Both are enabled, but without including "msw/setup0.h" the "wxUSE_DATAOBJ" needed remains 0 when it has to be 1.
With this, when I build the Windows target I get a few warnings and this error:
ld | | cannot find -lwx_gtk2u_richtext-2.8
||=== Build finished: 1 errors, 9 warnings ===|
With the warnings, it compile and run under windows, but no with that error.
And... that option? come from Code::Blocks? and why?
This time I attach the sample project and "default.conf".
[attachment deleted by admin]
Hi!!
I'm trying to build and run a wxWidgets test project but I'm getting a lot o errors. I've followed the wiki howto (http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux) step by step and also tried some things I read above in this thread but I still can't build and/or run my wxWidgets test app. Can someone help me?
Here is the build log:
-------------- Build: Release in Prueba2 ---------------
Compiling: Prueba2App.cpp
i586-mingw32msvc-g++: unrecognized option '-pthread'
In file included from /usr/include/wx-2.8/wx/platform.h:293,
from /usr/include/wx-2.8/wx/defs.h:21,
from /usr/include/wx-2.8/wx/event.h:15,
from /usr/include/wx-2.8/wx/app.h:20,
from /home/era506/Desktop/Prueba2/Prueba2App.h:13,
from /home/era506/Desktop/Prueba2/Prueba2App.cpp:10:
/usr/include/wx-2.8/wx/chkconf.h:1817:9: error: #error "wxClipboard requires wxDataObject"
In file included from /usr/include/wx-2.8/wx/event.h:15,
from /usr/include/wx-2.8/wx/app.h:20,
from /home/era506/Desktop/Prueba2/Prueba2App.h:13,
from /home/era506/Desktop/Prueba2/Prueba2App.cpp:10:
/usr/include/wx-2.8/wx/defs.h:2820: error: conflicting declaration ‘typedef struct GtkWidget* WXWidget’
/usr/include/wx-2.8/wx/defs.h:2611: error: ‘WXWidget’ has a previous declaration as ‘typedef void* WXWidget’
In file included from /usr/include/wx-2.8/wx/clntdata.h:17,
from /usr/include/wx-2.8/wx/event.h:18,
from /usr/include/wx-2.8/wx/app.h:20,
from /home/era506/Desktop/Prueba2/Prueba2App.h:13,
from /home/era506/Desktop/Prueba2/Prueba2App.cpp:10:
/usr/include/wx-2.8/wx/hashmap.h: In member function ‘wxLongToLongHashMap_wxImplementation_HashTable::Node** wxLongToLongHashMap_wxImplementation_HashTable::GetNodePtr(const long int&) const’:
/usr/include/wx-2.8/wx/hashmap.h:714: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /usr/include/wx-2.8/wx/event.h:18,
from /usr/include/wx-2.8/wx/app.h:20,
from /home/era506/Desktop/Prueba2/Prueba2App.h:13,
from /home/era506/Desktop/Prueba2/Prueba2App.cpp:10:
/usr/include/wx-2.8/wx/clntdata.h: In member function ‘wxShadowObjectMethods_wxImplementation_HashTable::Node** wxShadowObjectMethods_wxImplementation_HashTable::GetNodePtr(const wxString&) const’:
/usr/include/wx-2.8/wx/clntdata.h:20: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/clntdata.h: In member function ‘wxShadowObjectFields_wxImplementation_HashTable::Node** wxShadowObjectFields_wxImplementation_HashTable::GetNodePtr(const wxString&) const’:
/usr/include/wx-2.8/wx/clntdata.h:25: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /usr/include/wx-2.8/wx/event.h:21,
from /usr/include/wx-2.8/wx/app.h:20,
from /home/era506/Desktop/Prueba2/Prueba2App.h:13,
from /home/era506/Desktop/Prueba2/Prueba2App.cpp:10:
/usr/include/wx-2.8/wx/gdicmn.h: In member function ‘wxStringToColourHashMap_wxImplementation_HashTable::Node** wxStringToColourHashMap_wxImplementation_HashTable::GetNodePtr(const wxString&) const’:
/usr/include/wx-2.8/wx/gdicmn.h:544: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /usr/include/wx-2.8/wx/utils.h:21,
from /usr/include/wx-2.8/wx/cursor.h:41,
from /usr/include/wx-2.8/wx/event.h:22,
from /usr/include/wx-2.8/wx/app.h:20,
from /home/era506/Desktop/Prueba2/Prueba2App.h:13,
from /home/era506/Desktop/Prueba2/Prueba2App.cpp:10:
/usr/include/wx-2.8/wx/filefn.h: At global scope:
/usr/include/wx-2.8/wx/filefn.h:398: error: zero width for bit-field ‘wxAssert_399::BadFileSizeType’
In file included from /home/era506/Desktop/Prueba2/Prueba2App.cpp:14:
/usr/include/wx-2.8/wx/image.h: In member function ‘wxImageHistogramBase_wxImplementation_HashTable::Node** wxImageHistogramBase_wxImplementation_HashTable::GetNodePtr(const long unsigned int&) const’:
/usr/include/wx-2.8/wx/image.h:136: warning: dereferencing type-punned pointer will break strict-aliasing rules
Process terminated with status 1 (0 minutes, 2 seconds)
4 errors, 5 warnings
Wow! I'm an idiot!!! You were absolutely right!! I didn't read the part that says "belonging to the whole project have to be empty"!! :oops: After that I didn't get any errors but the proyect still didn't run, so I executed "wine Prueba.exe" from gnome-terminal and the following output showed:
era506@era506-desktop:~/Desktop/Prueba/bin$ wine Prueba.exe
err:module:import_dll Library mingwm10.dll (which is needed by L"Z:\\home\\era506\\Desktop\\Prueba\\bin\\Prueba.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\home\\era506\\Desktop\\Prueba\\bin\\Prueba.exe" failed, status c0000135
Then, I remembered reading something about mingwm10.dll on your howto, so I ungzipped the .dll from /usr/share/doc/mingw32-runtime/ to the Prueba.exe's directory and voilà! It worked!! I apollogize for not reading carefully!! :oops:
Thank you very much for your help!!!
hi, I'm having some trouble cross-compiling and am lost as to what step to take next in finding out how to make it work (not something that happens often). The basic "hello, world" console app compiles fine but I have a project that I've been working on that won't compile for windows and I have some general questions regarding the process,
my project uses libraries glfw, ftgw, and box2d. It doesn't seem the problem is in libraries though because the error messages have only to do with header files, like in this one example:
In file included from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/i586-mingw32msvc/bits/c++locale.h:49,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/iosfwd:45,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/bits/stl_algobase.h:70,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/memory:53,
from /usr/include/freetype2/../Source/Dynamics/b2Body.h:26,
from /usr/include/Box2D.h:41,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio: At global scope:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:171: error: ‘::vfscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:172: error: ‘::vscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:174: error: ‘::vsscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:182: error: ‘__gnu_cxx::vfscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:183: error: ‘__gnu_cxx::vscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:185: error: ‘__gnu_cxx::vsscanf’ has not been declared
the errors are coming from well-established files like cstdio, cwchar, and cstdlib, which leads me to believe that there are some odd #defines happening. as far as I know, there aren't any platform-specific #defines happening aside from the windows-type ones from this tutorial, as these libraries are multi-platform. do I have to compile a new, different set of libraries for these sub-systems, in order to successfully cross-compile a windows binary? I'll throw in the entire build log for good measure.
Compiling: main.cpp
In file included from /usr/include/freetype2/../Source/Collision/Shapes/../../Common/b2Math.h:25,
from /usr/include/freetype2/../Source/Collision/Shapes/b2Shape.h:22,
from /usr/include/freetype2/../Source/Collision/Shapes/b2CircleShape.h:22,
from /usr/include/Box2D.h:36,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:164: error: ‘::lldiv_t’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:170: error: ‘::_Exit’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:177: error: ‘::llabs’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:179: error: ‘lldiv_t’ does not name a type
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:183: error: ‘::lldiv’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:198: error: ‘::strtof’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:199: error: ‘::strtold’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:206: error: ‘__gnu_cxx::lldiv_t’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:208: error: ‘__gnu_cxx::_Exit’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:211: error: ‘__gnu_cxx::llabs’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:212: error: ‘__gnu_cxx::div’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:213: error: ‘__gnu_cxx::lldiv’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:216: error: ‘__gnu_cxx::strtof’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:219: error: ‘__gnu_cxx::strtold’ has not been declared
In file included from /usr/include/Box2D.h:39,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h: In member function ‘virtual void b2ContactListener::Add(const b2ContactPoint*)’:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h:95: warning: statement has no effect
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h: In member function ‘virtual void b2ContactListener::Persist(const b2ContactPoint*)’:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h:99: warning: statement has no effect
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h: In member function ‘virtual void b2ContactListener::Remove(const b2ContactPoint*)’:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h:103: warning: statement has no effect
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h: In member function ‘virtual void b2ContactListener::Result(const b2ContactResult*)’:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h:106: warning: statement has no effect
In file included from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/i586-mingw32msvc/bits/c++locale.h:49,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/iosfwd:45,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/bits/stl_algobase.h:70,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/memory:53,
from /usr/include/freetype2/../Source/Dynamics/b2Body.h:26,
from /usr/include/Box2D.h:41,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio: At global scope:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:171: error: ‘::vfscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:172: error: ‘::vscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:174: error: ‘::vsscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:182: error: ‘__gnu_cxx::vfscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:183: error: ‘__gnu_cxx::vscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:185: error: ‘__gnu_cxx::vsscanf’ has not been declared
In file included from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/bits/postypes.h:46,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/iosfwd:49,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/bits/stl_algobase.h:70,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/memory:53,
from /usr/include/freetype2/../Source/Dynamics/b2Body.h:26,
from /usr/include/Box2D.h:41,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:153: error: ‘::fwide’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:154: error: ‘::fwprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:155: error: ‘::fwscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:164: error: ‘::swprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:165: error: ‘::swscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:167: error: ‘::vfwprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:169: error: ‘::vfwscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:171: error: ‘::vswprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:173: error: ‘::vswscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:175: error: ‘::vwprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:177: error: ‘::vwscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:194: error: ‘::wcstof’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:205: error: ‘::wprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:206: error: ‘::wscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:253: error: ‘::wcstold’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:262: error: ‘::wcstoll’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:263: error: ‘::wcstoull’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:270: error: ‘__gnu_cxx::wcstold’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:271: error: ‘__gnu_cxx::wcstoll’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:272: error: ‘__gnu_cxx::wcstoull’ has not been declared
In file included from /home/dantarius/codeblocks/physics/main.cpp:12:
/home/dantarius/codeblocks/physics/camera.h: In function ‘void cameradragcb(int, int)’:
/home/dantarius/codeblocks/physics/camera.h:85: warning: unused variable ‘t’
In file included from /home/dantarius/codeblocks/physics/main.cpp:17:
/home/dantarius/codeblocks/physics/mainloop.h: In function ‘void mainloop()’:
/home/dantarius/codeblocks/physics/mainloop.h:52: warning: unused variable ‘t’
Process terminated with status 1 (0 minutes, 0 seconds)
40 errors, 6 warnings
command line:
i586-mingw32msvc-g++ -Wall -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -DSTRICT -DHAVE_W32API_H -D__WXMSW__ -D__WINDOWS__ -I/usr/include -I/usr/include/freetype2 -I/usr/include -I/usr/include/freetype2 -I/usr/i586-mingw32msvc/include -c /home/dantarius/codeblocks/physics/main.cpp -o .objs/main.o
thanks for any help in advance,
brad
->MortenMacFly
Sorry, this is build log :
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|66|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|89|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|53|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|34|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|34|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|34|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|34|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|30|first defined here|
obj/Release/main.o:/home/equipement/dev/test_libxml2/main.cpp|30|first defined here|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
||Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.data+0xec)||undefined reference to `_gzopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlWrapGzOpenUtf8]+0xf)||undefined reference to `_gzopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlWrapGzOpenUtf8]+0x6b)||undefined reference to `_gzdopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlInitPlatformSpecificIo]+0x75)||undefined reference to `_gzopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileOpen_real]+0x25)||undefined reference to `_gzdopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileOpenW]+0x42)||undefined reference to `_gzdopen'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileRead]+0x11)||undefined reference to `_gzread'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileWrite]+0x11)||undefined reference to `_gzwrite'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlGzfileClose]+0x7)||undefined reference to `_gzclose'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlFreeZMemBuff]+0x13)||undefined reference to `_deflateEnd'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlCreateZMemBuff]+0xa8)||undefined reference to `_deflateInit2_'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlCreateZMemBuff]+0x102)||undefined reference to `_crc32'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlZMemBuffAppend]+0x52)||undefined reference to `_deflate'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlZMemBuffAppend]+0x6b)||undefined reference to `_crc32'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlZMemBuffGetContent]+0x34)||undefined reference to `_deflate'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[___xmlParserInputBufferCreateFilename]+0xbd)||undefined reference to `_gzread'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[___xmlParserInputBufferCreateFilename]+0xe1)||undefined reference to `_gzrewind'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xmlIO.obj):../xmlIO.c:(.text[_xmlFreeHTTPWriteCtxt]+0x2d)||undefined reference to `_deflateEnd'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlIconvWrapper]+0x59)||undefined reference to `_libiconv'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlCharEncCloseFunc]+0x3f)||undefined reference to `_libiconv_close'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlCharEncCloseFunc]+0x5d)||undefined reference to `_libiconv_close'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlByteConsumed]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0xd2)||undefined reference to `_libiconv_open'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0xdf)||undefined reference to `_libiconv_open'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0xf8)||undefined reference to `_libiconv_open'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0x111)||undefined reference to `_libiconv_open'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0x137)||undefined reference to `_libiconv_close'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/encoding.obj):../encoding.c:(.text[_xmlFindCharEncodingHandler]+0x13d)||undefined reference to `_libiconv_close'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/valid.obj):../valid.c:(.text[_xmlValidBuildContentModel]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/valid.obj):../valid.c:(.text[_xmlValidateElementContent]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathFormatNumber]+0xa4)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathFormatNumber]+0x1a4)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathIsPositionalPredicate]+0x3c)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathFloorFunction]+0x6a)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/xpath.obj):../xpath.c:(.text[_xmlXPathCeilingFunction]+0x6e)||undefined reference to `__ftol2'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanohttp.obj):../nanohttp.c:(.text[_xmlNanoHTTPFreeCtxt]+0xcb)||undefined reference to `_inflateEnd'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanohttp.obj):../nanohttp.c:(.text[_xmlNanoHTTPReadLine]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanohttp.obj):../nanohttp.c:(.text[_xmlNanoHTTPScanAnswer]+0x449)||undefined reference to `_inflateInit2_'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanohttp.obj):../nanohttp.c:(.text[_xmlNanoHTTPRead]+0x97)||undefined reference to `_inflate'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanoftp.obj):../nanoftp.c:(.text[_xmlNanoFTPList]+0x6)||undefined reference to `__chkstk'|
/usr/i586-mingw32msvc/lib/libxml2.a(int.a.msvc/nanoftp.obj):../nanoftp.c:(.text[_xmlNanoFTPGet]+0x6)||undefined reference to `__chkstk'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 36 warnings ===|
-> rcoll
My program work fine under linux, with gcc and distrib libxml2-2.7.5 package -> Ok
I also want to build a windows version, also under linux, using mingw and libxml2-2.7.6.win32 binaries (/usr/i586-mingw32msvc/lib/libxml2_a.lib and /usr/i586-mingw32msvc/include/libxml/lots-of-.h-files ) -> there is the problem...
I'v also tried to compile libxml with mingw but not successfully...
-----Edit...
Execution is ok if I put libxml2.dll into the program folder without any libs or .h with libxml2_a.lib (witch is renamed libxml2.a) and includes files in /usr/i586-mingw32msvc/.
But I want only one static file ! Can you tell me how can I do this ?
Thanks !
Hi guys!
I have tried to follow the guide http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux (http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux) doing it multiple times over. I don't think I've missed anything. I created a new wxWidget project in C::B and have done nothing to it, except whats in the guide. When I compile the Debug/Release targets (for Linux) it compiles and runs fine, but my "WinRelease" - target generates the following build error:
/home/christoffer/Projekt/wxLinux/wxLinuxApp.h|13|fel: wx/app.h: Filen eller katalogen finns inte|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|14|fel: wx/menu.h: Filen eller katalogen finns inte|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|15|fel: wx/statusbr.h: Filen eller katalogen finns inte|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|16|fel: wx/frame.h: Filen eller katalogen finns inte|
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp|14|fel: wx/image.h: Filen eller katalogen finns inte|
/home/christoffer/Projekt/wxLinux/wxLinuxApp.h|16|error: expected class-name before ‘{’ token|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|20|error: expected class-name before ‘{’ token|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|23|error: expected `)' before ‘*’ token|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|29|error: ‘wxCommandEvent’ has not been declared|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|30|error: ‘wxCommandEvent’ has not been declared|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|40|error: ISO C++ forbids declaration of ‘wxStatusBar’ with no type|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|40|error: expected ‘;’ before ‘*’ token|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|43|error: ISO C++ forbids declaration of ‘DECLARE_EVENT_TABLE’ with no type|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|44|error: expected ‘;’ before ‘}’ token|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|44|error: expected `;' before ‘}’ token|
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp|17|error: expected constructor, destructor, or type conversion before ‘;’ token|
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp||In member function ‘virtual bool wxLinuxApp::OnInit()’:|
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp|23|error: ‘wxInitAllImageHandlers’ was not declared in this scope|
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp|26|error: no matching function for call to ‘wxLinuxFrame::wxLinuxFrame(int)’|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|20|note: candidates are: wxLinuxFrame::wxLinuxFrame()|
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h|20|note: wxLinuxFrame::wxLinuxFrame(const wxLinuxFrame&)|
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp|27|error: ‘class wxLinuxFrame’ has no member named ‘Show’|
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp|28|error: ‘SetTopWindow’ was not declared in this scope|
||=== Build finished: 20 errors, 0 warnings ===|
"Filen eller katalogen finns inte" means "File or folder doesnt exist".
Im using Ubuntu 11.10, C::B 10.05, wxMSW-2.8.12 (wxWidget) and mingw32 is latest (from apt-get).
I've searched the forum the best I could but I'm new to this, and Linux in general...
EDIT:
When i execute wx-config --list i get:
Default config is gtk2-unicode-release-2.8
Default config will be used for output
Alternate matches:
base-unicode-release-2.8
But when i execute /usr/i586-mingw32msvc/lib/wx/config/i586-mingw32msvc-msw-unicode-release-static-2.8 --list i get
Default config is i586-mingw32msvc-msw-unicode-release-static-2.8
Default config will be used for output
Also available in /usr/i586-mingw32msvc:
i586-mingw32msvc-msw-unicode-static-2.9
Always the full build log, please...
Rgr.
-------------- Build: WinRelease in wxLinux ---------------
Linking executable: bin/Release/wxLinux.exe
obj/Release/wxLinuxApp.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
This is not the full log.
See here for details: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
OK.
-------------- Build: WinRelease in wxLinux ---------------
i586-mingw32msvc-g++ -L/usr/i586-mingw32msvc/lib/ -L/usr/i586-mingw32msvc/lib -o bin/Release/wxLinux.exe obj/Release/wxLinuxApp.o obj/Release/wxLinuxMain.o -s -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lodbc32 -lwsock32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid
obj/Release/wxLinuxApp.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
I uninstalled mingw32 and sudo apt-get install'ed it again, did a clean and a rebuild the project and this is what i got:
-------------- Clean: WinRelease in wxLinux ---------------
Cleaned "wxLinux - WinRelease"
-------------- Build: WinRelease in wxLinux ---------------
i586-mingw32msvc-g++ -Wall -O2 -I/usr/i586-mingw32msvc/include -I/usr/i586-mingw32msvc/include -c /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp -o obj/Release/wxLinuxApp.o
I fil inkluderad från /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:10:
/home/christoffer/Projekt/wxLinux/wxLinuxApp.h:13:20: fel: wx/app.h: Filen eller katalogen finns inte
I fil inkluderad från /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:13:
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:14:21: fel: wx/menu.h: Filen eller katalogen finns inte
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:15:25: fel: wx/statusbr.h: Filen eller katalogen finns inte
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:16:22: fel: wx/frame.h: Filen eller katalogen finns inte
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:14:22: fel: wx/image.h: Filen eller katalogen finns inte
In file included from /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:10:
/home/christoffer/Projekt/wxLinux/wxLinuxApp.h:16: error: expected class-name before ‘{’ token
In file included from /home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:13:
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:20: error: expected class-name before ‘{’ token
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:23: error: expected `)' before ‘*’ token
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:29: error: ‘wxCommandEvent’ has not been declared
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:30: error: ‘wxCommandEvent’ has not been declared
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:40: error: ISO C++ forbids declaration of ‘wxStatusBar’ with no type
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:40: error: expected ‘;’ before ‘*’ token
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:43: error: ISO C++ forbids declaration of ‘DECLARE_EVENT_TABLE’ with no type
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:44: error: expected ‘;’ before ‘}’ token
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:44: error: expected `;' before ‘}’ token
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:17: error: expected constructor, destructor, or type conversion before ‘;’ token
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp: In member function ‘virtual bool wxLinuxApp::OnInit()’:
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:23: error: ‘wxInitAllImageHandlers’ was not declared in this scope
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:26: error: no matching function for call to ‘wxLinuxFrame::wxLinuxFrame(int)’
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:20: note: candidates are: wxLinuxFrame::wxLinuxFrame()
/home/christoffer/Projekt/wxLinux/wxLinuxMain.h:20: note: wxLinuxFrame::wxLinuxFrame(const wxLinuxFrame&)
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:27: error: ‘class wxLinuxFrame’ has no member named ‘Show’
/home/christoffer/Projekt/wxLinux/wxLinuxApp.cpp:28: error: ‘SetTopWindow’ was not declared in this scope
Process terminated with status 1 (0 minutes, 0 seconds)
20 errors, 0 warnings
Thank you for your quick response!
Thank you very much for this review! It works fine but debuging...
More precisely:
My system is ubuntu. The goal is to compile dll as a plugin for some windows application.
Following the instructions I was able to compile, link and to begin debugging. For debugging mingw32-gdb.exe under wine was used.
The C::B was able to put breakpoint but when the programm stops I have the following error in the debugger window: "The program has stopped on a breakpoint but the breakpoint format is not recognized".
In the source code (http://fossies.org/dox/codeblocks-10.05-src/gdb__driver_8cpp_source.html) I found that this error message appears when the result output doesn't coincide with regexp either reBreak or reBreak_or32 (*). Manually I would say that this string should coincide with reBreak_or32 and, so, there is two cases why the error appears 1) somehow reBreak instead of reBreak_or32 is applied (I tried to change development flower in the C::B settings to 'or32' but nothing changed) 2) there are some invisible symbols which don't coincide with regexp
1) The further way of searching for the solution is to rebuild debuggergdb but how can I rebuild only that module and where should I put the rebuilt module?
2) What else can I do to make the debugger working?
(*) To the developers of debuggergdb, Just a curiosity:
Why you use this kind of code
43 #ifdef __WXMSW__
44 static wxRegEx reBreak(_T("([A-Za-z]*[:]*)([^:]+):([0-9]+):[0-9]+:[begmidl]+:(0x[0-9A-Fa-f]+)"));
45 static wxRegEx reBreak_or32(_T("\032\032([A-Za-z]:)([^:]+):([0-9]+):[0-9]+:[begmidl]+:(0x[0-9A-z]+)"));
46 #else
47 static wxRegEx reBreak(_T("\032\032([^:]+):([0-9]+):[0-9]+:[begmidl]+:(0x[0-9A-Fa-f]+)"));
48 static wxRegEx reBreak_or32(_T("")); // not used on linux, but make sure it exists otherwise compilation fails on linux (if (platform::windows) blabla)
49 #endif
and then trying to select the right version of reBreak or reBreake_or32 while it is mush more understandable to use one regex like this
static wxRegEx reBreak(_T("\{\032\032\}?(\{[A-Za-z]*[:]*\}?)([^:]+):([0-9]+):[0-9]+:[begmidl]+:(0x[0-9A-Fa-f]+)"));
The performance here seems to be not so much important...
If you're on a current machine the rebuild will take around 10 minutes and you would have finished with it.
checkout lastest svn version
./bootstrap
./configure --prefix=full_path_to_install --with-contrib-plugins=all
make jN && make install
If you don't want to build contrib plugins you can skip the last part of the configure command, then it will be even faster.