Solved

Installing and using GCC on Cygwin - "set the environment variable CC to a working compiler"

Posted on 2004-03-20
3
1,692 Views
Last Modified: 2013-12-26
I'm in a C++ class and I need to compile my programs so that they will run on the school's Unix platform. The compiler at school is called xlC, but I couldn't find a download for that on the internet so I'm trying GCC instead. I downloaded and installed Cygwin (from cygwin.com) so that I could use Unix on my PC, and now I'm trying to set up/run GCC. I'm trying to follow the directions on http://gcc.gnu.org/install/configure.html. Here's what happens:

Chiara Whiting@Chiara /cygdrive/c/chiara
$ mkdir c:/chiara/cfiles

Chiara Whiting@Chiara /cygdrive/c/chiara
$ cd c:/chiara/cfiles

Chiara Whiting@Chiara /cygdrive/c/chiara/cfiles
$ c:/program%20files/gcc-3.3.3/configure
Configuring for a i686-pc-cygwin host.
*** This configuration is not supported in the following subdirectories:
     target-libffi target-boehm-gc target-zlib target-libjava
    (Any other directories should still work fine.)
Created "Makefile" in /cygdrive/c/chiara/cfiles using "mh-frag"
cc: not found
*** The command 'cc -o conftest -g   conftest.c' failed.
*** You must set the environment variable CC to a working compiler.


Multiple Google searches have helped very little. I think I need to find a precompiled binary of GCC, but I don't know where.

Here's my system info:
Dell Latitude D600
Windows XP
GCC 3.3.3
The cygwin and GCC-3.3.3 folders are located in C:\Program%20Files.

I know nothing about Unix, as you can probably tell. Please explain this to me using small words. :) Thanks!
0
Comment
Question by:cmw44
3 Comments
 

Author Comment

by:cmw44
ID: 10642026
P.S.
C:/Chiara/cfiles is the directory where I'd like to save the compiled C++ programs.
0
 
LVL 12

Accepted Solution

by:
stefan73 earned 500 total points
ID: 10642170
Hi cmw44,
You don't need to compile or setup anything on gcc with cygwin. Just pick the gcc packet of cygwin to install and that's it. Runs right out-of-the-box.

Be warned about compiling gcc yourself - I did this on a 8 CPU Sun Enterprise machine with parallel make and it took about 1 hour and more than 1GB of HD space.

Cheers!

Stefan
0
 
LVL 86

Expert Comment

by:jkr
ID: 10644198
Edit the makefile to read

$CC=gcc

instead of

$CC=cc
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question