nu merge. uite sursa:
----------------------------------------------------------------------------
use namespace std;
#include <stdio.h>
#include <iostream>
#include <string>
main() {
string ss = "jjjjkjlj lkjlk ";
cout << "what? \n : " << ss.c_str() << "\n";
}
----------------------------------------------------------------------------
erorile:
[george@george work]$ gcc -c tst3.cpp
tst3.cpp:1: syntax error before `namespace'
tst3.cpp: In function `int main()':
tst3.cpp:10: `string' undeclared (first use this function)
tst3.cpp:10: (Each undeclared identifier is reported only once for each
function it appears in.)
tst3.cpp:10: parse error before `=' token
tst3.cpp:12: `cout' undeclared (first use this function)
tst3.cpp:12: `ss' undeclared (first use this function)
----------------------------------------------------------------------------
in plus:
$ rpm -q gcc3
gcc3-3.1-0
$ rpm -q libstdc++
libstdc++-2.96-98
[george@george work]$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-suse-linux/3.1/specs
Configured with: ./configure --enable-threads --enable-shared
--prefix=/usr/local --with-local-prefix=/usr/local --infodir=/usr/local/info
--mandir=/usr/local/man --with-gxx-include-dir=/usr/local/include/g++-v3
i686-suse-linux
Thread model: posix
gcc version 3.1
cand instalez gcc3 , nu se instaleaza si libstdc++? ce trebuie sa mai fac?
On Monday 20 January 2003 03:43 pm, you wrote:
> Salut!
>
> >Incerc sa upgradez pe un redhat 7.2 de la gcc 2.96-98 la 3.1.0. Toate bune
> > si frumoase, am instalat rpm-urile pentru gcc3, gcc3-libs si binutils si
> > am scos rpmul de gcc-2.96.
> >Acum, cand incerc sa compilez ceva ce contine clasele string sau vector,
> > nu le gaseste. Banuiesc ca trebuie upgradat si libstdc++, insa nu am
> > gasit nici un rpm, ci doar tar.gz. Ce imi recomandati sa fac?
>
> S-ar putea sa fie problema de namespace. Insereaza in sursa, chear la
> inceput un:
>
> use namespace std;
>
>
>
>
>
> Vitalie
>
> ---
> Pentru dezabonare, trimiteti mail la
> [EMAIL PROTECTED] cu subiectul 'unsubscribe rlug'.
> REGULI, arhive si alte informatii: http://www.lug.ro/mlist/
--
George Caragea
Syqon Systems Romania
---
Pentru dezabonare, trimiteti mail la
[EMAIL PROTECTED] cu subiectul 'unsubscribe rlug'.
REGULI, arhive si alte informatii: http://www.lug.ro/mlist/