Thread View: csu.unix.linux
7 messages
7 total messages
Started by Xylen
Fri, 28 Jan 2000 00:00
where did it go?
Author: Xylen
Date: Fri, 28 Jan 2000 00:00
Date: Fri, 28 Jan 2000 00:00
24 lines
1240 bytes
1240 bytes
I know it is a simple little thing, but I can't find it anywhere.
I want to include lines like :
#include <fstream.h>
fstream myin;
myin.open("data");
myin >> x;
I think I need fstream.h and probally iostream.h, but I can't find them.
I suppose they are part of a shared library somewhere, but I don't know
which one. I have libc.so.6 and I'm guessing they are in there, but
apparantley gcc doesn't recognize them. I keep getting the error "cannot
find fstream". Then again, I could be way off base, and they are
someplace else entirely.
If my code is wrong, just what do I need to open a file, read from it,
and then close it again?
btw, I'm running RedHat6.0 .
Xylen
Re: where did it go?
Author: Mike
Date: Fri, 28 Jan 2000 00:00
Date: Fri, 28 Jan 2000 00:00
20 lines
1023 bytes
1023 bytes
mctupper@holly.colostate.edu (Xylen):
> I know it is a simple little thing, but I can't find it anywhere.
>
> I want to include lines like :
>
> #include <fstream.h>
> fstream myin;
>
> myin.open("data");
>
> myin >> x;
>
> I think I need fstream.h and probally iostream.h, but I can't find them.
> I suppose they are part of a shared library somewhere, but I don't know
Are you compiling this with g++? If so, check to make sure you have egcs-g++
installed (rpm -qa | grep egcs).
--
Mike Grandin
Re: where did it go?
Author: Xylen
Date: Sat, 29 Jan 2000 00:00
Date: Sat, 29 Jan 2000 00:00
19 lines
1228 bytes
1228 bytes
Mike wrote: > Are you compiling this with g++? If so, check to make sure you have egcs-g++ > installed (rpm -qa | grep egcs). Yep, it works just fine with g++. I keep forgetting that I have three different compilers. cc, gcc, and g++. What is the difference in them anyway? Besides different error messages. Xylen -- __^__ __^__ ( ___ )------------------------------( ___ ) | / | This message has been brought | \ | | / | to you by the language C and | \ | |___| the number F |___| (_____)------------------------------(_____)
Re: where did it go?
Author: Mike
Date: Sat, 29 Jan 2000 00:00
Date: Sat, 29 Jan 2000 00:00
13 lines
1172 bytes
1172 bytes
mctupper@holly.colostate.edu (Xylen): > Yep, it works just fine with g++. I keep forgetting that I have three > different compilers. cc, gcc, and g++. What is the difference in them > anyway? Besides different error messages. I believe cc (c compiler) is what generally comes on a Unix box. With linux, cc is just a symlink to gcc (GNU c compiler). Use g++ when you want to compile anything c++ish. From the man page, 'g++ is a script to call gcc with options to recognize C++' So, when it comes down to it, they are really all the same thing on linux. -- Mike Grandin
Re: where did it go?
Author: Michael Dwyer
Date: Sun, 30 Jan 2000 00:00
Date: Sun, 30 Jan 2000 00:00
22 lines
1797 bytes
1797 bytes
Mike <mike@www.intrig.com> wrote: : mctupper@holly.colostate.edu (Xylen): :> Yep, it works just fine with g++. I keep forgetting that I have three :> different compilers. cc, gcc, and g++. What is the difference in them :> anyway? Besides different error messages. : I believe cc (c compiler) is what generally comes on a Unix box. With linux, : cc is just a symlink to gcc (GNU c compiler). Use g++ when you want to compile : anything c++ish. From the man page, 'g++ is a script to call gcc with options : to recognize C++' So, when it comes down to it, they are really all the same : thing on linux. Except I think on some machines, cc == gcc, and g++ == egcs. Its all a vicious conspiracy. Suffice to say, in the Bad Old Days (tm) cc was a symlink to gcc, and g++ was a symlink to gcc. Gcc would act a little differently depending on what you called it. -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michael J. Dwyer I doubt, therefore I might be. mdwyer@holly.ColoState.edu http://WWW.CS.ColoState.EDU/~dwyer/ Computer Science Major Amateur Radio Tech N0ZAP
Re: where did it go?
Author: Mike
Date: Tue, 01 Feb 2000 00:00
Date: Tue, 01 Feb 2000 00:00
28 lines
1967 bytes
1967 bytes
mdwyer@holly.ColoState.EDU (Michael Dwyer): > : I believe cc (c compiler) is what generally comes on a Unix box. With linux, > : cc is just a symlink to gcc (GNU c compiler). Use g++ when you want to compile > : anything c++ish. From the man page, 'g++ is a script to call gcc with options > : to recognize C++' So, when it comes down to it, they are really all the same > : thing on linux. > > Except I think on some machines, cc == gcc, and g++ == egcs. Its all a > vicious conspiracy. Suffice to say, in the Bad Old Days (tm) cc was > a symlink to gcc, and g++ was a symlink to gcc. Gcc would act a little > differently depending on what you called it. > Good call, on my system g++ isn't a script. The man page must need to be updated. I wonder why the move was made from gcc to egcs. Are gcc packages still being developed, or did they just rename it to egcs? [Tue, 1:32pm] ~ # rpm -qf /usr/bin/gcc /usr/bin/cc /usr/bin/g++ egcs-1.1.2-12 egcs-1.1.2-12 egcs-c++-1.1.2-12 [Tue, 1:32pm] ~ # ls -l /usr/bin/gcc /usr/bin/cc /usr/bin/g++ lrwxrwxrwx 1 root root 3 Jan 8 1999 /usr/bin/cc -> gcc -rwxr-xr-x 2 root root 66188 Mar 21 1999 /usr/bin/g++ -rwxr-xr-x 3 root root 64796 Mar 21 1999 /usr/bin/gcc -- Mike Grandin
Re: where did it go?
Author: Scott Scriven
Date: Sat, 05 Feb 2000 00:00
Date: Sat, 05 Feb 2000 00:00
32 lines
3307 bytes
3307 bytes
In article <slrn89eh3a.236.mike@localhost.localdomain>, mike@www.intrig.com (Mike) wrote: > mdwyer@holly.ColoState.EDU (Michael Dwyer): >> : I believe cc (c compiler) is what generally comes on a Unix box. With linux, >> : cc is just a symlink to gcc (GNU c compiler). Use g++ when you want to compile >> : anything c++ish. From the man page, 'g++ is a script to call gcc with options >> : to recognize C++' So, when it comes down to it, they are really all the same >> : thing on linux. >> >> Except I think on some machines, cc == gcc, and g++ == egcs. Its all a >> vicious conspiracy. Suffice to say, in the Bad Old Days (tm) cc was >> a symlink to gcc, and g++ was a symlink to gcc. Gcc would act a little >> differently depending on what you called it. > > Good call, on my system g++ isn't a script. The man page must need to be > updated. I wonder why the move was made from gcc to egcs. Are gcc packages > still being developed, or did they just rename it to egcs? Hi; just happened to see this while testing out a newsreader. The "cc" program should always exist on a unix system (assuming there is a C compiler of some sort). It is often just a link to the system's preferred compiler. Same goes for "CC", except this will compile as C++ instead of C. Some also have "c++", but "CC" is more standard. With gnu systems, gcc is the C compiler and g++ is the C++ compiler. Because gcc supports both C and C++ (both natively -- it doesn't need to translate C++ -> C like some compilers do), the same executable can compile both languages. It probably checks its name (argv[0]) to see which language it defaults to. Other programs do this, such as gzip -- it figures out whether to compress/decompress and where to send the data based on what its executable is called (gzip, gunzip, gzcat, etc). EGCS is simply the Cygnus version of gcc/g++. They had made their own branch in order to speed up development. If you remember, gcc was stuck at V2.7.2 for quite a long time, until Cygnus started egcs. Then some of the changes were merged back in to create gcc 2.8.0. Eventually, the FSF decided that gcc would be better off if it was maintained officially by Cygnus, and they handed over the name. So, now egcs and gcc are the same thing, and the current version is 2.95. Just FYI. :) _ _ _ _ ___ ___ ---"I don't get even - I just get odder."--- ( \/ ( \/ (__ (__ ) | Scott Scriven (Toy Keeper / XYZZ) | \ / \ / // // | mailto:toykeeper@cheerful.com | / \ / / //_ //_ | irc:serdevian.dyn.omnipotent.net | (_/\_(_/ (___(___) | http://www.vis.colostate.edu/~scriven/ |
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads