Re: C++
Re: C++
- Subject: Re: C++
- From: digish reshamwala <email@hidden>
- Date: Fri, 13 Aug 2004 16:02:03 -0700
- Priority: normal
Hi...
OK I tried your suggestions. And compiled using the command
g++ -Wall g++ -Wall -O0 -o hello hello.cpp
But it game the following error:
"ld: can't locate file for: -lcrt1.o"
I mean, there is no syntax error in my prev code too. It gave me the same
error as above, when I tried simple command:
g++ main.cpp
I have attached .cpp file just in case...
Also, how can i use xcode for this??
thanks
-digish
----- Original Message -----
From: goochrules! <email@hidden>
Date: Friday, August 13, 2004 3:43 pm
Subject: Re: C++
> On Fri, 13 Aug 2004 14:50:38 -0700, digish reshamwala
<email@hidden>
> wrote:> Hey..
> >
> > How do I compile & run simple C++ program in Mac OS X Panther??
> >
> > The program is:
> >
> > #include <iostream.h>
> >
> > int main()
> > {
> > cout << "Hello World!" << endl;
> > return 0;
> > }
> >
> > Please reply soon!
> >
> > The g++ or gcc under terminal doesn't seems to work.
> >
>
> try this (name it hello.cpp):
>
> #include <iostream> // note: no .h
>
> int main(int argc, char* argv[]) {
> std::cout << "hello world" << std::endl; // note: namespace qualifications
> return 0;
> }
>
> compile with:
>
> g++ -Wall -O0 -o hello hello.cpp
>
>
> -- Matthew Pletzer
> -- email@hidden
[demime 0.98b removed an attachment of type application/octet-stream which had a NAME of main.cpp]
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
- Follow-Ups:
- Re: C++
- From: Syd Polk <email@hidden>
- Re: C++
- From: Nick Zitzmann <email@hidden>
- Re: C++
- From: Shawn Erickson <email@hidden>