VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. Member
    Join Date
    Apr 2004
    Location
    Hudson, Florida
    Search Comp PM
    You guys are probably getting sick of me, but I'm back for more help. :P I've already gotten a little bit of help from one user, but I didn't want to bug him, so here goes. I just started getting in to C++, and I am having a problem compiling project from one of my tutorials. The code is:

    Code:
    #include <iostream>
    #include <stdlib.h>
    
    int main(int argc, char *argv[])
    {
      cout << "Hello, I am your computer talking." << endl; 
      system("PAUSE");	
      return 0;
    }
    The error I am getting is:

    Code:
    Line: 2
    File: 2 C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\C++ For Dummies Projects\FirstProject\2
    unable to run program file.
    Message: unable to run program file.
    The compilation log is:

    Code:
    Compiler: Default compiler
    Building Makefile: "C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\C++ For Dummies Projects\FirstProject\Makefile.win"
    Executing  make...
    make.exe -f "C:\Documents and Settings\Owner\My Documents\Visual Studio Projects\C++ For Dummies Projects\FirstProject\Makefile.win" all
    Execution terminated
    I've checked line 2, that is where the error is suppose to occur, however I am not noticing anything wrong with it. I'm using Dev-C++ 4.9.7.0 if it matters all that much. Any help will be appreciated, thanks again guys.
    Quote Quote  
  2. Member Devanshu's Avatar
    Join Date
    May 2003
    Location
    United States
    Search Comp PM


    Brings back painful memories from high school. Took it for 3 years and didnt learn a thing. :P

    It's been a while since I did C++ so I'm probably way off, but here goes. Isnt iostream supposed to be iostream.h? Also, dont you need add a string library to recognize your cout statement? Again, probably not the reason why it wont compile, but worth a shot.

    One more thing, I've found that borland is more user friendly than dev.
    Quote Quote  
  3. Member
    Join Date
    Jun 2002
    Location
    MO, US
    Search Comp PM
    At a guess I would say that "PAUSE" is not an executable. It's probably a built-in command in cmd.exe, which would mean that you could use it in .BAT scripts but not in a system() call.
    A man without a woman is like a statue without pigeons.
    Quote Quote  
  4. Member
    Join Date
    Apr 2004
    Location
    Hudson, Florida
    Search Comp PM
    Thanks for the responses so far guys, I am still a newbie to C++ though. The only thing I can pick up out of what you two guys said was to make
    Code:
    #include <iostream>
    into
    Code:
    #include <iostream.h>
    , and that doesn't seem to solve the problem. As for the Borland suggestion, would that be a fairly simple program to understand, the tutorial I am using does everything in Dev-C++.
    Quote Quote  
  5. Member
    Join Date
    Apr 2004
    Location
    Hudson, Florida
    Search Comp PM
    Oh guys, ran in to a problem. Borland's C++ Developer is for 6, not .Net, and my tutorial is for .Net, not 6.
    Quote Quote  
  6. Member
    Join Date
    Apr 2004
    Location
    Hudson, Florida
    Search Comp PM
    Problem solved, I think. Apparently Dev-C++ has a problem with being installed into a directory with spaces, well if you look at my other posts there were alot of spaces. Here is what I posted on bloodshed.net/forum:

    After uninstalling, reinstalling into a directory with no spaces, uninstalling and removing application data, and reinstalling in to a directory with no spaces all is good. Thanks guys.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!