末我有以下代碼:錯誤:預期「}」在輸入
#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