error: expected ‘}’ at end of input
I have the following code:
#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_co开发者_JAVA百科nsumer_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;
}
and the only thing preventing it from compiling is the error message specified in the title of this question. The problem line has been identified as the closing brace of the main
function, but that obviously isn't the case, and I can't see where else I could have missed out any parentheses. Can anyone else spot what I'm doing wrong here?
In case of such errors it is good idea to localize error. You can do it simply, by commenting blocks of code.
In this example you can comment body get_credentials
function and check what will happen.
Also good idea to paste empty line at the end of source code file.
Maybe some of the included headers has mismatched braces.
Maybe the compiler is bad at handling files with non-empty last line, and there is such line in some of the files.
Try commenting out as much as you can (especially all includes) to make it compile, and then putting code back in until you localize the problem.
精彩评论