GCC编译Ç错误,不被忽略,因为它空值应该是 [英] GCC C compile error, void value not ignored as it ought to be

查看:109
本文介绍了GCC编译Ç错误,不被忽略,因为它空值应该是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法编译一些C code。
当我编译,I'l得到这个错误:

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 ignored as it ought to be

这是code的错误:

static bool login(const char *username, const char *password) {
    sp_error err = sp_session_login(g_sess, username, password, remember_me);
    printf("Signing in...\n");
    if (SP_ERROR_OK != err) {
        printf("Could not signin\n");
        return 0;
    }
    return 1;
}

任何办法绕过这种错误的?结果
谢谢

Any way to bypass this kind of error?
Thanks

编辑:
以sp_所有功能都从libspotify

All sp_ functions are from libspotify

推荐答案

在哪里是错误行到底是什么?

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);

我猜sp_session_login正在返回的空白。

I guess sp_session_login is returning the void.

尝试:

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

这篇关于GCC编译Ç错误,不被忽略,因为它空值应该是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