GCC C compile error, void value not ignored as it ought to be

前端 未结 5 1362
长情又很酷
长情又很酷 2020-12-20 15:40

I\'m having trouble compiling some C code. When I compile, I\'l get this error:

player.c: In function ‘login’:  
player.c:54:17: error: void value not igno         


        
5条回答
  •  长情又很酷
    2020-12-20 16:14

    Where is the error line exactly?

    Without further information, I'm guessing it's here:

    sp_error err = sp_session_login(g_sess, username, password, remember_me);
    

    I guess sp_session_login is returning the void.

    Try:

    static bool login(const char *username, const char *password) {
        sp_session_login(g_sess, username, password, remember_me);
        printf("Signing in...\n");
        return 1;
    }
    

提交回复
热议问题