This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Program editor programming c++


On Thu, 2008-05-29 14:04:24 -0700, Lopezio <geral@mariolopes.com> wrote:
> Thank you for your help.I'm a beginer on cpp. I'm programming in windows/dos
> mode and i get error when i compile the program 
> #include <iostream>
> int main(){
> std::cout << "olare" << std::endl;
> }
> I get error when i compile the program with gcc ola.cpp -o ola.exe
> Can you help me?

It would have helped if you had the error message included...

But I know what's missing. Remember what was said? The gcc compiler
(being a C compiler that's capable of recognizing and compiling C++
sources) won't include libstdc++ in the linker run. So either add that:

gcc foo.cpp -lstdc++

...or use g++ to compile and link.

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of:           Ich hatte in letzter Zeit ein biÃchen viel Realitycheck.
the second  :               Langsam mÃchte ich mal wieder weitertrÃumen kÃnnen.
                             -- Maximilian Wilhelm (18. Mai 2006, #lug-owl.de)

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]