[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: the weird problem



On Wed, Oct 30, 2002 at 09:15:59AM -0500, Rokicki, Andrew wrote:
> (For some reason it takes forever for my responses to make it to the actual
> list.
> so I am emailing you directly.)
> 
> You can not create test program name.

Yes, actually, you can.

> It is a shell command.

That's true, but if you explicitly path it, as he did, it will execute
the program and not the shell built-in.

> Try calling it mytest or whatever (OK call it whatever). 
> try this gcc -o whatever test.c
> make sure you have correct permissions set.
> Such as x for you this means it is executable.

gcc (ld, actually) does that for you.

See below for my own critique.

> On Wednesday, October 30, 2002 8:57 AM, nobody somebody
> [SMTP:thenightmare555 yahoo com] wrote:
> > Look folks...
> > 
> > I have one Intel Pentium IV processor with 128mb of ram ...
> > 
> > I've installed redhat  8.0  and I have one weird problem....
> > 
> > I created a file called test.c  --->
> > 
> > #include <stdio.h>
> > 
> > void main()
> > 
> > {
> > 
> > printf("test");
> >
> > }
> > 
> > [root localhost]#gcc  -o test test.c
> > 
> > [root localhost]# /test
> > 
> > [root localhost]#
> > 
> >  
> > 
> > so I can compile it succesfuly ....
> > 
> > but I can't run ne binary file
> > 
> > c00L_3oy 
> > 
> > ps. I hope you can help me

I cut and pasted it and tried it.  I used "mytest" as the executable
because there is a "test" directory where I built it.  It compiled
with this warning:

test.c:5: warning: return type of `main' is not `int'

When I executed it, I got this (command-line prompts included):

yak:bob(L3) ~ [1006] $ ./mytest
testyak:bob(L3) ~ [1007] $ 

Notice there is no newline after the output "test".  Other than that,
it works.

Cheers,
-- 
Bob McClure, Jr.             Bobcat Open Systems, Inc.
robertmcclure earthlink net  http://www.cumbytel.com/~bobcatos/
Linux: because I want to get there today.  Without rebooting.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]