public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: GCC Compile Failure
@ 2006-07-09  1:24 Bill McEnaney
  2006-07-09  1:55 ` Brian Dessent
  2006-07-09  2:00 ` David Fang
  0 siblings, 2 replies; 8+ messages in thread
From: Bill McEnaney @ 2006-07-09  1:24 UTC (permalink / raw)
  To: jjdevine, gcc-help

Hi, again, John,

You need to parenthesize printf's argument, too, so your printf should
look more like this:

printf ("Hello, world.\n");

After I solved that problem, I compiled your program and ran it on my
Sunblade 100 workstation that runs gcc-4.1.1.  The C++ compiler, g++,
warned me that iostream had been deprecated.  That's why I don't know
what header file you need to include instead of iostream.h.  The warning
said that I could suppress it with a compiler directive, but I think
it's better to include the header file meant to replace iostream.h  By
the way, I'm not a C++ programmer.

Bill

Hi, John,

Why not include iostream.h instead of glibc?" Glibc isn't a header file.
Since the iostream,h header file defines cout, you can delete the
linethat says that cout is a void function.  Hope this helps, my good guy.

Bill

> Hello GCC Helpers,
> 
> This is a program I wrote:
> 
> #include <glibc>
> #include <stdio.h>
> void cout();
> main()
> {printf "Hello World. /n";
> 	cout << "Hello/n";
> return 0;
> }
> 
> The "make" command gave me:
> 
> gcc  -o simplest simplest.c
> error: glibc: no such file or directory
> error: invalid operands to binary <<
> make: *** [simplest] Error 1
> 
> What's wrong?  Books I have show that "<<" works fine sending output
to the 
> monitor!
> 
> If I comment out both the cout and #include <glibc> the printf works fine 
> after doing a make.
> 
> I'm using SUSE Linux 10.1 on an HP Pavilion, 165 MB HD, 512 MB RAM,
AMD 3000+.
> 
> Thanks for any help.
> 
> John J. Devine
> 
> 

________________________________________________________________
"Pro-choice?"  Then click here.
http://cathinsight.com/morality/saying.htm

"Men must look for the peace of Christ in the Kingdom of Christ... When
once men recognize, both in private and in public life, that Christ is
King, society will at last receive the great blessings of real liberty,
well-ordered discipline, peace and harmony."  Pope Pius XI




________________________________________________________________
"Pro-choice?"  Then click here.
http://cathinsight.com/morality/saying.htm

"Men must look for the peace of Christ in the Kingdom of Christ... When
once men recognize, both in private and in public life, that Christ is
King, society will at last receive the great blessings of real liberty,
well-ordered discipline, peace and harmony."  Pope Pius XI

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: GCC Compile Failure
@ 2006-07-09  2:35 Bill McEnaney
  0 siblings, 0 replies; 8+ messages in thread
From: Bill McEnaney @ 2006-07-09  2:35 UTC (permalink / raw)
  To: gcc-help, gcc-help

Brian is right.  I forgot to type the ".h"

Bill

> Bill McEnaney wrote:
> 
> > Sunblade 100 workstation that runs gcc-4.1.1.  The C++ compiler, g++,
> > warned me that iostream had been deprecated.  That's why I don't know
> 
> No, it warned you that <iostream.h> is deprecated and should not be
> used, not <iostream> (which is the proper header to use, without the
> .h). 
> <http://www.parashift.com/c++-faq-lite/coding-standards.html#faq-27.4>
> 
> Brian
> 
> 

________________________________________________________________
"Pro-choice?"  Then click here.
http://cathinsight.com/morality/saying.htm

"Men must look for the peace of Christ in the Kingdom of Christ... When
once men recognize, both in private and in public life, that Christ is
King, society will at last receive the great blessings of real liberty,
well-ordered discipline, peace and harmony."  Pope Pius XI

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: GCC Compile Failure
@ 2006-07-09  1:06 Bill McEnaney
  0 siblings, 0 replies; 8+ messages in thread
From: Bill McEnaney @ 2006-07-09  1:06 UTC (permalink / raw)
  To: jjdevine, gcc-help

Hi, John,

Why not include iostream.h instead of glibc?" Glibc isn't a header file.
 Since the iostream,h header file defines cout, you can delete the line
that says that cout is a void function.  Hope this helps, my good guy.

Bill

> Hello GCC Helpers,
> 
> This is a program I wrote:
> 
> #include <glibc>
> #include <stdio.h>
> void cout();
> main()
> {printf "Hello World. /n";
> 	cout << "Hello/n";
> return 0;
> }
> 
> The "make" command gave me:
> 
> gcc  -o simplest simplest.c
> error: glibc: no such file or directory
> error: invalid operands to binary <<
> make: *** [simplest] Error 1
> 
> What's wrong?  Books I have show that "<<" works fine sending output
to the 
> monitor!
> 
> If I comment out both the cout and #include <glibc> the printf works fine 
> after doing a make.
> 
> I'm using SUSE Linux 10.1 on an HP Pavilion, 165 MB HD, 512 MB RAM,
AMD 3000+.
> 
> Thanks for any help.
> 
> John J. Devine
> 
> 

________________________________________________________________
"Pro-choice?"  Then click here.
http://cathinsight.com/morality/saying.htm

"Men must look for the peace of Christ in the Kingdom of Christ... When
once men recognize, both in private and in public life, that Christ is
King, society will at last receive the great blessings of real liberty,
well-ordered discipline, peace and harmony."  Pope Pius XI

^ permalink raw reply	[flat|nested] 8+ messages in thread
* GCC Compile Failure
@ 2006-07-08 20:18 jjdevine
  2006-07-08 21:06 ` Artūras Moskvinas
  2006-07-10 14:55 ` Young, Michael
  0 siblings, 2 replies; 8+ messages in thread
From: jjdevine @ 2006-07-08 20:18 UTC (permalink / raw)
  To: gcc-help

Hello GCC Helpers,

This is a program I wrote:

#include <glibc>
#include <stdio.h>
void cout();
main()
{printf "Hello World. /n";
	cout << "Hello/n";
return 0;
}

The "make" command gave me:

gcc  -o simplest simplest.c
error: glibc: no such file or directory
error: invalid operands to binary <<
make: *** [simplest] Error 1

What's wrong?  Books I have show that "<<" works fine sending output to the 
monitor!

If I comment out both the cout and #include <glibc> the printf works fine 
after doing a make.

I'm using SUSE Linux 10.1 on an HP Pavilion, 165 MB HD, 512 MB RAM, AMD 3000+.

Thanks for any help.

John J. Devine

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-07-10 14:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-09  1:24 GCC Compile Failure Bill McEnaney
2006-07-09  1:55 ` Brian Dessent
2006-07-09  2:00 ` David Fang
  -- strict thread matches above, loose matches on Subject: below --
2006-07-09  2:35 Bill McEnaney
2006-07-09  1:06 Bill McEnaney
2006-07-08 20:18 jjdevine
2006-07-08 21:06 ` Artūras Moskvinas
2006-07-10 14:55 ` Young, Michael

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).