Results 1 to 3 of 3

Thread: Cannot execute binary file?

  1. #1
    Join Date
    Aug 2016
    Beans
    4

    Cannot execute binary file?

    I written a program successfully in code blocks and even ran it by clicking compile and run. I then went into compiling it with gcc. Again successful. Then when I went to run it in the terminal it said, "cannot execute binary file." At first I thought I had a bug in my program that I did not show up in Code Blocks.
    .
    Then I got the bright idea to try my other programs that I knew ran because I ran them before. To my surprise it said the exact same thing for all of them even "Hello world."

    Code:
     bash: .: hello: cannot execute binary file
    Here is the exact code
    Code:
    #include <stdio.h>
    int main()
    {
        printf("Hello world \n");
        return (0);
    }
    Last edited by lisati; January 8th, 2017 at 07:29 PM. Reason: Replaced [QUOTE] with [CODE]

  2. #2
    Join Date
    Apr 2012
    Beans
    7,183

    Re: Cannot execute binary file?

    How exactly are you trying to run them? don't explicitly use `bash` to run binary executables, just call them by name and path e.g.

    Code:
    ./hello
    Based on the error, it looks like you're trying to use `bash hello`

  3. #3
    Join Date
    Aug 2016
    Beans
    4

    Re: Cannot execute binary file?

    Oh I had my forward slash and backslash mixed up.

    Thanks I really appreciate it

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •