Thread: Problem with CODEBLOCKS

  1. #1
    Registered User
    Join Date
    Jan 2013
    Posts
    42

    Problem with CODEBLOCKS

    I've just fresh installed code blocks 12.11 on my windows 7(x64) OS and tried to launch simple hello world program but no output is produced in console window. I checked compiler path and it looks good. When I first started code blocks window pop-up in the right low corner saying environment error and something about path variable missing. I simply don't know whats wrong. I have use code blocks before and never got errors like this.

    Here is image of program execution:

    Problem with CODEBLOCKS-screenshot-2013-10-14-13-02-43-jpg

  2. #2
    Registered User
    Join Date
    Jan 2013
    Posts
    42
    I forgot to mention that there is no .exe file in my project's folder...it's sometimes there but when I double click on it it disappears.

  3. #3
    Registered User
    Join Date
    Jan 2013
    Posts
    42
    I have just tried to make cpp hello world console app and it works just fine. So the problem is only with c projects. If this is helpful

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    When you try to build your hello world in C, what happens? The screenshot seems to indicate that no files were compiled, which may be a problem. (If there's a timestamp check, just make a little change to your .c file and save.)

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Read this link FAQ-Compiling (errors) - CodeBlocks

    Do a Re-Build; Do NOT do a run.

    What does the Build Log say?

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  6. #6
    Registered User
    Join Date
    Jan 2013
    Posts
    42
    Build log:

    Problem with CODEBLOCKS-screenshot-2013-10-14-17-56-12-jpg

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Somewhere you told CB to run the wrong file.

    Project -> "Set Program Arguments" is the spot I know about that does this; but, there may be others.

    Another place to verify the settings is.

    Project -> Properties
    Tab "Build Targets"
    Check the Text Boxes called "Output Filename", "Execution Working Dir" for all targets in the left column.

    Tim S.
    Last edited by stahta01; 10-14-2013 at 10:20 AM.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  8. #8
    Registered User
    Join Date
    Jan 2013
    Posts
    42
    Set program arguments:

    Problem with CODEBLOCKS-screenshot-2013-10-14-18-22-42-png

    Build Targets:

    Problem with CODEBLOCKS-screenshot-2013-10-14-18-22-24-png

    I am not sure that i told CB to run the wrong file, because i just fresh installed CB and, as part of habit, when created project i didn't start programming anything i just clicked to build and run(hello world) and it didn't produce any output. And there was Environment error as I mentioned in first post. I reinstalled CB and same thing again.

  9. #9
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The screenshot you just posted says the output is "helo.exe". The screenshot you posted very first thing in the thread was running "ptr.exe". Poke around and see if you see that name anywhere.

  10. #10
    Registered User
    Join Date
    Jan 2013
    Posts
    42
    I know. Sorry for misunderstanding. When I uninstalled CB I also deleted all projects, and now created new project called helo. But the problem is same. I have to mention that I used CB before and I didn't have any problem with it. Now I installed it and this s**t happens. I simply don't know what's wrong. This is first time that i installed CB after reinstalling windows. Until today I only used eclipse for java applications.

  11. #11
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    This is likely your Anti Virus software.

    I suggest learning to cut and paste code on this and other support sites.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  12. #12
    Registered User
    Join Date
    Jan 2013
    Posts
    42
    Quote Originally Posted by stahta01 View Post
    This is likely your Anti Virus software.

    I suggest learning to cut and paste code on this and other support sites.

    Tim S.
    You are very right. I just closed my antivirus an it's working. But how did you know it? I have to know after almost 10 hours of searching for solution.

  13. #13
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    It's probably being caused because of the directory you're trying to use. Try creating a directory off your "My Documents" directory for your projects instead of the Desktop directory. Many anti-virus programs consider files changing, except is certain directories, as possible viruses and quarantine them.

    Jim

  14. #14
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by yahzee View Post
    You are very right. I just closed my antivirus an it's working. But how did you know it? I have to know after almost 10 hours of searching for solution.
    Its in the Code::Blocks FAQs. Not under that symptom; but, what you said an exe disappeared is a common thing with AV software.

    http://wiki.codeblocks.org/index.php...enied_error.3F

    Tim S.
    Last edited by stahta01; 10-14-2013 at 11:42 AM.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  15. #15
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,663
    You might want to white-list your development directories in your AV s/w, so it knows to leave them alone and trust them explicitly.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem with codeblocks
    By zeybek258388 in forum C Programming
    Replies: 6
    Last Post: 01-03-2012, 09:07 PM
  2. Need help with codeblocks
    By SilverClif in forum Windows Programming
    Replies: 6
    Last Post: 05-24-2011, 05:12 AM
  3. using codeblocks
    By torquemada in forum Tech Board
    Replies: 7
    Last Post: 04-20-2011, 08:57 PM
  4. problem with codeblocks
    By gnanasenthil654 in forum C++ Programming
    Replies: 2
    Last Post: 08-10-2009, 02:30 AM
  5. Problem With std::string in Codeblocks.
    By ThLstN in forum C++ Programming
    Replies: 4
    Last Post: 08-24-2008, 11:01 AM