Re: g++ file doesn't run
Jeff Shilt wrote: >Thanks for the help - it does compile with g++ instead of gcc, but the >executable produced isn't d >oing anything. Here's what i'm doing: > >//test.c >#include > >main(){ > cout << "Hello there."; >} > >The test file doesn't print out anything when I run it. > >Also, I was wondering if this was a descrepency in versions of gcc. The >installaition I had befor >e (using the main parts of the Slackware dist.) compiled both c and c++. Like >somehow it knew whic >h way to process it. > > Don't call it "test" and don't end it in ".c". Try .cc or .CC or even .C because the compiler will look at the extension. g++ -o filename filename.cc will name the exec. the same as the input w/o the .cc extension. [EMAIL PROTECTED]/GNU--1.2---Linux--2.1.25--- <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> -- A computer lets you make more mistakes faster than any other invention, with the possible exceptions of handguns and Tequilla. -- Mitch Ratcliffe
Re: g++ file doesn't run
>Thanks for the help - it does compile with g++ instead of gcc, but the >executable produced isn't doing anything. Here's what i'm doing: > >//test.c >#include > >main(){ > cout << "Hello there."; >} > >The test file doesn't print out anything when I run it. Append a \n to your string. Or include iomanip.h and use the "flush" manipulator. --- Benoit Goudreault-Emond Reply to: [EMAIL PROTECTED] My opinions are mine only and may not reflect those of my employer. E-mail me to obtain my public PGP key.
Re: g++ file doesn't run
At 10:23 PM 3/21/97 -0500, Jeff Shilt wrote: >Thanks for the help - it does compile with g++ instead of gcc, but the executable produced isn't doing anything. Here's what i'm doing: > >//test.c Don't call it "test". -- Matt
Re: g++ file doesn't run
In message <[EMAIL PROTECTED]>, Hamish Moffatt writes : > On Mar 03, 1997 at 10:23:30PM -0500, Jeff Shilt wrote: > > Thanks for the help - it does compile with g++ instead of gcc, but the exec ->utable produced isn't doing anything. Here's what i'm doing: > > > > //test.c > > #include > > > > main(){ > > cout << "Hello there."; > > } > > > > The test file doesn't print out anything when I run it. > > As I understand it, Unix terminal IO is buffered, so nothing will > be written until a newline is sent. You never sent one, so all > bets are off; the standards don't guarantee anything if you don't > send at least one new line. (Similarly by default even character > by character input won't see anything until the user presses return). > I think buffers are suposed to get flushed when a program terminates normaly, but I would try this anyway if nofing else helps :) The other sugestion on the list (another 'test' is run) is more likly. You can try runing Your own 'test' by spesifying the path (./test). /Lars > > Hamish > -- > Hamish Moffatt, [EMAIL PROTECTED], Melbourne, Australia. > Student, computer science & computer systems engineering. 3rd year, RMIT. > http://yallara.cs.rmit.edu.au/~moffatt CPOM: [ ] 40% > PGP key available from web page above. >
Re: g++ file doesn't run
On Mar 03, 1997 at 10:23:30PM -0500, Jeff Shilt wrote: > Thanks for the help - it does compile with g++ instead of gcc, but the > executable produced isn't doing anything. Here's what i'm doing: > > //test.c > #include > > main(){ > cout << "Hello there."; > } > > The test file doesn't print out anything when I run it. As I understand it, Unix terminal IO is buffered, so nothing will be written until a newline is sent. You never sent one, so all bets are off; the standards don't guarantee anything if you don't send at least one new line. (Similarly by default even character by character input won't see anything until the user presses return). Try #include main() { cout << "Hello there." << endl; } You would theoretically get no output from #include main() { printf("Hello there."); } either. I haven't checked though. Hamish -- Hamish Moffatt, [EMAIL PROTECTED], Melbourne, Australia. Student, computer science & computer systems engineering. 3rd year, RMIT. http://yallara.cs.rmit.edu.au/~moffatt CPOM: [ ] 40% PGP key available from web page above.
Re: g++ file doesn't run
On Fri, 21 Mar 1997, Jeff Shilt wrote: > //test.c > > The test file doesn't print out anything when I run it. try typing 'which test' and find out what program your really running then type 'man test' to see what it does. Then give your program a new name. Time flies like arrows, but fruit flies like bananas Perry Piplanihttp://perrypip.netservers.com [EMAIL PROTECTED] http://www.netservers.com
g++ file doesn't run
Thanks for the help - it does compile with g++ instead of gcc, but the executable produced isn't doing anything. Here's what i'm doing: //test.c #include main(){ cout << "Hello there."; } The test file doesn't print out anything when I run it. Also, I was wondering if this was a descrepency in versions of gcc. The installaition I had before (using the main parts of the Slackware dist.) compiled both c and c++. Like somehow it knew which way to process it.