Menu

Help:"unable to run program file"

chen
2002-12-08
2012-09-26
  • chen

    chen - 2002-12-08

    After compiled the code:
    #include<cstdlib>
    #include<iostream>
    using namespace std;
    int main()
    {
      cout<<"Hello world!"<<endl;
      system("pause");
      return 0;
    }
    the error takes place:"unable to run program file";
    please help me to solve this problem.Thanks :D.

     
    • Tao,Guo

      Tao,Guo - 2002-12-09

      I tried your codes, It's all right, and don't know what's wrong, maybe you need to reinstall you dev-c++.

       
    • Anonymous

      Anonymous - 2002-12-11

      If you install Dev-C++ under Program Files or under another directory with spaces in the names, when you go to the directories in Compiler Options, the directories names are splitted by the spaces so I have:

      C:\Program
      Files\Dev-C++\bin

      I changed them to the equivalent DOS name:
      C:\Progra~1\Dev-C++\bin

      but Dev-C++ doesn't seem to like it and when I try to compile I get an error "Unabe to run program file"

      I have the same problem with the include and lib directories so  gcc can't find the include files

       
    • Patrick Ogay

      Patrick Ogay - 2002-12-26

      It's the compiler path, which is no spezified correctly.
      If it's compiling on the commandline it also compiles from Dev-C++.
      May be you can also spezify a GCC,G++, make... path in the options.

      by the way, what's the diffence between
      Dev-C++ useres and Dev-C++ users.
      The postings here does'nt seem to be from Dev-C++ developers...
      An SW Developers are Users of Dev-C++?

      Patrick

       
    • Anonymous

      Anonymous - 2003-01-08

      I have the similar problem. I use win2k advanced server
      //code:
      #include<cstdlib>
      #include <iostream>

      using namespace std;

      int main()

      {

      cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";

      system("pause");
      return 0;

      }

      And there are many error message
      such as:
      77 E:\Dev-Cpp\include\c++\bits\fpos.hsyntax error before `(' token

       
    • Patrick Ogay

      Patrick Ogay - 2003-01-12

      refering to xuning:
      Rarely there are some installationproblems with the compiler.
      The message seems strange, If the headers are not found,  errors are going to be very weird.

      I use Win2K too, shouldn't be a problem to get in running.
      Check and set the paths, and report.
      Some people in the group advise also to uninstall and reinstall Dev, because the std-paths are not always initialized correctly.

      Pat

      P.S.
      Always indicate Dev-cpp & compiler version!

       
    • ventsislav velev

      xuning: this is because the compiler cannot include the needed files (iostream)
      I saw similar post on that forum.Someone was sugessting to add the following:
      C:\Dev-Cpp\include\c++\mingw32
      to the include path (from Options->Compiler Options)
      hope it will work for u

      I have the same problem with the make file. Dev cannot run the file because something is messed up with the make file.
      If u have idea whats wrong let me know :-)
      have fun

       
    • Anonymous

      Anonymous - 2003-02-15

      I have same problem. My C++ doesn`t even run example files included to the program. For example:
      #include <iostream.h>

      int
      main (int argc, char *argv[])
      {
          char quit; 

          quit = '\0';
          while (quit != 'q')
          {
              cout << "Hello ! This is a console app." << endl;
              cout << "To create a console, go to Project Options and select" << endl;
              cout << "\'Win32 Console\'." << endl;
              cout << "Press q to quit " << endl;
              cin >> quit;
          }

          return 0;
      }

      It gives errors like:
      >>>15 C:\Dev-Cpp\Examples\Hello\Hello.cpp
      `cin' undeclared (first use this
      >>>11 C:\Dev-Cpp\Examples\Hello\Hello.cpp
      `endl' undeclared (first use this
      >>>11 C:\Dev-Cpp\Examples\Hello\Hello.cpp
      (Each undeclared identifier is reported
      >>>11 C:\Dev-Cpp\Examples\Hello\Hello.cpp
      `cout' undeclared (first use this
      >>> C:\Dev-Cpp\Examples\Hello\Hello.cpp
      [Warning] In function `int main(int, char**)':
      >>>22 C:\Dev-Cpp\Examples\Hello\Hello.cpp:1
      iostream.h: No such file or directory.

      I use Dev-C++ 4.9.7.0 and run it on WinXP
      Is there anybody who could help me

       
    • Martin Gersten

      Martin Gersten - 2003-03-06

      I am also running Win XP and I am getting the same errors trying to compile the example Hello program.  I  read some of the other posts regarding this problem and tried all the fixes suggested, with no effect.

      I wonder if Win XP is not compatible with Dev-C?

       
    • Jon Edwards

      Jon Edwards - 2003-03-12

      Yes it is compatible with XP with regards to the cout undeclared, cin undeclared problems try adding this to the beginning of your file after the includes (i.e. #include <iostream> etc)
      but before  your main() loop

      using namespace std;

      hope this helps

      Jon

       
    • Anonymous

      Anonymous - 2003-03-31

      You will get the message "unable to run program file" when you install the executable only version of DevC++.
      This version doesn't include a compiler, and therefore the compiler program cannot be run, hence "unable to run program file".

      Also after installing Dev-C++ oven an existing installation, this problem occurs. Also when uninstalling 4.9.7.0 and then installing 4.9.8.0 in the same directory, you might get this error.

      I'm sure it can be fixed by fiddeling with the compiler options, but it's easier to just chose another directory, i.e. install Dev-C++ (the FULL version of course) to "C:\Program Files\Dev-C++" when your previous version was installed to "C:\Program Files\Dev-Cpp".

      I'm sure these installing/deinstalling/reinstalling - problems will be fixed in future releases. It's just a demo version, anyways.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.