Need help with Cross-Compiling Under Linux Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
boxcarmib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Nov 10, 2005 6:53 pm

Need help with Cross-Compiling Under Linux

Post by boxcarmib »

Followed the directions at:

http://www.wxwidgets.org/wiki/index.php ... nder_Linux

the first thing it says to do is install the Mingw Cross-Compiler with directions supplied at:

http://www.wxwidgets.org/wiki/index.php ... s-Compiler

Which i did with an

apt-get install mingw32 mingw32-binutils mingw32-runtime

I downloaded the wxWidgets source 2.6.3 ( complete package ) and configured as directed by the wiki with:

./configure --prefix=/usr/local/i386-mingw32 --build=i386-mingw32 --target=i386-mingw32 --with-msw

configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-mingw32
checking target system type... i386-pc-mingw32
loading argument cache configarg.cache
checking for --enable-gui... yes

...

checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
configure: error: please set CFLAGS to contain the location of windows.h


So it craps out with the configure error.
Can anyone tell me what I'm doing wrong?
protocol
Moderator
Moderator
Posts: 680
Joined: Wed Jan 18, 2006 6:13 pm
Location: Dallas, TX
Contact:

Post by protocol »

I think you need to set your CFLAGS environmental variable to the dir of windows.h

type `./configure --help` to get a better idea.
/* UIKit && wxWidgets 2.8 && Cocoa && .Net */
QuRegExmm
wxPCRE & ObjPCRE - Regex It!
boxcarmib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Nov 10, 2005 6:53 pm

Post by boxcarmib »

identified the windows.h files available on my system with:

locate windows.h

this returned:

/usr/i586-mingw32msvc/include/windows.h
/usr/include/directfb-internal/core/windows.h
/usr/share/doc/apache2-doc/manual/platform/windows.html
/usr/share/doc/apache2-doc/manual/platform/windows.html.en
/usr/share/doc/apache2-doc/manual/platform/windows.html.ko.euc-kr
/usr/share/doc/libgtk2.0-doc/gtk/gtk-windows.html
/usr/share/doc/libsasl2/windows.html
/usr/share/doc/python/faq/windows.html

I presumed the windows.h file configure was interested in would be the first one, so I set CFLAGS to it with:

ivor:~/wxWidgets-2.6.3# CFLAGS=/usr/i586-mingw32msvc/include/

Checked it with:

ivor:~/wxWidgets-2.6.3# echo $CFLAGS
/usr/i586-mingw32msvc/include/

Ran configure again with:

ivor:~/wxWidgets-2.6.3# ./configure --prefix=/usr/local/i386-mingw32 --host=i386-mingw32 --target=i386-mingw32 --with-msw
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-mingw32
checking target system type... i386-pc-mingw32
loading argument cache configarg.cache
checking for --enable-gui... yes
checking for --enable-monolithic... no
...
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
configure: error: please set CFLAGS to contain the location of windows.h


So it crapped out with the same error.
protocol
Moderator
Moderator
Posts: 680
Joined: Wed Jan 18, 2006 6:13 pm
Location: Dallas, TX
Contact:

Post by protocol »

add `CFLAGS=/usr/i586-mingw32msvc/include/` to the commad line

should be
I wrote: `./configure --prefix=/usr/local/i386-mingw32 --host=i386-mingw32 --target=i386-mingw32 --with-msw CFLAGS=/usr/i586-mingw32msvc/include/`
That should do it.

Let me know, because cross-compiling is my next step.
/* UIKit && wxWidgets 2.8 && Cocoa && .Net */
QuRegExmm
wxPCRE & ObjPCRE - Regex It!
boxcarmib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Nov 10, 2005 6:53 pm

Post by boxcarmib »

Still no luck.....

ivor:~/wxGTK-2.6.2# ./configure --prefix=/usr/local/i386-mingw32 --host=i386-mingw32 --target=i386-mingw32 --with-msw CFLAGS=/usr/i586-mingw32msvc/include
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-mingw32
checking target system type... i386-pc-mingw32
loading argument cache configarg.cache
checking for --enable-gui... yes
checking for --enable-monolithic... no
...
checking for --enable-official_build... no
saving argument cache configarg.cache
checking for toolkit... msw
checking for i386-mingw32-gcc... no
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.


config.log is a beeeeeg file with lots of info, but nothing that seems very enlightening.
protocol
Moderator
Moderator
Posts: 680
Joined: Wed Jan 18, 2006 6:13 pm
Location: Dallas, TX
Contact:

Post by protocol »

upgrade your version of gcc.
/* UIKit && wxWidgets 2.8 && Cocoa && .Net */
QuRegExmm
wxPCRE & ObjPCRE - Regex It!
boxcarmib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Nov 10, 2005 6:53 pm

Post by boxcarmib »

no difference after upgrading gcc to 4.1
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart »

Hi,
checking for C compiler default output file name... configure: error: C compiler cannot create executables
You don't say what linux distro you're using, but this (rather unhelpful) error message seems to mean that something isn't installed, or not installed properly. See the recent thread http://forums.wxwidgets.org/viewtopic.php?t=7433, starting with the fourth post.

If you google for this error message plus your distro's name, you should find various solutions suggested.

Regards,

David
boxcarmib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Nov 10, 2005 6:53 pm

Post by boxcarmib »

My distro: debian etch testing

I falsely reported that there was no difference with gcc 4.1 ... i installed 4.1 but the debian pkg did not update the links. So running:

