LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-04-2008, 04:00 AM   #1
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 218

Rep: Reputation: 32
Can I use gcc for windows to compile a program for Linux??


Hello,

Can I use gcc for windows to compile a program for Linux??
Well, I suppose that it is a easy question, but I can not find the answer.

Best regards
 
Old 11-04-2008, 04:31 AM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
It's a bit complicated; you will need to set up a cross-compiler and if you're going to build executable programs (other than a kernel) you will also need to install headers for the libraries you will use. One disadvantage is that you can't even run the program until you copy it to the Linux machine.
 
Old 11-04-2008, 04:54 AM   #3
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
There is this for cross compiling for Linux using Cygwin, but it's a rather old version of GCC:
http://metamod-p.sourceforge.net/cro...for.linux.html
Easier than building your own though. If you want to do that, see here:
http://www.kegel.com/crosstool/

Last edited by brianL; 11-04-2008 at 04:56 AM.
 
Old 11-04-2008, 05:13 AM   #4
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
Download qemu for windows and install a small distro with gcc.
 
Old 11-04-2008, 05:47 AM   #5
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
Or try coLinux:
http://colinux.wikia.com/wiki/Main_Page
 
Old 11-04-2008, 06:18 AM   #6
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 218

Original Poster
Rep: Reputation: 32
Thanks a lot for all information.

Best ragards
 
Old 11-04-2008, 07:16 AM   #7
Ranguvar
Member
 
Registered: Oct 2008
Location: Upstate NY
Distribution: Arch Linux
Posts: 99

Rep: Reputation: 17
MinGW and Msys
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Compile (gcc) icons (png) into a program MiniMe001 Programming 6 04-05-2008 11:17 AM
AMD gcc compile program to INTEL myrmidon Programming 2 09-14-2007 11:13 PM
How to compile C program using the OSSP mm library and gcc? seleria Linux - Software 0 11-06-2006 04:08 AM
Can't compile c++ program using gcc pengu Programming 9 02-22-2006 02:59 PM
Compile linux program for windows Mor_Petrus Programming 3 04-08-2003 12:11 PM


All times are GMT -5. The time now is 05:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration