Just nu i M3-nätverket
Jump to content

Sitter fast


zapp

Recommended Posts

Tänkte jag skulle försöka mig på det här med programmering igen, men nu lyckas inte få den enklaste kod att kompileras.

 

 

#include <iostream>

using namespace standard;

 

int main()

{

int y = 5;

int *yPtr;

yPtr=&y;

cout<< yPtr<<endl;

cout<< *yPtr<<endl;

 

return 0;

}

 

kör mandrake 9.0 gcc 3.2 har aldrig fått felmed på cout när jag använt äldre mandrake utgåvor.

Varför måste dom alltid ändra och försvåra för noviser.

 

 

gcc testpek.cc -o testpek

testpek.cc:3: namespace `standard' undeclared

testpek.cc: In function `int main()':

testpek.cc:10: `cout' undeclared (first use this function)

testpek.cc:10: (Each undeclared identifier is reported only once for each function it appears in.)

testpek.cc:10: `endl' undeclared (first use this function)

 

Tacksam för ett snabbt svar.

 

Link to comment
Share on other sites

Hjälp ändrade standard till std

 

/tmp/ccxcRFoS.o: In function `main':

/tmp/ccxcRFoS.o(.text+0x21): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'

/tmp/ccxcRFoS.o(.text+0x2c): undefined reference to `std::cout'

/tmp/ccxcRFoS.o(.text+0x31): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(void const*)'

/tmp/ccxcRFoS.o(.text+0x3a): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'

/tmp/ccxcRFoS.o(.text+0x45): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'

/tmp/ccxcRFoS.o(.text+0x52): undefined reference to `std::cout'

/tmp/ccxcRFoS.o(.text+0x57): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'

/tmp/ccxcRFoS.o(.text+0x60): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))'

/tmp/ccxcRFoS.o: In function `__static_initialization_and_destruction_0(int, int)':

/tmp/ccxcRFoS.o(.text+0x8c): undefined reference to `std::ios_base::Init::Init[in-charge]()'

/tmp/ccxcRFoS.o: In function `__tcf_0':

/tmp/ccxcRFoS.o(.text+0xbb): undefined reference to `std::ios_base::Init::~Init [in-charge]()'

/tmp/ccxcRFoS.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'

collect2: ld returned 1 exit status

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...