Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 10-09-2004, 06:56 PM   #1
LQ Newbie
Registered: Oct 2004
Posts: 1

Rep: Reputation: 0
cross compiling with g++

I have recently become desperate to do some coding, but I am currently broke, so I can't afford to purchase a compiler. I tried to install Mandrake 9.2 as a secondary OS, but odd things happened during install that make no sense. I have used this distribution on other systems with no problems before. Anyways, I've given up on linux until I can piece together a system tailored for the purpose. In the mean time, I am running CygWin on my Winblows 95 machine. Within this nice little software playpen, I am running gcc 3.3.3 cigwin version. Making console programs is nifty and all, but I have run across this GREAT looking cross-platform game library called clanlib that I can't wait to mess around with. Unfortunately, I am stuck in my little cygwin playpen. What I really want to do until I get linux is make windows programs, not just cygwin programs. Now from all that I've read about gcc, it seems to be quite capable of doing what I am proposing. I just can't seem to figure out how. I want to be able to run the finished executable without needing cygwin around. Is this possible? How? Thanks in advance.

Old 10-09-2004, 11:08 PM   #2
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
Yes and there are a couple different ways to go about it. For Win32 console applications you could use DJGPP or Mingw. With DJGPP there is an added advantage of being able to run the app in real mode DOS using the cwsdpmi.exe DPMI, if you wanted to. Both compilers are free, intended to be ran under Windows and based off GNU gcc. They also do not require any DLLs like Cygwin does. You can also set up cross compilers in a Linux environment to compile executables for Windows using them, as well as Cygwin. I believe Microsoft still offers are a free native Windows compiler for download as well, MSVC? If you mean GUI applications, then you're probably going to limited as far as a free compiler goes. I "think" QT may work in some situations, but I'm not sure. I believe DJGPP also has some graphics support.

Here are some links for you:

Last edited by DaHammer; 10-09-2004 at 11:20 PM.
Old 10-09-2004, 11:29 PM   #3
Registered: Oct 2003
Location: Planet Earth
Distribution: Slackware, LFS
Posts: 561

Rep: Reputation: 30
BTW, in my opinion Slackware is well suited for setting up cross-compilers if you decide to give linux another go. I have mingw, djgpp, cygwin, and uclibc cross compilers setup under Slackware 10 using various versions of GNU gcc. Most were rather simple to setup and work rather well. To me Slackware in general just works much smoother with vanilla sources as GNU gcc, without running into all the common problems that sometimes crop up with the highly customized versions of apps routinely used in other distros. In short the whole process just seems simplier to me. And as a bonus, Slackware will force you to actually learn linux to a certain degree. But I haven't ventured much into the world of GUIs (from a programming standpoint), Linux or Windows, simply because I perfer the power of the command line, especially under Linux.

Last edited by DaHammer; 10-09-2004 at 11:30 PM.


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
Cross Compiling dosnlinux Programming 5 03-01-2006 12:12 PM
wx widget and cross compiling guideweb Programming 0 09-21-2005 12:06 AM
cross-compiling? jon_k Programming 3 12-09-2004 10:36 AM
Building cross-compiling toolchain radhapriya Linux - Software 1 06-25-2004 01:01 AM
Cross compiling - Windows Xp -> Linux groston Programming 1 05-31-2002 04:19 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:45 AM.

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