Problems installing GCC on Windows

Started by
18 comments, last by Brobanx 21 years, 9 months ago
The GNU team makes it very confusing for Windows users to install their stuff. I''ve used MingW until recently (which is the equivalent of GCC 2.95), but I''ve a few reasons to want to use GCC 3.0 or GCC 3.1(mainly better template support in C++). So I followed the instructions, installed cygwin (went over perfectly), and on attempting to install the new GCC tools (from inside the cygwin environment) I''ve just ran into error after dubious error trying to install it. I''ve looked on the web and have found very little help regarding this issue... If any of you wise people have managed to install GCC 3.0 or 3.1 on a windows system, I am in desperate need of your help.
Advertisement
I haven''t setup any version of GCC except 2.95.x in Cygwin, but I''ll try next time I boot Windows (just so you know someone will eventually try to help you ).

There''s a section dedicated to gcc 3.1 here.
I''ve built g++3.1 in cygwin. No problem whatsoever.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I just built GCC 3.0.4 (I chose that version since it was the same 3.x version that I''m used to using in Linux) in a almost default installation of Cygwin. I built every part except the Java part (since that can''t be built in Cygwin, according to the configure script). Maybe if you list the issues you''re having, we could help more, since now you know it is possible to build 3.x in Cygwin from multiple sources.

My problems occur while trying to configure GCC before installation...

I''ve unpacked my download to c:/gcc_inst, and made another directory called c:/gcc.

Under the cygwin console, I type

cd c:/gcc
c:/gcc_inst/configure

it detects the machine as i686-pc-cygwin(correct)

and it goes through the whole process for a minute or so until I get the message: "configure: error: *** unable to determine endianness"
Okay, I did a tiny bit of research, and I concluded that GCC''s configure script does not use the Autoconf method of determining endianness. Instead, it checks the values in sys/param.h. So, open your sys/param.h file (it''ll be at /usr/include/sys/param.h) and search for the word ''endian''. If you can''t find any references to what looks like this, add it (comments clipped for space):
/* ... */#define BIG_ENDIAN	4321#define LITTLE_ENDIAN	1234/* ... */#define BYTE_ORDER	LITTLE_ENDIAN

Since I can pretty safely assume you''re using a little endian system (i686-pc-cygwin).

Wow thanks a lot. I had to really mess around with my environment variables, and do the exact opposite of what the help file said (it said to run configure in a DIFFERENT directory than where you unpacked the files... i had to run configure from the same directory to get past the "can''t determine endianness" error, and then set some environment variables on where to find last version of gcc, change some other things for include and lib directories... but i got it to work!)... so now I got it installed fine, but it still can''t link properly to the c++ standard library.

I have a program like this:


  #include <iostream>int main() {    std::cout << "Print this properly, why don''t you?";    return 0;}  


Which compiles, but does not link. It says that there''s an undefined reference to cout, I''m not quite sure what that means but I''ve tried changing the lib path to numerous possibilities with no success.
Are you compiling with gcc as the name of the program, or g++? g++ is used to compile C++ code, while gcc compiles C code (in actuality, I believe g++ just calls gcc with all arguments neccesary to compile C++, but that can be ignored).
quote:Original post by SilentStrike
Are you compiling with gcc as the name of the program, or g++? g++ is used to compile C++ code, while gcc compiles C code (in actuality, I believe g++ just calls gcc with all arguments neccesary to compile C++, but that can be ignored).

Actually gcc is just a front-end. It looks at the file you are compiling and then calls the real compiler executable to compile that file, so gcc can be used to compile C, C++, Objective-C, and any other language in the GNU Compiler Collection (assuming of course that you've built GCC with support for the particular language).

g++ is also just a front-end. The actual C++ compiler is called cc1plus (and the actual C compiler is called cc1).

[edited by - Dactylos on June 28, 2002 11:26:12 PM]

This topic is closed to new replies.

Advertisement