LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-12-2009, 05:20 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 49
Cross-compiling v/s cross-building


I understand the meaning of Cross-compiling as explained here. But what do we mean when we say cross-building? Are those two different terms? Or one is a subset of other or something like that?

Thank you.
 
Old 05-12-2009, 05:43 PM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by kushalkoolwal View Post
I understand the meaning of Cross-compiling as explained here. But what do we mean when we say cross-building? Are those two different terms? Or one is a subset of other or something like that?

Thank you.
Yes, you have to first build your cross-tools, so, I guess, this is what they call cross-building.

For example, I recently built cross-gcc to produce executables for Windows under Linux, then I used the cross-gcc under Linux (i.e. cross-compiled) to produce an executable for Windows.
 
Old 05-12-2009, 06:01 PM   #3
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by Sergei Steshenko View Post
Yes, you have to first build your cross-tools, so, I guess, this is what they call cross-building.

For example, I recently built cross-gcc to produce executables for Windows under Linux, then I used the cross-gcc under Linux (i.e. cross-compiled) to produce an executable for Windows.

Thanks Sergei. I think I am beginning to understand the difference. So basically before you can do cross-compiling you need build a cross-tool which will do your cross-compiling, right?

On a side note, if it is OK with you can you point out the guide which you followed to produce Windows executable under Linux?
 
Old 05-13-2009, 05:49 AM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by kushalkoolwal View Post
...
On a side note, if it is OK with you can you point out the guide which you followed to produce Windows executable under Linux?


http://www.profv.de/programme/ ->
http://www.profv.de/mingw_cross_env/ ->
http://www.profv.de/mingw_cross_env/README.html .

Download and build (after reading the above) - just

make gcc

after editing Makefile. You may build much more than just 'gcc'.

Then you build essentially the same way as for Linux, just using the full path to cross compiler, e.g.

~/mingwi686/bin/i686-mingw32msvc-gcc hello.c -o hello.exe
.

You can first try under 'wine':

wine hello.exe
.

I've been dealing so far with non-GUI Windows apps, but there are examples of GUI ones too.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
building cross compiler, having issues moonlightcheese *BSD 1 09-13-2008 02:09 AM
A question on building a cross platform VPN server depam Linux - Software 2 03-26-2006 07:45 PM
Building cross-compiling toolchain radhapriya Linux - Software 1 06-25-2004 12:01 AM
Cross-Building Slackware as a whole? gargamel Slackware - Installation 2 05-09-2004 06:31 PM
Building an ARM7 cross compiler from gcc Charlie_B Linux - Software 2 08-20-2003 08:59 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration