末我有以下代码:错误:预期“}”在输入
#include <libubuntuone-1.0/u1-music-store.h>
#include <libsyncdaemon-1.0/libsyncdaemon/syncdaemon-authentication.h>
#include <libsyncdaemon-1.0/libsyncdaemon/syncdaemon-credentials.h>
#include <libsyncdaemon-1.0/libsyncdaemon/syncdaemon-daemon.h>
static void
get_credentials (U1MusicStore *music_store,
gchar **oauth_consumer_token,
gchar **oauth_consumer_secret,
gchar **oauth_token,
gchar **oauth_token_secret)
{
SyncdaemonCredentials *credentials;
*oauth_consumer_token = *oauth_consumer_secret = *oauth_token = *oauth_token_secret = NULL;
*oauth_consumer_token = g_strdup (syncdaemon_credentials_get_consumer_key (credentials));
*oauth_consumer_secret = g_strdup (syncdaemon_credentials_get_consumer_secret (credentials));
*oauth_token = g_strdup (syncdaemon_credentials_get_token (credentials));
*oauth_consumer_secret = g_strdup (syncdaemon_credentials_get_token_secret (credentials));
}
int main()
{
return 0;
}
和唯一阻止它编译在这个问题的标题指定的错误消息。问题行已被确定为main
函数的大括号,但显然不是这种情况,并且我看不到其他任何括号。任何人都可以发现我在这里做错了吗?
我没有看过所有上面的代码,但也请检查您的头文件。你确定他们都好吗? – 2011-06-15 22:00:36
如果您注释掉'get_credentials()'的主体,它会编译吗?实际上更进一步,注释掉除#include头之外的所有内容。这些头文件应该自行编译,否则可能会在某处出现“{”字符。 – greatwolf 2011-06-15 22:00:46
你能发布整个错误吗? – Suroot 2011-06-15 22:01:46