Gentoo Archives: gentoo-dev

From: Spider <spider@g.o>
To: Richard Reich <rreich@×××××××.com>
Cc: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Need some c++ help here please:
Date: Mon, 26 Aug 2002 10:25:11
Message-Id: 20020826171815.2fd3012c.spider@gentoo.org
In Reply to: Re: [gentoo-dev] Need some c++ help here please: by Richard Reich
1 begin quote
2 On 26 Aug 2002 11:15:16 -0400
3 Richard Reich <rreich@×××××××.com> wrote:
4
5 > ou need to drop the .h. The header files for the new stl and iostream
6 > libs have been changed for the new standard.
7 >
8 > You'll also need to do 1 of 2 things
9 >
10 > using namespace std;
11 > or
12 > std::cout << "Hello World" << std::endl;
13 >
14 > anyway, here are the changes...
15 Aye, I've covered both those although I'm using legacy compability with
16 deprecated code here, mostly because of braindead computerteachers that
17 insist on it when we have pen+paper programming. there's something
18 about learning "bad form" of programming for a start that ticks me off
19 ;/
20
21
22
23
24
25 >
26 > #include <iostream>
27 > using namespace std;
28 > int main(){
29 > cout << "Hello World" << endl;
30 > return(0);
31 > }
32 >
33 according to the ml posts I've read this is bad practice and one should
34 use std::cout whenever/wherever there is need of it. I'm good at bad
35 practice though ;)
36
37 > OR......................
38 > #include <iostream>
39 >
40 > int main(){
41 > std::cout << "Hello World" << std::endl;
42 > return(0);
43 > }
44 >
45 >
46 > also gcc doesn't by default link the stl lib to the app. g++ will.
47 now this was the real core issue, why it worked with c++ and not with
48 gcc.. for a while I thought I'd done something very dumb with my system
49 :)
50
51 so thats why it works with c++ and g++ but not with gcc, thanks! :)
52
53
54
55 >
56 > That should take care of your problems
57 >
58 > - Richard Reich
59
60 thanks for the swift response :)
61
62 //Spider
63
64 --
65 begin .signature
66 This is a .signature virus! Please copy me into your .signature!
67 See Microsoft KB Article Q265230 for more information.
68 end

Replies

Subject Author
Re: [gentoo-dev] Need some c++ help here please: Terje Kvernes <terjekv@××××××××.no>