C compile error: Id returned 1 exit status

前端 未结 11 1121
忘掉有多难
忘掉有多难 2020-12-06 18:25

For some reason, when I try compiling a program, the compiler says permission denied and Id returned 1 exit status. Could anyone tell me what that means? Thank you

11条回答
  •  忘掉有多难
    2020-12-06 19:01

    This answer is written for C++ developers, because I was haunted by such problem as one. Here is the solution:

    Instead of

    main()
    {
    
    }
    

    please type

    int main()
    {
    
    }
    

    so the main function can be executed.

    By the way, if you compile a C/C++ source file with no main function to execute, there will definitely be a bug message saying:

    "[Error] Id returned 1 exist status"

    But sometimes we just don't need main function in the file, in such a case, just ignore the bug message.

提交回复
热议问题