Author Topic: Howto - Cross Compiling in Linux using MingW32  (Read 560884 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #45 on: August 16, 2008, 01:16:33 pm »
... it can be because my system is not Debian, but Debian-based (Ubuntu).

I just did a quick diff between hardys and feistys contents and the contents of the debian packages (all from apt.wxwidgets.org), but there seem to be no differences in directory-structure, the only differences are in examples and some python-wx packages.

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #46 on: August 16, 2008, 02:31:29 pm »
I give another try to your binaries. This time I set:

Compiler settings -> Other options
Code
`wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static` -U__WXGTK__  -U__WXGTK20__

Linker Settings -> Other options
Code
`wx-config --prefix=/usr/i586-mingw32msvc --host=i586-mingw32msvc --static`

Search directories->Compiler and ->Linker:
Code
/usr/i586-mingw32msvc/include/wx-2.8

I also have to modify /usr/include/wx-2.8/wx/platform.h line 196 from this:
Code
#include "wx/setup.h"
to this:
Code
#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:
Code
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]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #47 on: August 16, 2008, 03:10:40 pm »
The first (and major error):
Quote
    * 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).

    Do the same for Linker Settings -> Other options.

    * To make it clear the Other options-tabs of the Compiler settings and Linker settings belonging to the whole project have to be empty (or only include settings that are valid for the Linux and the MS Windows targets).

(quote  from:http://wiki.codeblocks.org/index.php?title=Cross_Compiling_wxWidgets_Applications_on_Linux#Fixing_build_options)

The second error:
you missed the "--cflags" for compiler-settings and the "--libs" for linker settings from your "wx-config"-line.

see screenshot in the wiki:


If these errors are corrected I can build the project without errors.

I think, I will include the full line for wx-config in the wiki (not only the screenshots) to make it a little bit more clear.

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #48 on: August 16, 2008, 05:13:34 pm »
The first error:
My global Compiler settings -> Other options and Settings -> Other options are empty so I have nothing to "move" as you write in your wiki-article, so thats the reason that I have no `wx-config --cflags` on my project build options.

The second error:
For the cross-compiler target, I haven't noticed the images in the wiki (so little) and I use the text only, so that's my fault.

I've just set the right options "--cflags" and "--libs" but I obtain the same as before:
-If I don't modify "platform.h": error: wxClipboard requires wxDataObject.
-If I don't add -U__WXGTK__ to project's Compiler settings->Other options: /usr/include/wx-2.8/wx/defs.h | 2820 | error: conflicting declaration ‘typedef struct GtkWidget* WXWidget’.
-If I add it: ld | | cannot find -lwx_gtk2u_richtext-2.8.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #49 on: August 16, 2008, 06:09:12 pm »
The first error:
My global Compiler settings -> Other options and Settings -> Other options are empty so I have nothing to "move" as you write in your wiki-article, so thats the reason that I have no `wx-config --cflags` on my project build options.

Here again: 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).

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #50 on: August 16, 2008, 07:05:28 pm »
Sorry. It's the first time I read about global settings in the project.  :oops: Just now I only know settings of the targets.

Thank you for your effort. Now it works.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #51 on: August 16, 2008, 07:12:55 pm »
Sorry. It's the first time I read about global settings in the project.  :oops: Just now I only know settings of the targets.

Thank you for your effort. Now it works.
Nice to hear.

I think the expression "Global settings of the project" can be misleading.
I will think about a better phrase for it.

Offline Ganbito

  • Multiple posting newcomer
  • *
  • Posts: 79
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #52 on: August 24, 2008, 11:43:37 am »
From jens' wiki-article:
Quote
Until now I haven't been able to make a cross-compiled program run on MS Windows if I did not use the static libraries.

I can!!!

I build my sample application with shared wxMSW (from your repository) and I test it on 64bit Windows Vista (I have no XP available today, perhaps tomorrow...). It start to ask for some (two for the sample) .dll's that can be found in /usr/i586-mingw32msvc/lib, I put them in the same directory of my .exe and it works.

As you build wxMSW with multiple .dll's, depending on the application, the application will require different .dll's, making it bad to distribute so I try building an monolithic library adding --enable-monolithic to my ./configure command. As it was a test I installed this monolithic version of the default location /usr/local/for not corrupting your wxMSW if it don't work. Then I build my sample project with this shared library and get the .dll from /usr/local/lib and it works right on my 64bit Vista with the advantage of one .dll needed for all the cases.

era506

  • Guest
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #53 on: September 24, 2008, 02:10:42 am »
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 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:

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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #54 on: September 24, 2008, 07:13:45 am »
I've followed the wiki howto 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.

You did not follow my howto step by step, because you are still using linux parameters for cross-compiling, that can't work.

Read this carefully.

Please post the full commandline next time.
How to turn on full comandline logging:
Change "Settings -> Compiler and debugger... -> Global compiler settings -> Other settings(rightmost tab) -> Compiler logging" to "Full commandline".

era506

  • Guest
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #55 on: September 24, 2008, 07:36:54 am »
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:

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

pianoplayer326

  • Guest
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #56 on: January 04, 2009, 02:59:50 am »
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:

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

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

Code
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

« Last Edit: January 04, 2009, 03:09:36 am by pianoplayer326 »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #57 on: January 04, 2009, 03:25:43 am »
Code
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

Remove -I/usr/include -I/usr/include/freetype2 -I/usr/include -I/usr/include/freetype2 from Compiler options. I'm quite sure that they contain header meant to be used in Linux.  :)
Be a part of the solution, not a part of the problem.

pianoplayer326

  • Guest
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #58 on: January 04, 2009, 05:18:05 am »
I removed the original include directories and manually copied the sub-system headers I needed into the mingw-include area.  the header errors are gone!  for now.. but now I'm getting some other errors (undefined references) so I'll fiddle around with my libraries for a while.  I hope I don't have to compile an entirely different set for windows!  If that's what it takes, though, it'd still be worth it... tomorrow, lol.  if anyone still has ideas though I'm all ears.  Thanks for the tip Biplab!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Howto - Cross Compiling in Linux using MingW32
« Reply #59 on: January 04, 2009, 11:16:31 am »
I removed the original include directories and manually copied the sub-system headers I needed into the mingw-include area.  the header errors are gone!  for now.. but now I'm getting some other errors (undefined references) so I'll fiddle around with my libraries for a while.  I hope I don't have to compile an entirely different set for windows!  If that's what it takes, though, it'd still be worth it... tomorrow, lol.  if anyone still has ideas though I'm all ears.  Thanks for the tip Biplab!

You can not use the same library for linux and windows builds.
the linux libs are under "/usr/lib[32|64]/" or "/usr/local/lib[32|64]", the windows libs under "/usr/i586-mingw32msvc/lib".

That a library is a cross-platform only means that the sources can be compiled on different platforms, the binaries are different.