User forums > Using Code::Blocks

Howto - Cross Compiling in Linux using MingW32

<< < (7/25) > >>

Ganbito:
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:


--- Code: ---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)

--- End code ---

And, obviously, if I try to continue debuging (Next Instruction, Step into...) I obtain an error:

--- Code: ---Continuing...
The program is not being run.
Debugger finished with status 1

--- End code ---

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

Jenna:
Have you read my wiki-article: http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux ?

There you can also find some thoughts about debugging windows-applications from within C::B compiled for linux.

Ganbito:
Well, I have followed all the links I found about it (in this forum, in codeblocks wiki and in wxWidgets wiki) but I miss yours. :oops:

So I go and try it just now. Also I found some problems with the wxWidgets for MSW (with the repository of http://apt.wxwidgets.org/ and build from source), so let's try you wiki!!! :)

P.D.: And my nightly comes from your repository, so thank you for all. :wink:

Ganbito:
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
--- Code: -----prefix=/usr/i586-mingw32msvc
--- End code ---
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):

--- Code: ---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:

--- End code ---

With only this little inconvenient, I can say that this howto is well superceded by your wiki-article. Thank you ;)

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

--- Code: ---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).

--- End code ---

`wx-config --cflags`??? I didn't have that.


--- Code: ---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.

--- End code ---

If I understand you, I have to go to the Build options of WinRelease-target and then to Compiler settings -> Other options and add:

--- Code: ---`wx-config --host=i586-mingw32msvc --static --prefix=/usr/i586-mingw32msvc`
--- End code ---

If I do that I get this Build Messages:

--- Code: ---/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 ===|

--- End code ---

Firstly, I understand you that I have to put to Compiler settings -> Other options:

--- Code: -----host=i586-mingw32msvc --static --prefix=/usr/i586-mingw32msvc
--- End code ---
but I obtain in the Build log:

--- Code: ---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

--- End code ---
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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version