【发布时间】:2011-09-15 22:22:06
【问题描述】:
我有以下代码:
#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 函数的右括号,但显然不是这种情况,我看不出还有什么地方可以错过任何括号。其他人可以在这里发现我做错了什么吗?
【问题讨论】:
-
上面的代码我还没有读完,但也请检查你的头文件。你确定他们都没事吗?
-
注释掉
get_credentials()的正文是否编译?实际上更进一步,注释掉除#include headers之外的所有内容。标头应自行编译,否则可能会在某处出现杂散的“{”。 -
你能发布整个错误吗?
-
@Brian,谢谢,我现在检查一下。 @Victor,不,它仍然失败。我要检查头文件。我没有检查它们,因为它们不是我编写的,并且已经在生产代码中使用,所以我只是假设它们会很好。
标签: c++ compiler-errors syntax-error