PDA

Visualizza la versione completa : gcc nn va pił..


bako
25-03-2005, 18:11
ho questo file



#include <iostream>

using namespace std;


int main(){
cout << "hello world";
return 0;
}


se faccio gcc prova.cpp ho questo output


/tmp/ccUzh3Lb.o(.text+0xd): In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
/tmp/ccUzh3Lb.o(.text+0x60): In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
/tmp/ccUzh3Lb.o(.text+0x9d): In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
/tmp/ccUzh3Lb.o(.text+0xc8): In function `std::__verify_grouping(char const*, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int) const'
/tmp/ccUzh3Lb.o(.text+0x121): In function `main':
: undefined reference to `std::cout'
/tmp/ccUzh3Lb.o(.text+0x126): In function `main':
: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/tmp/ccUzh3Lb.o(.text+0x152): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init()'
/tmp/ccUzh3Lb.o(.text+0x181): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccUzh3Lb.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status


credo mi manchi qualche libreria ma quale?

side-server
25-03-2005, 18:24
Originariamente inviato da bako
ho questo file



#include <iostream>

using namespace std;


int main(){
cout << "hello world";
return 0;
}


credo mi manchi qualche libreria ma quale?

premetto che di C non so una mazza ma da quel poco che so non dovrebbe essere:

<iostream.h>

:master:

Ikitt
25-03-2005, 18:35
Originariamente inviato da bako
ho questo file



#include <iostream>

using namespace std;


int main(){
cout << "hello world";
return 0;
}


se faccio gcc prova.cpp ho questo output
[...]
credo mi manchi qualche libreria ma quale?
e' un problema di inclusione/linking, lo risolvi in toto usando (come d'altronde bisognerebbe fare) g++

bako
25-03-2005, 18:50
si ho risolto devo usare g++ ..

Loading