错误:在'*'标记之前的预期'=',',',';','asm'或'__attribute__' [英] error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

查看:96
本文介绍了错误:在'*'标记之前的预期'=',',',';','asm'或'__attribute__'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我对Unix非常非常陌生,但是对C很有经验.我不确定此消息是否适合Unix论坛(如果有)或C.但是,由于这是一个编译错误,我感到最适合这里.

我对名为ioquake3的程序进行了"make"编译.我得到这些错误.我试图用谷歌搜索它们.看来这些错误是由双重包含或类似问题引起的.
我无休止地尝试看看如何对代码进行写入编辑.但是,我无法修复.

提前谢谢您.

代码:

Hello,
I am very very very new to Unix, but experienced in C. I wasn''t sure whether this Message fits the Unix forum (if there''s one), or C. But, since it is a compiling Error, I felt it fits here best.

I did a "make", compilation, to a program called ioquake3. I get these errors. I tried to google them. It seems that these errors are caused by double inclusions, or something of the sort.
I tried endlessly to see how to make the write edits to the code. But, I couldn''t fix it.

Thank you in advance.

Code:

#include <stdio.h>
#include "../qcommon/q_shared.h"
#include "../qcommon/qcommon.h"

#ifdef WIN32
#define DEFAULT_CURL_LIB "libcurl-3.dll"
#elif defined(MACOS_X)
#define DEFAULT_CURL_LIB "libcurl.dylib"
#else
#define DEFAULT_CURL_LIB "libcurl.so.4"
#define ALTERNATE_CURL_LIB "libcurl.so.3"
#endif

#ifdef USE_LOCAL_HEADERS
  //#include <../libcurl/curl/curl.h>
#else
  //#include <../libcurl/curl/curl.h>
#endif


#ifdef USE_CURL_DLOPEN
extern char* (*qcurl_version)(void);
extern cvar_t *cl_cURLLib;
extern CURL* (*qcurl_easy_init)(void);
extern CURLcode (*qcurl_easy_setopt)(CURL *curl, CURLoption option, ...);
extern CURLcode (*qcurl_easy_perform)(CURL *curl);
extern void (*qcurl_easy_cleanup)(CURL *curl);
extern CURLcode (*qcurl_easy_getinfo)(CURL *curl, CURLINFO info, ...);
extern void (*qcurl_easy_reset)(CURL *curl);
extern const char *(*qcurl_easy_strerror)(CURLcode);

extern CURLM* (*qcurl_multi_init)(void);
extern CURLMcode (*qcurl_multi_add_handle)(CURLM *multi_handle,
						CURL *curl_handle);
extern CURLMcode (*qcurl_multi_remove_handle)(CURLM *multi_handle,
						CURL *curl_handle);
extern CURLMcode (*qcurl_multi_fdset)(CURLM *multi_handle,
						fd_set *read_fd_set,
						fd_set *write_fd_set,
						fd_set *exc_fd_set,
						int *max_fd);
extern CURLMcode (*qcurl_multi_perform)(CURLM *multi_handle,
						int *running_handles);
extern CURLMcode (*qcurl_multi_cleanup)(CURLM *multi_handle);
extern CURLMsg *(*qcurl_multi_info_read)(CURLM *multi_handle,
						int *msgs_in_queue);
extern const char *(*qcurl_multi_strerror)(CURLMcode);
#else
#define qcurl_version curl_version

#define qcurl_easy_init curl_easy_init
#define qcurl_easy_setopt curl_easy_setopt
#define qcurl_easy_perform curl_easy_perform
#define qcurl_easy_cleanup curl_easy_cleanup
#define qcurl_easy_getinfo curl_easy_getinfo
#define qcurl_easy_duphandle curl_easy_duphandle
#define qcurl_easy_reset curl_easy_reset
#define qcurl_easy_strerror curl_easy_strerror

#define qcurl_multi_init curl_multi_init
#define qcurl_multi_add_handle curl_multi_add_handle
#define qcurl_multi_remove_handle curl_multi_remove_handle
#define qcurl_multi_fdset curl_multi_fdset
#define qcurl_multi_perform curl_multi_perform
#define qcurl_multi_cleanup curl_multi_cleanup
#define qcurl_multi_info_read curl_multi_info_read
#define qcurl_multi_strerror curl_multi_strerror
#endif

qboolean CL_cURL_Init( void );
void CL_cURL_Shutdown( void );
void CL_cURL_BeginDownload( const char *localName, const char *remoteURL );
void CL_cURL_PerformDownload( void );
void CL_cURL_Cleanup( void );</stdio.h>



