g++ setup
Karl F. Larsen
klarsen1 at gmail.com
Sun Feb 14 21:00:08 UTC 2010
John D Lamb wrote:
>> I tried all the flags without success. The 10-04 system has
>> ANSI/ISO Standard C++ and that is that. What does work is
>> changing code in the program listings.
>>
>> My older 9.04 uses Standard C++ and in the program you use
>> #include<iostream.h> which works fine.
>>
>> On 10-04 you need #include<iostream> AND using namespace std;
>>
>> It appears no flag can do this.
>>
>
> To #include<iostream.h> you need a file called "iostream.h", which has
> been deprecated for a while. I guess the following hack would work, but
> I haven’t actually tried it.
>
> 1. Create a directory, say /home/user/include
> 2. Create a file iostream.h in the directory containing
>
> #ifndef IOSTREAM_H
> #define IOSTREAM_H
> #include<iostream>
> using namespace std;
> #endif
>
> 3. Compile with the flag -I/home/user/include
>
> Then if your C++ header has #include<iostream.h> in it, it should read
> iostream instead and put its definitions in the global namespace.
>
> Personally I would rather update the C++ code. But I guess it depends on
> on your needs.
>
Well I agree. It is simple to change a line and add a line
when I want to run the older source code. I thank you for your
thoughts.
73 Karl
--
Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
Key ID = 3951B48D
More information about the ubuntu-users
mailing list