Re: [expert] C++ errors
At 09:20 AM 12/31/2001 -0900, tester wrote: >Actually, will still fail: > >Also need > ># define EXIT_SUCCESS 0 > >before int main() > >Civileme It worked fine on my system without #define EXIT_SUCCESS 0. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
> Are you certain you have an iostream file? Are any other standard > headers needed? The older gcc series added standard headers by default > with wild abandon, but no more. 2.96 is strict but nothing compared to > 3.0. > > Civileme Civileme, I should have all the header files installed. I did a complete install paying pretty close attention to development goodies. I does work now if I compile it first. Guess I was confused by the fact that it would run in the K-Develop environment but not from a console window. -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
On Sunday 30 December 2001 08:17 pm, you wrote: > Ken: what version of mdk you use? 7.2 or 8.0 or 8.1? > eric, [EMAIL PROTECTED] > Mandrake 8.1. -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
Lee Roberts wrote: >I think you're right. He has to compile the program, with g++, first and >then run the *executable* file. :-D > >At 06:23 PM 12/31/2001 +1300, Syed Irfan wrote: > >>hmm >> >>i think i know whats wrong >>hes running the .cpp file as a script without compiling >>to compile use g++ hello.cpp -o hello and run as ./hello, n i hope u got >>my direct mail to u >> >>hth >> >>vi hello.cpp >>[irfan@Main irfan]$ ./hello.cpp >>bash: ./hello.cpp: Permission denied >>[irfan@Main irfan]$ chmod 755 hello.cpp >>[irfan@Main irfan]$ ./hello.cpp >>./hello.cpp: line 4: syntax error near unexpected token `main(v' >>./hello.cpp: line 4: `int main(void)' >>[irfan@Main irfan]$ >> >>almost same error as what was said >>n its very likely 100% what went wrong >> >> >>On Mon, 2001-12-31 at 18:06, Lee Roberts wrote: >> >>>Change #include to #include >>> >>>At 09:37 PM 12/30/2001 -0700, Ken Thompson wrote: >>> >#include > >int main() >{ > cout << "Hello World!" << endl; > return(0); >} > >Try the above :) > [ken@spooky Desktop]$ ./hello1.cpp ./kello1.cpp: line 4: syntax error near unexpected token `main()' ./kello1.cpp: line 4: `int main()' > Been a long time, but shouldn't this be > > int main(); > Tom and Dwain, Same error message using each of the suggestions. The code comes right out of Sams "Teach yourself C++ in 24hrs" and in previous versions of MDK I've had it work. I'm going back to trying to learn C++, had to quit studies the first time around. -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com >>> >>> >>> >>>Want to buy your Pack or Services from MandrakeSoft? >>>Go to http://www.mandrakestore.com >>> >> >> >>_ >>Do You Yahoo!? >>Get your free @yahoo.com address at http://mail.yahoo.com >> >> >>Want to buy your Pack or Services from MandrakeSoft? >>Go to http://www.mandrakestore.com >> > > > > > >Want to buy your Pack or Services from MandrakeSoft? >Go to http://www.mandrakestore.com > Actually, will still fail: Also need # define EXIT_SUCCESS 0 before int main() Civileme Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
Ken Thompson wrote: >>#include >> >>int main() >>{ >> cout << "Hello World!" << endl; >> return(0); >>} >> >>Try the above :) >> > >[ken@spooky Desktop]$ ./hello1.cpp >./kello1.cpp: line 4: syntax error near unexpected token `main()' >./kello1.cpp: line 4: `int main()' > >> Been a long time, but shouldn't this be >> >> int main(); >> > >Tom and Dwain, >Same error message using each of the suggestions. > >The code comes right out of Sams "Teach yourself C++ in 24hrs" and in >previous versions of MDK I've had it work. >I'm going back to trying to learn C++, had to quit studies the first time >around. > > > > >Want to buy your Pack or Services from MandrakeSoft? >Go to http://www.mandrakestore.com > Are you certain you have an iostream file? Are any other standard headers needed? The older gcc series added standard headers by default with wild abandon, but no more. 2.96 is strict but nothing compared to 3.0. Civileme Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
Ken: what version of mdk you use? 7.2 or 8.0 or 8.1? eric, [EMAIL PROTECTED] Ken Thompson wrote: > > > #include > > > > int main() > > { > > cout << "Hello World!" << endl; > > return(0); > > } > > > > Try the above :) > > > > [ken@spooky Desktop]$ ./hello1.cpp > ./kello1.cpp: line 4: syntax error near unexpected token `main()' > ./kello1.cpp: line 4: `int main()' > > > Been a long time, but shouldn't this be > > > > int main(); > > Tom and Dwain, > Same error message using each of the suggestions. > > The code comes right out of Sams "Teach yourself C++ in 24hrs" and in > previous versions of MDK I've had it work. > I'm going back to trying to learn C++, had to quit studies the first time > around. > -- > Ken Thompson, North West Antique Autos > Payette, Idaho > Email: [EMAIL PROTECTED] > http://www.nwaa.com > Sales and brokering of antique autos and parts. > > Linux- Coming Soon To A Desktop Near You > Registered Linux User #183936 > > > Want to buy your Pack or Services from MandrakeSoft? > Go to http://www.mandrakestore.com Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
I think you're right. He has to compile the program, with g++, first and then run the *executable* file. :-D At 06:23 PM 12/31/2001 +1300, Syed Irfan wrote: >hmm > >i think i know whats wrong >hes running the .cpp file as a script without compiling >to compile use g++ hello.cpp -o hello and run as ./hello, n i hope u got >my direct mail to u > >hth > >vi hello.cpp >[irfan@Main irfan]$ ./hello.cpp >bash: ./hello.cpp: Permission denied >[irfan@Main irfan]$ chmod 755 hello.cpp >[irfan@Main irfan]$ ./hello.cpp >./hello.cpp: line 4: syntax error near unexpected token `main(v' >./hello.cpp: line 4: `int main(void)' >[irfan@Main irfan]$ > >almost same error as what was said >n its very likely 100% what went wrong > > >On Mon, 2001-12-31 at 18:06, Lee Roberts wrote: >> Change #include to #include >> >> At 09:37 PM 12/30/2001 -0700, Ken Thompson wrote: >> > >> >> #include >> >> >> >> int main() >> >> { >> >> cout << "Hello World!" << endl; >> >> return(0); >> >> } >> >> >> >> Try the above :) >> >> >> > >> >[ken@spooky Desktop]$ ./hello1.cpp >> >./kello1.cpp: line 4: syntax error near unexpected token `main()' >> >./kello1.cpp: line 4: `int main()' >> > >> >> Been a long time, but shouldn't this be >> >> >> >> int main(); >> > >> >Tom and Dwain, >> >Same error message using each of the suggestions. >> > >> >The code comes right out of Sams "Teach yourself C++ in 24hrs" and in >> >previous versions of MDK I've had it work. >> >I'm going back to trying to learn C++, had to quit studies the first time >> >around. >> >-- >> >Ken Thompson, North West Antique Autos >> >Payette, Idaho >> >Email: [EMAIL PROTECTED] >> >http://www.nwaa.com >> >Sales and brokering of antique autos and parts. >> > >> >Linux- Coming Soon To A Desktop Near You >> >Registered Linux User #183936 >> > >> > >> >Want to buy your Pack or Services from MandrakeSoft? >> >Go to http://www.mandrakestore.com >> >> >> >> > >> Want to buy your Pack or Services from MandrakeSoft? >> Go to http://www.mandrakestore.com > > > >_ >Do You Yahoo!? >Get your free @yahoo.com address at http://mail.yahoo.com > > >Want to buy your Pack or Services from MandrakeSoft? >Go to http://www.mandrakestore.com Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
hmm i think i know whats wrong hes running the .cpp file as a script without compiling to compile use g++ hello.cpp -o hello and run as ./hello, n i hope u got my direct mail to u hth vi hello.cpp [irfan@Main irfan]$ ./hello.cpp bash: ./hello.cpp: Permission denied [irfan@Main irfan]$ chmod 755 hello.cpp [irfan@Main irfan]$ ./hello.cpp ./hello.cpp: line 4: syntax error near unexpected token `main(v' ./hello.cpp: line 4: `int main(void)' [irfan@Main irfan]$ almost same error as what was said n its very likely 100% what went wrong On Mon, 2001-12-31 at 18:06, Lee Roberts wrote: > Change #include to #include > > At 09:37 PM 12/30/2001 -0700, Ken Thompson wrote: > > > >> #include > >> > >> int main() > >> { > >>cout << "Hello World!" << endl; > >>return(0); > >> } > >> > >> Try the above :) > >> > > > >[ken@spooky Desktop]$ ./hello1.cpp > >./kello1.cpp: line 4: syntax error near unexpected token `main()' > >./kello1.cpp: line 4: `int main()' > > > >> Been a long time, but shouldn't this be > >> > >> int main(); > > > >Tom and Dwain, > >Same error message using each of the suggestions. > > > >The code comes right out of Sams "Teach yourself C++ in 24hrs" and in > >previous versions of MDK I've had it work. > >I'm going back to trying to learn C++, had to quit studies the first time > >around. > >-- > >Ken Thompson, North West Antique Autos > >Payette, Idaho > >Email: [EMAIL PROTECTED] > >http://www.nwaa.com > >Sales and brokering of antique autos and parts. > > > >Linux- Coming Soon To A Desktop Near You > >Registered Linux User #183936 > > > > > >Want to buy your Pack or Services from MandrakeSoft? > >Go to http://www.mandrakestore.com > > > > > Want to buy your Pack or Services from MandrakeSoft? > Go to http://www.mandrakestore.com _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
Change #include to #include At 09:37 PM 12/30/2001 -0700, Ken Thompson wrote: > >> #include >> >> int main() >> { >> cout << "Hello World!" << endl; >> return(0); >> } >> >> Try the above :) >> > >[ken@spooky Desktop]$ ./hello1.cpp >./kello1.cpp: line 4: syntax error near unexpected token `main()' >./kello1.cpp: line 4: `int main()' > >> Been a long time, but shouldn't this be >> >> int main(); > >Tom and Dwain, >Same error message using each of the suggestions. > >The code comes right out of Sams "Teach yourself C++ in 24hrs" and in >previous versions of MDK I've had it work. >I'm going back to trying to learn C++, had to quit studies the first time >around. >-- >Ken Thompson, North West Antique Autos >Payette, Idaho >Email: [EMAIL PROTECTED] >http://www.nwaa.com >Sales and brokering of antique autos and parts. > >Linux- Coming Soon To A Desktop Near You >Registered Linux User #183936 > > >Want to buy your Pack or Services from MandrakeSoft? >Go to http://www.mandrakestore.com Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
At 08:41 PM 12/30/2001 -0500, Tom Brinkman wrote: > > Been a long time, but shouldn't this be > > int main(); Nope. It's int main() without the semi-colon. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
> #include > > int main() > { > cout << "Hello World!" << endl; > return(0); > } > > Try the above :) > [ken@spooky Desktop]$ ./hello1.cpp ./kello1.cpp: line 4: syntax error near unexpected token `main()' ./kello1.cpp: line 4: `int main()' > Been a long time, but shouldn't this be > > int main(); Tom and Dwain, Same error message using each of the suggestions. The code comes right out of Sams "Teach yourself C++ in 24hrs" and in previous versions of MDK I've had it work. I'm going back to trying to learn C++, had to quit studies the first time around. -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
RE: [expert] C++ errors
#include int main() { cout << "Hello World!" << endl; return(0); } Try the above :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Tom Brinkman Sent: Sunday, December 30, 2001 5:42 PM To: [EMAIL PROTECTED] Subject: Re: [expert] C++ errors On Sunday 30 December 2001 08:12 pm, Ken Thompson wrote: > Hello all, > I'm trying to learn C++ but get an error every time I try to > execute from the console. > I can make the exact same file in K-Develop and it executes OK, > what could be wrong? > I've included the simple "Hello World " file and the error message > I'm getting. > > #include > int main() Been a long time, but shouldn't this be int main(); -- Tom Brinkman Corpus Christi, Texas, USA Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [expert] C++ errors
On Sunday 30 December 2001 08:12 pm, Ken Thompson wrote: > Hello all, > I'm trying to learn C++ but get an error every time I try to > execute from the console. > I can make the exact same file in K-Develop and it executes OK, > what could be wrong? > I've included the simple "Hello World " file and the error message > I'm getting. > > #include > int main() Been a long time, but shouldn't this be int main(); -- Tom Brinkman Corpus Christi, Texas, USA Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
[expert] C++ errors
Hello all, I'm trying to learn C++ but get an error every time I try to execute from the console. I can make the exact same file in K-Develop and it executes OK, what could be wrong? I've included the simple "Hello World " file and the error message I'm getting. #include int main() { cout << "Hello World\n"; return EXIT_SUCCESS; } ERROR MESSAGE [ken@spooky Desktop]$ ./hello.cpp ./hello.cpp: line 2: syntax error near unexpected token `main()' ./hello.cpp: line 2: `int main()' Thanks for the help, -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com