Program won't execute

This is a discussion on Program won't execute within the C++ Programming forums, part of the General Programming Boards category; I recently got back into learning how to program C++. I used to be able to compile and execute code ...

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    8

    Program won't execute

    I recently got back into learning how to program C++. I used to be able to compile and execute code without a hitch. Now I am doing the most basic of programs:

    Code:
    #include <iostream>
    using namespace std;
    int main()
    {
        cout<<"Hello, world! I love you!\n";
        cin.get();
    }
    First AVG classified this as a Trojan Horse and suggested I remove it immediately. I disabled AVG for the moment to go ahead and run the program again. Still nothing. I thought maybe it was something on my end. Although no errors came back when I compiled this, maybe I did something wrong?


    Reply when you have time!
    -Paul

  2. #2
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Weird. Code is fine. Which compiler/IDE?

    Check if AVG is running in the background (ctrl+alt+del) or as a service (administration tools). AVG is crap, but false warnings about basic programs doesn't seem right. Maybe the IDE debugger is flagging it, or something to do with data execution?
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    8
    @Dae The main component of AVG isn't on, but there are several other processes with "avg" in the name.

    When I turn off AVG and add

    Code:
    return 1;
    after

    Code:
    cin.get();
    it works just fine. No virus warning or error.

    I am using Dev-C++ 4.9.9.2.

  4. #4
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    There is the other possibility -- you have a virus on your system, and it's infecting the compiled program as soon as the program is made. It's not uncommon for a virus to infect all executables that are accessed or created.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  5. #5
    Dae
    Dae is offline
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    Quote Originally Posted by Cat View Post
    There is the other possibility -- you have a virus on your system, and it's infecting the compiled program as soon as the program is made. It's not uncommon for a virus to infect all executables that are accessed or created.
    That is possible, but would have to be a very specific virus to selectively inject into his program and nothing else (anything else would follow more AVG warnings).

    Quote Originally Posted by rayne117 View Post
    I am using Dev-C++ 4.9.9.2.
    Seems to be a common issue between AVG and Dev-C++. Either AVG flagged Dev-C++'s debugger, or method of injection. Can't see it being a compilation (MinGW) issue, since there aren't any Code::Blocks / AVG issues.

    Dev-C++ is deprecated (much like me). Rules of life:

    1) Use Code::Blocks or Visual Studio.
    2) Never use AVG.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  6. #6
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,578
    Quote Originally Posted by Dae View Post
    Seems to be a common issue between AVG and Dev-C++. Either AVG flagged Dev-C++'s debugger, or method of injection. Can't see it being a compilation (MinGW) issue, since there aren't any Code::Blocks / AVG issues.
    It's almost certainly the problem. I don't use AVG anymore, having switched to Avira. But I had a similar hard to track problem with gdb for free pascal, early this year.

    The attached DLL is not liking gdb. And being that Dev-C++ install a really old version of gdb, it's not surprising AVG code heuristics don't have any safeguarding for it. Newer version of gdb like those in Code::Blocks should have no problem.

    BTW: You can add your whole project folder to the exception list of your anti-virus. You should add also gdb.exe. This if you want to keep dev-c++.
    Last edited by Mario F.; 08-06-2009 at 08:54 AM.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. a program that will call an execute but with arguments
    By what3v3r in forum C++ Programming
    Replies: 3
    Last Post: 01-19-2006, 09:44 PM
  2. Need help on code to execute the program
    By hibmem10 in forum C++ Programming
    Replies: 6
    Last Post: 12-24-2005, 01:42 PM
  3. Can't execute my program
    By bahruddina in forum C Programming
    Replies: 4
    Last Post: 07-13-2004, 11:19 PM
  4. simple frontend program problem
    By gandalf_bar in forum Linux Programming
    Replies: 16
    Last Post: 04-22-2004, 07:33 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21