-4

I am using CodeLite and code block to learn c++. When I run any c++ program, it only shows "Press any key to continue." I downloaded MinGW compiler and also llvm-clang compiler. I select both one by one and run program. It only shows "Press any key to continue". Can anyone help me understand why it happens?

Edit:1 // Added Code

This is my sample program.

#include <iostream>
#include <string>

int main(int argc, const char * argv[]) {
     std::cout << "Hello, World!";
    return 0;
}

Edit:2 // For more clarification

My program runs perfectly in Xcode. But I have a problem in Windows 7 32 bit with CodeLite and code block. Consider that I have installed Compiler and also made appropriate settings suggested by code block and CodeLite website.

Why does it only show "Press any key to continue."? Is there any problem with some setting or did I forget to set an environment variable or something else?

Pang
  • 9,564
  • 146
  • 81
  • 122
Rajesh Maurya
  • 3,026
  • 4
  • 19
  • 37

2 Answers2

0

This could happen if your executable path is not correct.

For CodeLite check the "Executable to Run/Debug" path and "Working Directory" path in your project settings.

For CodeBlocks check the "Execution working dir" and "Objects output dir" in your project properties - build targets.

The default setting should work without problems.

Bogdan
  • 461
  • 4
  • 10
0

After a lot of searching, i find the correct solution. The main problem was of 32 bit operation system. As the application suggest it works for 32 bits but i had the problem. So i format my windows 7 32 bit and installed windows 7 64 bit os and the problem is gone.

Rajesh Maurya
  • 3,026
  • 4
  • 19
  • 37