CodeLite - Console runs but code is not working

2019-02-23 01:42发布

问题:

I just installed CodeLite 6.0 in two of my PC's, however in both of these computers I get the same issue: I am able to build and run the project, but when the console starts running all I see is:

This is my code:

#include <stdio.h>

int main(int argc, char **argv)
{
    printf("hello world\n");
    return 0;
}

and if I try to add some crazy instruction that actually doesn't exist, console will still show up with no errors and the project will build with no errors, too. For example, using the following code:

#include <stdio.h>

int main(int argc, char **argv)
{
    printf("hello world\n");
    notrealcode<<"hi";
    return 0;
}

and cout << "Hello World" isn't working either.

回答1:

I am pretty sure you are not having a compiler installed. See this tutorial to know how to choose and add a compiler: http://codelite.org/AddNewCompiler/AddNewCompiler



回答2:

here is how you write this code. try it !

#include<iostream>
using namespace std;
int main()
{
cout<<"Hello world"<<endl;
}


回答3:

I had a similar issue due to missing libstdc++-6.dll file. There were no errors or warnings when I build and run the program. But the output console was empty. Application was not even crashing when I intentionally introduced 1/0 error.

Issue got resolved after copying libstdc++-6.dll file to the directory which has the .exe file.