ivor:~/wxWidgets-2.6.3/build# ../configure --prefix=/usr/local/i386-mingw32 --host=i386-mingw32 --target=i386-mingw32 CFLAGS=/usr/i586-mingw32msvc/include/

yields the following....


configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... i386-pc-mingw32
checking target system type... i386-pc-mingw32
loading argument cache configarg.cache
checking for --enable-gui... yes
checking for --enable-monolithic... no
checking for --enable-plugins... no

....

checking if va_list can be copied by value... yes
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGE_FILES value needed for large files... no
checking if large file support is available... no
checking whether byte ordering is bigendian... unknown
configure: WARNING: Assuming little-endian target machine - this may be overriden by adding the line "ac_cv_c_bigendian=unknown" to config.cache file
checking how to run the C++ preprocessor... g++ -E
checking iostream usability... no
checking iostream presence... yes
configure: WARNING: iostream: present but cannot be compiled
configure: WARNING: iostream: check for missing prerequisite headers?
configure: WARNING: iostream: see the Autoconf documentation
configure: WARNING: iostream: section "Present But Cannot Be Compiled"
configure: WARNING: iostream: proceeding with the preprocessor's result
configure: WARNING: iostream: in the future, the compiler will take precedence
configure: WARNING: ## ----------------------------------------- ##
configure: WARNING: ## Report this to [email protected] ##
configure: WARNING: ## ----------------------------------------- ##
checking for iostream... yes
checking if C++ compiler supports bool... no
checking if C++ compiler supports the explicit keyword... no
checking whether the compiler supports const_cast<>... no
checking whether the compiler supports reinterpret_cast<>... no
checking whether the compiler supports static_cast<>... no
checking for libraries directory... lib
checking regex.h usability... no
checking regex.h presence... yes
configure: WARNING: regex.h: present but cannot be compiled
configure: WARNING: regex.h: check for missing prerequisite headers?
configure: WARNING: regex.h: see the Autoconf documentation
configure: WARNING: regex.h: section "Present But Cannot Be Compiled"
configure: WARNING: regex.h: proceeding with the preprocessor's result
configure: WARNING: regex.h: in the future, the compiler will take precedence
configure: WARNING: ## ----------------------------------------- ##
configure: WARNING: ## Report this to [email protected] ##
configure: WARNING: ## ----------------------------------------- ##
checking for regex.h... yes
checking for regcomp... no
checking for re_search... no
configure: WARNING: system regex library not found, will use built-in instead
checking for zlib.h >= 1.1.4...
checking zlib.h usability... no
checking zlib.h presence... yes
configure: WARNING: zlib.h: present but cannot be compiled
configure: WARNING: zlib.h: check for missing prerequisite headers?
configure: WARNING: zlib.h: see the Autoconf documentation
configure: WARNING: zlib.h: section "Present But Cannot Be Compiled"
configure: WARNING: zlib.h: proceeding with the preprocessor's result
configure: WARNING: zlib.h: in the future, the compiler will take precedence
configure: WARNING: ## ----------------------------------------- ##
configure: WARNING: ## Report this to [email protected] ##
configure: WARNING: ## ----------------------------------------- ##
checking for zlib.h... yes
checking for deflate in -lz... no
configure: WARNING: zlib library not found or too old, will use built-in instead
checking for png.h > 0.90...
checking png.h usability... no
checking png.h presence... yes
configure: WARNING: png.h: present but cannot be compiled
configure: WARNING: png.h: check for missing prerequisite headers?
configure: WARNING: png.h: see the Autoconf documentation
configure: WARNING: png.h: section "Present But Cannot Be Compiled"
configure: WARNING: png.h: proceeding with the preprocessor's result
configure: WARNING: png.h: in the future, the compiler will take precedence
configure: WARNING: ## ----------------------------------------- ##
configure: WARNING: ## Report this to [email protected] ##
configure: WARNING: ## ----------------------------------------- ##
checking for png.h... yes
checking for png_check_sig in -lpng... no
configure: WARNING: system png library not found or too old, will use built-in instead
checking for jpeglib.h... no
configure: WARNING: system jpeg library not found, will use built-in instead
checking tiffio.h usability... no
checking tiffio.h presence... no
checking for tiffio.h... no
configure: WARNING: system tiff library not found, will use built-in instead
configure: WARNING: wxWidgets requires wchar_t to use expat, disabling
configure: WARNING: wxWidgets requires wchar_t to use xml, disabling
checking mspack.h usability... no
checking mspack.h presence... no
checking for mspack.h... no
checking w32api.h usability... no
checking w32api.h presence... no
checking for w32api.h... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
configure: error: please set CFLAGS to contain the location of windows.h

it just seems to have gone from bad to worse. <sigh>
any suggestions?
boxcarmib
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Nov 10, 2005 6:53 pm

Post by boxcarmib »

Well obviously this once can't be solved. I've moved on to just developing the xp app on a windows machine.
nametable7
In need of some credit
In need of some credit
Posts: 2
Joined: Tue Oct 03, 2017 7:04 pm

Re: Need help with Cross-Compiling Under Linux

Post by nametable7 »

It is important in the CFLAGS variable to use the "-I" option. The -I option includes that directory in the compiler's search path.

Like this:

./configure --prefix=/usr/local/i386-mingw32 --host=i386-mingw32 --target=i386-mingw32 CFLAGS=-I/usr/i586-mingw32msvc/include/
Post Reply