CodeLite - Console runs but code is not working

房东的猫 提交于 2019-12-04 03:41:31

问题


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.



来源:https://stackoverflow.com/questions/24977112/codelite-console-runs-but-code-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!