Archived

This topic is now archived and is closed to further replies.

Problems installing GCC on Windows

This topic is 5894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

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.

Share on other sites
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 ).

Share on other sites
There''s a section dedicated to gcc 3.1 here.

Share on other sites
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.

Share on other sites
My problems occur while trying to configure GCC before installation...

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"

Share on other sites
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).

Share on other sites
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.

Share on other sites
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).

Share on other sites
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]

1. 1
2. 2
3. 3
4. 4
frob
15
5. 5

• 16
• 12
• 20
• 12
• 19
• Forum Statistics

• Total Topics
632163
• Total Posts
3004513

×