错误:



Errors:

make[2]: `build/release-linux-x86_64/ioq3ded.x86_64' is up to date.
CC code/client/cl_cgame.c
In file included from code/client/cl_cgame.c:24:
code/client/client.h:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
code/client/client.h:41: error: expected declaration specifiers or '...' before '*' token
code/client/client.h:41: error: expected ')' before '*' token
code/client/client.h:42: error: expected declaration specifiers or '...' before '*' token
code/client/client.h:42: error: expected ')' before '*' token
code/client/client.h:43: error: expected ')' before '*' token
code/client/client.h:44: error: expected declaration specifiers or '...' before '*' token
code/client/client.h:44: error: expected ')' before '*' token
code/client/client.h:45: error: expected ')' before '*' token
code/client/client.h:46: warning: parameter names (without types) in function declaration
code/client/client.h:48: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
code/client/client.h:49: error: expected declaration specifiers or '...' before '*' token
code/client/client.h:49: error: expected ')' before '*' token
code/client/client.h:51: error: expected declaration specifiers or '...' before '*' token
code/client/client.h:51: error: expected ')' before '*' token
code/client/client.h:53: error: expected declaration specifiers or '...' before '*' token
code/client/client.h:53: error: expected ')' before '*' token
code/client/client.h:58: error: expected declaration specifiers or '...' before '*' token
code/client/client.h:58: error: expected ')' before '*' token
code/client/client.h:60: error: expected declaration specifiers or '...' before '*' token
code/client/client.h:60: error: expected ')' before '*' token
code/client/client.h:61: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
code/client/client.h:63: warning: parameter names (without types) in function declaration
In file included from code/client/cl_cgame.c:24:
code/client/client.h:264: error: expected specifier-qualifier-list before 'CURL'
code/client/cl_cgame.c: In function 'CL_GetServerCommand':
code/client/cl_cgame.c:276: error: 'clientConnection_t' has no member named 'demoplaying'
code/client/cl_cgame.c: In function 'CL_InitCGame':
code/client/cl_cgame.c:751: error: 'clientConnection_t' has no member named 'demoplaying'
code/client/cl_cgame.c: In function 'CL_CGameRendering':
code/client/cl_cgame.c:799: error: 'clientConnection_t' has no member named 'demoplaying'
code/client/cl_cgame.c: In function 'CL_AdjustTimeDelta':
code/client/cl_cgame.c:834: error: 'clientConnection_t' has no member named 'demoplaying'
code/client/cl_cgame.c: In function 'CL_FirstSnapshot':
code/client/cl_cgame.c:900: error: 'clientConnection_t' has no member named 'timeDemoBaseTime'
code/client/cl_cgame.c:919: error: 'clientConnection_t' has no member named 'speexInitialized'
code/client/cl_cgame.c:921: error: 'clientConnection_t' has no member named 'speexEncoderBits'
code/client/cl_cgame.c:922: error: 'clientConnection_t' has no member named 'speexEncoderBits'
code/client/cl_cgame.c:924: error: 'clientConnection_t' has no member named 'speexEncoder'
code/client/cl_cgame.c:926: error: 'clientConnection_t' has no member named 'speexEncoder'
code/client/cl_cgame.c:927: error: 'clientConnection_t' has no member named 'speexFrameSize'
code/client/cl_cgame.c:928: error: 'clientConnection_t' has no member named 'speexEncoder'
code/client/cl_cgame.c:929: error: 'clientConnection_t' has no member named 'speexSampleRate'
code/client/cl_cgame.c:931: error: 'clientConnection_t' has no member named 'speexPreprocessor'
code/client/cl_cgame.c:931: error: 'clientConnection_t' has no member named 'speexFrameSize'
code/client/cl_cgame.c:932: error: 'clientConnection_t' has no member named 'speexSampleRate'
code/client/cl_cgame.c:935: error: 'clientConnection_t' has no member named 'speexPreprocessor'
code/client/cl_cgame.c:939: error: 'clientConnection_t' has no member named 'speexPreprocessor'
code/client/cl_cgame.c:943: error: 'clientConnection_t' has no member named 'speexDecoderBits'
code/client/cl_cgame.c:944: error: 'clientConnection_t' has no member named 'speexDecoderBits'
code/client/cl_cgame.c:945: error: 'clientConnection_t' has no member named 'speexDecoder'
code/client/cl_cgame.c:946: error: 'clientConnection_t' has no member named 'voipIgnore'
code/client/cl_cgame.c:947: error: 'clientConnection_t' has no member named 'voipGain'
code/client/cl_cgame.c:949: error: 'clientConnection_t' has no member named 'speexInitialized'
code/client/cl_cgame.c:950: error: 'clientConnection_t' has no member named 'voipMuteAll'
code/client/cl_cgame.c:953: error: 'clientConnection_t' has no member named 'voipTarget1'
code/client/cl_cgame.c:953: error: 'clientConnection_t' has no member named 'voipTarget2'
code/client/cl_cgame.c:953: error: 'clientConnection_t' has no member named 'voipTarget3'
code/client/cl_cgame.c: In function 'CL_SetCGameTime':
code/client/cl_cgame.c:969: error: 'clientConnection_t' has no member named 'demoplaying'
code/client/cl_cgame.c:972: error: 'clientConnection_t' has no member named 'firstDemoFrameSkipped'
code/client/cl_cgame.c:973: error: 'clientConnection_t' has no member named 'firstDemoFrameSkipped'
code/client/cl_cgame.c:1006: error: 'clientConnection_t' has no member named 'demoplaying'
code/client/cl_cgame.c:1045: error: 'clientConnection_t' has no member named 'demoplaying'
code/client/cl_cgame.c:1061: error: 'clientConnection_t' has no member named 'timeDemoStart'
code/client/cl_cgame.c:1062: error: 'clientConnection_t' has no member named 'timeDemoStart'
code/client/cl_cgame.c:1062: error: 'clientConnection_t' has no member named 'timeDemoLastFrame'
code/client/cl_cgame.c:1063: error: 'clientConnection_t' has no member named 'timeDemoMinDuration'
code/client/cl_cgame.c:1064: error: 'clientConnection_t' has no member named 'timeDemoMaxDuration'
code/client/cl_cgame.c:1067: error: 'clientConnection_t' has no member named 'timeDemoLastFrame'
code/client/cl_cgame.c:1068: error: 'clientConnection_t' has no member named 'timeDemoLastFrame'
code/client/cl_cgame.c:1071: error: 'clientConnection_t' has no member named 'timeDemoFrames'
code/client/cl_cgame.c:1073: error: 'clientConnection_t' has no member named 'timeDemoMaxDuration'
code/client/cl_cgame.c:1074: error: 'clientConnection_t' has no member named 'timeDemoMaxDuration'
code/client/cl_cgame.c:1076: error: 'clientConnection_t' has no member named 'timeDemoMinDuration'
code/client/cl_cgame.c:1077: error: 'clientConnection_t' has no member named 'timeDemoMinDuration'
code/client/cl_cgame.c:1083: error: 'clientConnection_t' has no member named 'timeDemoDurations'
code/client/cl_cgame.c:1083: error: 'clientConnection_t' has no member named 'timeDemoFrames'
code/client/cl_cgame.c:1087: error: 'clientConnection_t' has no member named 'timeDemoFrames'
code/client/cl_cgame.c:1088: error: 'clientConnection_t' has no member named 'timeDemoBaseTime'
code/client/cl_cgame.c:1088: error: 'clientConnection_t' has no member named 'timeDemoFrames'
make[2]: *** [build/release-linux-x86_64/client/cl_cgame.o] Error 1
make[2]: Leaving directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/best_linux_20111012/ioquake3dev_clean'
make[1]: *** [targets] Error 2
make[1]: Leaving directory `/r/home7/yasir/minoru/cfe2/yasirTemp/ioquake3dev/best_linux_20111012/ioquake3dev_clean'
make: *** [release] Error 2



语言C
Linux



Language C
Linux

推荐答案

#ifdef USE_LOCAL_HEADERS
  //#include <../libcurl/curl/curl.h>
#else
  //#include <../libcurl/curl/curl.h>
#endif



您已注释掉任何包含CURL定义的内容.可能是编译器告诉您类似以下内容:



You commented out any includes for the CURL definitions. Could it be that the compiler is telling you that things like:

extern CURL* (*qcurl_easy_init)(void);

使用的是未定义类型(CURL).当在不确定的地方未定义内容时,编译器很容易感到困惑并发出各种奇怪的错误消息.

are using undefined types (CURL). Compilers can easily get confused and spew all sorts of strange error messages when things are undefined in odd places.


这篇关于错误:在'*'标记之前的预期'=',',',';','asm'或'__attribute__'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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