Solved

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

Posted on 2004-03-20
3
1,709 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

626 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