Re: simple question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



gcc  -lstdc++ c.cpp
will work.

 --- Ramin NIkaeen <Rnikaeen@xxxxxxxxxxxx> a écrit : >

> 
> Valued Colleagues,
> 
> I have built and installed gcc-3.3 on RedHat linux
> 7.2 but I am having 
> problems with the compiler. For several days I have
> been trying to
> figure out the cause of the problem but I have not
> had much success.
> 
> Below is a small sample program and the compiler
> error that I get.
> 
> If someone can give me any pointers as to the cause
> of the problem,
> I will be very thankful.
> 
> best regards
> 
> ramin
> 
> 
>
--------------------------------------------------------------------------------------------
> TEST PROGRAM
>
--------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>more c.cpp
> 
> #include <iostream>
> #include <string>
> using namespace std;
> 
> int main()
> {
>     cerr << "Enter your name ";
> 
>     return 0;
> }
> 
>
--------------------------------------------------------------------------------------------
> COMPILER OUTPUT
>
--------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>gcc c.cpp
> /tmp/cc5AisQc.o: In function `main':
> /tmp/cc5AisQc.o(.text+0x1b): undefined reference to
> `std::cerr'
> /tmp/cc5AisQc.o(.text+0x20): 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/cc5AisQc.o: In function
> `__static_initialization_and_destruction_0(int,
> int)':
> /tmp/cc5AisQc.o(.text+0x49): undefined reference to
> `std::ios_base::Init::Init[in-charge]()'
> /tmp/cc5AisQc.o(.text+0x64): undefined reference to
> `std::ios_base::Init::~Init [in-charge]()'
> /tmp/cc5AisQc.o(.eh_frame+0x11): undefined reference
> to `__gxx_personality_v0'
> collect2: ld returned 1 exit status
> 
>
--------------------------------------------------------------------------------------------
> gcc VERSION
>
--------------------------------------------------------------------------------------------
> jupiter.goldline.net:/home/rnikaeen/test>which gcc 
> /usr/local/bin/gcc
> 
> 
> jupiter.goldline.net:/home/rnikaeen/test>gcc -v
> Reading specs from
> /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
> Configured with: ./configure 
> Thread model: posix
> gcc version 3.3
> 
>
--------------------------------------------------------------------------------------------
> RedHat Linux VERSION
>
--------------------------------------------------------------------------------------------
>
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3>uname
> -v
> #1 Thu May 29 08:32:50 EDT 2003
>
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3>uname
> -a
> Linux jupiter.goldline.net 2.4.20-18.7 #1 Thu May 29
> 08:32:50 EDT 2003 i686 unknown
>
jupiter.goldline.net:/usr/local/publicVoiceXML/speech_tools-1.2.3> 


	

	
		
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! Messenger sur http://fr.messenger.yahoo.com

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux