Problem with c++ error n dont execute [W7 64xbit]

This is a discussion on Problem with c++ error n dont execute [W7 64xbit] within the C++ Programming forums, part of the General Programming Boards category; laserlight what exacly do u mean??.. its just a simple program.. i cant run it.. i need a solution.. i ...

  1. #16
    Registered User
    Join Date
    Dec 2010
    Posts
    14
    laserlight what exacly do u mean??.. its just a simple program.. i cant run it.. i need a solution.. i love programing.. if i can run a very simple program like this.. how i wan learn programing

  2. #17
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,265
    Quote Originally Posted by slambergamer
    laserlight what exacly do u mean??.. its just a simple program.. i cant run it..
    Well, here's a simple test. Copy this program to a file named myprogram.cpp:
    Code:
    #include <iostream>
    
    int main()
    {
        std::cout << "Hello world!" << std::endl;
    }
    Now, from an open command prompt window, at the directory where myprogram.cpp resides, run this command:
    Code:
    g++ -o myprogram myprogram.cpp
    Then run this command:
    Code:
    myprogram
    What happens?

    If the first command fails because g++ is not available, then you need to add the directory with g++ into your system path (you can find it somewhere in the Dev-C++ directory hierarchy).
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #18
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by slambergamer View Post
    laserlight what exacly do u mean??.. its just a simple program.. i cant run it.. i need a solution.. i love programing.. if i can run a very simple program like this.. how i wan learn programing
    What exactly do you do, to run the program? You've compiled it, you've got an executable sitting somewhere on your computer, now what? Do you click things? Do you type things? Do you use the power of your mind to make the program run? What?

  4. #19
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,655
    What's the over/under on the quickly disappearing window explanation?

  5. #20
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    682
    Quote Originally Posted by rags_to_riches View Post
    What's the over/under on the quickly disappearing window explanation?
    He probably double-clicks it and there is no command which waits for a key.

    when i press the *.exe nothing pop up... i got dl other c++ source file.. most of it.. have error..
    WHAT error?
    I never put signature, but I decided to make an exception.

  6. #21
    Registered User
    Join Date
    Dec 2010
    Posts
    14
    i can see the "hello world" text after typing the myprogram in my cmd...

  7. #22
    Registered User
    Join Date
    Dec 2010
    Posts
    14
    Quote:
    when i press the *.exe nothing pop up... i got dl other c++ source file.. most of it.. have error..
    WHAT error?
    alot of error... and each source code don have same error.. i dont realy know.. bcoz i newbis.. sory.. i will try again later

  8. #23
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,265
    Quote Originally Posted by slambergamer
    i can see the "hello world" text after typing the myprogram in my cmd...
    In that case, you have just compiled a C++ program that was run perfectly fine.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  9. #24
    Registered User
    Join Date
    Dec 2010
    Posts
    14
    but y i cant run it in myprogram.exe ..

    http://i559.photobucket.com/albums/s...bergamer/c.jpg ..here

  10. #25
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,265
    Observing the fact that you were unable to use g++ because you did not add its directory to the system path, I conclude that you first compiled using the compiler from your IDE?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  11. #26
    Registered User
    Join Date
    Dec 2010
    Posts
    14
    ok.. what is ide??.. sry for my lame -.-.. i use the dev++ to compile.. n i copy both file in same directory.. looking good if i run it from cmd.. do i need to run all my compiled source code in cmd ---?
    Last edited by slambergamer; 12-18-2010 at 12:13 AM.

  12. #27
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,265
    Dev-C++ is an IDE.

    Quote Originally Posted by slambergamer
    do i need to run all my compiled source code in cmd ---?
    Since it works for you, just do it.

    I suspect that you ran into the "disappearing command prompt" problem as was mentioned earlier in this thread, but somehow did not even see the command prompt flash by and disappear.

    The problem is that you told us that you ran your program from a command prompt, which usually indicates that you ran using a separate command prompt, rather than the one from your IDE, hence I ruled out this problem early on.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  13. #28
    Registered User
    Join Date
    Dec 2010
    Posts
    14
    ..oh sory my bad,.. im new.. n my english kinda bad -.-.. thx all.. i realy2x apperiate u guyz help!

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 06:20 AM
  2. Replies: 5
    Last Post: 12-03-2003, 05:47 PM
  3. Execute Problem
    By Marc Sharp in forum C Programming
    Replies: 4
    Last Post: 11-22-2003, 02:25 AM
  4. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 05:46 PM
  5. problem with output
    By Garfield in forum C Programming
    Replies: 2
    Last Post: 11-18-2001, 08:34 PM

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