Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: code::blocks build and run error

  1. #1
    Join Date
    Jun 2008
    Beans
    12

    code::blocks build and run error

    I just finished my first day of computer science class and I am trying to get my hello world program to work in code::blocks.

    Its written in C++ and if I use g++ I can compile and run in manually, but when I try to build and run it in code::blocks it pops up the command line and gives me a permission denied error.

    Any ideas what might be going on here?

    Thanks a bunch
    Justin

  2. #2
    Join Date
    Dec 2007
    Beans
    81
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: code::blocks build and run error

    Got the exact error? Permission denied to what?

  3. #3
    Join Date
    Jun 2008
    Beans
    12

    Re: code::blocks build and run error

    Im at work at the moment, ill post the exact error when I get home.

    It was something along the lines of:

    "sh: [path of the file here] permission denied"

  4. #4
    Join Date
    Jun 2008
    Beans
    12

    Re: code::blocks build and run error

    Ok, so when I run it from code::blocks I get the following error:

    Code:
    sh: /home/jdwolford/CS161/helloworld/helloworld: Permission denied
    
    Press enter to continue.
    It looks like its trying to run the following command:
    Code:
    Executing: xterm -T '/home/jdwolford/CS161/helloworld/helloworld' -e /usr/bin/cb_console_runner "/home/jdwolford/CS161/helloworld/helloworld" (in /home/jdwolford/CS161/helloworld)

  5. #5
    Join Date
    Apr 2006
    Beans
    1,030
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: code::blocks build and run error

    check the permissions are executable.

    when you compile a new program you may have to assign it a +x with chmod:
    Code:
    chmod + <name of program>
    This may work, not absolutely sure

    Mike

  6. #6
    Join Date
    Aug 2008
    Beans
    8

    Re: code::blocks build and run error

    I happen to have the same problem...
    Does any one know how to allow code blocks to run and compile without getting that permission denied window?
    Would be appreciated

  7. #7
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,220
    Distro
    Kubuntu

    Re: code::blocks build and run error

    After you compile/link your program, verify that the resulting executable is indeed an executable.
    Code:
    $ ls -l a.out
    -rwxrwxr-x 1 dwhitney dwhitney 4742 2008-08-22 17:01 a.out
    The other thing is to try running the program such as:
    Code:
    ./a.out
    Some *nix systems do not include './' in the PATH environment setting as a security precaution.

  8. #8
    Join Date
    May 2007
    Location
    Ravenna, Italy
    Beans
    13
    Distro
    Ubuntu 10.04 Lucid Lynx

    Lightbulb Re: code::blocks build and run error

    Just installed Code::Blocks IDE 8.02 on Ubuntu 8.04.1.

    Same problem.

    After some trial-errors, I'v found a solution.

    I've place the standard code::blocks dir for project in my home:

    /home/rob/CB

    Here I'll save all my C/C++ projects.

    Now make executable the cb_console_runner for all users:

    Code:
    rob@ubuntu:~$ sudo chmod a+x /usr/bin/cb_console_runner
    Finally, I've changed the settings in Code::Blocks like this:



    Code:
    Shell to run commands in: [ /bin/bash -c ]
    Terminal to launch console program: [ xterm -T $TITLE -e ]
    Now it works!

    Rob
    Last edited by chinchillart; October 17th, 2008 at 04:21 PM. Reason: formal specs

  9. #9
    Join Date
    Nov 2008
    Beans
    2

    Red face Re: code::blocks build and run error

    Hey dude! Could you be a little more specific on what you did to make codeblocks compile and run under linux? I have the same problem and I can't get it to work.

    I'm relatively new to ubuntu and I really want codeblocks to run.
    Small exact steps would be most appropriate.

    hope you reply!

    Thanks in advance!

  10. #10
    Join Date
    Nov 2008
    Beans
    2

    Re: code::blocks build and run error

    I managed to get Codeblocks to Compile , but nothing happens when I click run.

    Does anyone has an answer for this?

Page 1 of 2 12 LastLast

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
  •