can not execute binary file
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Red Hat support > Red Hat Topics > can not execute binary file




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    can not execute binary file  
Tajin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-26-05 07:45 AM

I am trying to compile/run some files with gcc, but I am getting the
following messages(it also happens with 777 permission):

bash: ./test: cannot execute binary file

bash: ./tst23: Permission denied


This is my fstab file

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm           	tmpfs   defaults        0 0
/dev/hdb3               swap                    swap    defaults        0 0
/dev/hdd                /media/cdrom            auto
pamconsole,ro,exec,noauto,managed 0 0
/dev/hdc                /media/cdrecorder       auto
pamconsole,ro,exec,noauto,managed 0 0
/dev/fd0                /media/floppy           auto
pamconsole,exec,noauto,managed 0 0


Can anyone put me in the proper direction to solve my problem





[ Post a follow-up to this message ]



    Re: can not execute binary file  
Jacob


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-26-05 07:45 AM

On Sat, 26 Mar 2005 00:59:44 -0500, a posting issued forth from Tajin...
> I am trying to compile/run some files with gcc, but I am getting the
> following messages(it also happens with 777 permission):
>
> bash: ./test: cannot execute binary file
>
> bash: ./tst23: Permission denied
>

Can we see an 'ls -l' of the appropriate directory?

--
Jacob
mailto:`echo wnpbo@urvqre.ubzryvahk.arg | tr [a-z] [n-za-m]`





[ Post a follow-up to this message ]



    Re: can not execute binary file  
Tajin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-26-05 10:46 PM

I compiled and output the file as test, I got the same file attributes as ts
t23,
I changed to chmod a+rw 777 , when I run it I get can not execute binary fil
e,
file tst23 compiled same way, the attributes are the same as test, it's mess
age
access dennied comes out when I try to run it. Files I compiled like 2 weeks
 ago
they run. I made an upgrade of the files of my FC3 on monday with synaptic p
ack
manager.

[donaji@myhost ~]$ cd /home/donaji/myc/joyofc/programs/chap12
[donaji@myhost chap12]$ gcc -ansi -Wall -c datetest.c -o tst23
[donaji@myhost chap12]$ ./tst23
bash: ./tst23: Permission denied
[donaji@myhost chap12]$ ls -l
total 112
-rwxrwxr-x  1 donaji donaji   866 Dec  8  1996 date.c
-rwxrwxr-x  1 donaji donaji   296 Dec  8  1996 date.h
-rwxrwxr-x  1 donaji donaji  1538 Dec  8  1996 datetest.c
-rwxrwxr-x  1 donaji donaji   709 Dec  8  1996 db.c
-rwxrwxr-x  1 donaji donaji   962 Dec  8  1996 dbfind.c
-rwxrwxr-x  1 donaji donaji   163 Dec  8  1996 dbfind.h
-rwxrwxr-x  1 donaji donaji   467 Dec  8  1996 db.h
-rwxrwxr-x  1 donaji donaji   546 Dec  8  1996 dbinp.c
-rwxrwxr-x  1 donaji donaji   160 Dec  8  1996 dbinp.h
-rwxrwxr-x  1 donaji donaji   992 Dec  8  1996 dbprint.c
-rwxrwxr-x  1 donaji donaji  1253 Dec  8  1996 dbupdate.c
-rwxrwxr-x  1 donaji donaji  1068 Dec  8  1996 getval2.c
-rwxrwxr-x  1 donaji donaji   353 Dec  8  1996 getval2.h
-rwxrwxr-x  1 donaji donaji  1172 Dec  8  1996 getvalue.c
-rwxrwxr-x  1 donaji donaji   371 Dec  8  1996 getvalue.h
-rwxrwxr-x  1 donaji donaji 12103 Mar 31  2003 me
-rwxrwxr-x  1 donaji donaji   325 Mar 31  2003 premps1.c
-rwxrwxr-x  1 donaji donaji   272 Dec  8  1996 premps2.c
-rwxrwxr-x  1 donaji donaji   688 Mar 31  2003 premps.c
-rwxrwxr-x  1 donaji donaji   397 Dec  8  1996 premps.h
-rwxrwxr-x  1 donaji donaji  1446 Mar 31  2003 prstruct.c
-rwxrwxr-x  1 donaji donaji  1764 Mar 25 23:53 test
-rw-rw-r--  1 donaji donaji  1764 Mar 26 11:03 tst23
-rwxrwxr-x  1 donaji donaji   822 Dec  8  1996 union.c
-rwxrwxr-x  1 donaji donaji  1350 Dec  8  1996 usebits2.c
-rwxrwxr-x  1 donaji donaji  1363 Dec  8  1996 useit.c
[donaji@myhost chap12]$ ./test
bash: ./test: cannot execute binary file
[donaji@myhost chap12]$
[donaji@myhost chap12]$


Jacob wrote:
> On Sat, 26 Mar 2005 00:59:44 -0500, a posting issued forth from Tajin...
> 
>
>
> Can we see an 'ls -l' of the appropriate directory?
>





[ Post a follow-up to this message ]



    Re: can not execute binary file  
Jean-David Beyer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-26-05 10:46 PM

Tajin wrote:
> I compiled and output the file as test, I got the same file attributes
> as tst23, I changed to chmod a+rw 777 , when I run it I get can not
> execute binary file, file tst23 compiled same way, the attributes are
> the same as test, it's message access dennied comes out when I try to
> run it. Files I compiled like 2 weeks ago they run. I made an upgrade of
> the files of my FC3 on monday with synaptic pack manager.
>
> [donaji@myhost ~]$ cd /home/donaji/myc/joyofc/programs/chap12
> [donaji@myhost chap12]$ gcc -ansi -Wall -c datetest.c -o tst23
> [donaji@myhost chap12]$ ./tst23
> bash: ./tst23: Permission denied
> [donaji@myhost chap12]$ ls -l
> total 112

> -rwxrwxr-x  1 donaji donaji  1764 Mar 25 23:53 test
> -rw-rw-r--  1 donaji donaji  1764 Mar 26 11:03 tst23

tst23 is not executable. Do
chmod 0775 tst23
and then try to run it.

--
.~.  Jean-David Beyer          Registered Linux User 85642.
/V\  PGP-Key: 9A2FC99A         Registered Machine   241939.
/( )\ Shrewsbury, New Jersey    http://counter.li.org
^^-^^ 12:20:00 up 1 day, 2:36, 3 users, load average: 4.29, 4.31, 4.26





[ Post a follow-up to this message ]



    Re: can not execute binary file  
Jean-David Beyer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-26-05 10:46 PM

Jean-David Beyer wrote:
> Tajin wrote:
> 
>
> 
>
>
> tst23 is not executable. Do
> chmod 0775 tst23
> and then try to run it.
>
P.S.: Why did you use -c option? That just gets you a .o file (that you
renamed without a .o at the end). I.e., is that a complete program? I
would guess not.

If all those .c files are part of your program, try
$ gcc -ansi -Wall *.c -o tst23

I am not sure why you are using -ansi or -Wall, but they may do no harm.

--
.~.  Jean-David Beyer          Registered Linux User 85642.
/V\  PGP-Key: 9A2FC99A         Registered Machine   241939.
/( )\ Shrewsbury, New Jersey    http://counter.li.org
^^-^^ 12:50:00 up 1 day, 3:06, 3 users, load average: 4.26, 4.13, 4.12





[ Post a follow-up to this message ]



    Re: can not execute binary file  
Tajin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-26-05 10:46 PM

Jean-David Beyer wrote:
> Jean-David Beyer wrote:
> 
>
> P.S.: Why did you use -c option? That just gets you a .o file (that you
> renamed without a .o at the end). I.e., is that a complete program? I
> would guess not.
>
> If all those .c files are part of your program, try
> $ gcc -ansi -Wall *.c -o tst23
>
> I am not sure why you are using -ansi or -Wall, but they may do no harm.
>

Sorry, I was using gcc not properly, it should be:

[donaji@myhost chap4]$ gcc -ansi -Wall area.c -o tst23


[donaji@myhost chap4]$ chmod 0775 tst23
[donaji@myhost chap4]$ ./tst23
bash: ./tst23: cannot execute binary file
[donaji@myhost chap4]$ gcc -ansi -Wall area.c -o tst23
[donaji@myhost chap4]$ ./tst23
Enter radius: 12.1
Area in floating point notation: 459.960573
Area in exponential notation:    4.599606e+02
Area in smallest notation:       459.961

Thanks





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:31 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register