By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 1,964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘extern’

P: 12
Hi,
I am using gcc (GCC) 4.2.1 (SUSE Linux).
SUSE 10.3

While compiling a .c file I get following error ::::



CCWebConfiguration.h:70: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘extern’
CCWebBrowser.c: In function ‘main’:
CCWebBrowser.c:134: error: ‘CUSTOMERCENTRAL_HEADER_TEXT’ undeclared (first use in this function)
CCWebBrowser.c:134: error: (Each undeclared identifier is reported only once
CCWebBrowser.c:134: error: for each function it appears in.)
CCWebBrowser.c:180: warning: incompatible implicit declaration of built-in function ‘strlen’
CCWebBrowser.c:185: warning: incompatible implicit declaration of built-in function ‘strcpy’
CCWebBrowser.c:241: warning: incompatible implicit declaration of built-in function ‘strlen’
CCWebBrowser.c:311: error: ‘iDumpLevel’ undeclared (first use in this function)
CCWebBrowser.c:616: warning: cast to pointer from integer of different size
CCWebBrowser.c:645: warning: incompatible implicit declaration of built-in function ‘strcpy’
CCWebBrowser.c:646: warning: incompatible implicit declaration of built-in function ‘strlen’


can anybody help me out.
Thanks
Aug 4 '08 #1
Share this Question
Share on Google+
7 Replies


Expert 10K+
P: 11,448
Without seeing any code I guess that you've made a typo at, or before line 70 in
your .h file; you also forgot to #include <string.h> n your .c file.

kind regards,

Jos

ps. next time also include some relevant code and not just those error messages.
We don't like to guess here. Also please use the proper code tags for readability.
Aug 4 '08 #2

P: 12
Without seeing any code I guess that you've made a typo at, or before line 70 in
your .h file; you also forgot to #include <string.h> n your .c file.

kind regards,

Jos

ps. next time also include some relevant code and not just those error messages.
We don't like to guess here. Also please use the proper code tags for readability.


after adding <string.h> I am now not getting any warning regarding strlen,strcpy etc. but I still facing following error

CCWebBrowser.c:135: error: ‘CUSTOMERCENTRAL_HEADER_TEXT’ undeclared (first use in this function)
CCWebBrowser.c:135: error: (Each undeclared identifier is reported only once
CCWebBrowser.c:135: error: for each function it appears in.)
CCWebBrowser.c:312: error: ‘iDumpLevel’ undeclared (first use in this function)
CCWebBrowser.c:617: warning: cast to pointer from integer of different size




#ifndef CCWB_CONFIGURATION
#define CCWB_CONFIGURATION

#define CUSTOMERCENTRAL_VERSION_TEXT "V078 09/20/2005 00:00"

#ifdef CUSTOMERCENTRAL_V10
#define CUSTOMERCENTRAL_HEADER_TEXT "Customer Central All Rights Reserved.\n"
#else
ERROR_INVALID_CUSTOMERCENTRAL_VERSION
#endif

#define CUSTOMERCENTRAL_OPENSSL_VERSION_TEXT "OpenSSL v0.9.8"
#define CUSTOMERCENTRAL_ICU_VERSION_TEXT "ICU v3,4"

#ifdef TWB_CONFIGURATION_ALLOCATE

int iDumpLevel = 0;
int iDebug = 0;
int iConfigurationLogLevelOverride = 0;
int iConfigurationSessionTimeOutOverride = 0;

int iConfigurationGWWait = 15 * 60;

static char *pConfigurationBuffer = 0;

FILE *fileLogFile = 0;
int iLogFileLock = 0;
int iConfigurationLogFileDays = 10;

char *pszConfigurationHomeDir;
char *pszConfigurationLogFile;
int iConfigurationLogLevel = 0;
int iConfigurationSessionTimeOut = 60;
int iConfigurationRequestTimeOut = 120;

int iConfigurationActiveSessionsDelayThresholdType = 0; // 0=% 1=Value
int iConfigurationActiveSessionsDelayThreshold = 25; // 25%

//efine COUNT_WAIT_FOR_GATEWAY 9

int iConfigurationProxy = 0;
int iConfigurationProxyPort = 0;
char *pszConfigurationProxyHost = 0;
char *pszConfigurationProxyLocalDomain = 0;
char *pszConfigurationProxyLogin = 0;

int iConfigurationSSLCertificateCheck = 0;
int iConfigurationURLDomainCheck = 0;

#ifdef WIN32
#define PATH_SEPARATOR "\\"
#define DEFAULT_HOME_DIR "\\"
#define DEFAULT_LOGFILE_PATH "CustomerCentral\\log"
#endif
#ifdef UNIX
#define PATH_SEPARATOR "/"
#define DEFAULT_HOME_DIR "/"
#define DEFAULT_LOGFILE_PATH "CustomerCentral/log"
#endif
#define DEFAULT_LOGFILE_NAME "CCWebBrowser"

#else

extern int iDumpLevel;
extern int iDebug;
extern int iConfigurationLogLevelOverride;
extern int iConfigurationSessionTimeOutOverride;

extern int iConfigurationGWWait;

extern FILE *fileLogFile;
extern int iLogFileLock;
extern int iConfigurationLogFileDays;

extern const char *pszConfigurationHomeDir;
extern const char *pszConfigurationLogFile;
extern const int iConfigurationLogLevel;
extern const int iConfigurationSessionTimeOut;
extern const int iConfigurationRequestTimeOut;

extern const int iConfigurationActiveSessionsDelayThresholdType;
extern const int iConfigurationActiveSessionsDelayThreshold;

extern const int iConfigurationProxy;
extern const int iConfigurationProxyPort;
extern const char *pszConfigurationProxyHost;
extern const char *pszConfigurationProxyLocalDomain;
extern const char *pszConfigurationProxyLogin;

extern const int iConfigurationSSLCertificateCheck;
extern const int iConfigurationURLDomainCheck;
#endif

/************************************************** ***************************/
/* CCWebConfiguration */
/************************************************** ***************************/

unsigned int CCWebConfiguration(
char *pszIPAddress, // > Gateway HostName/IP Address
int iPort, // > Gateway Port Number
char *pszProxyHost, // > Proxy Host
int iProxyPort // > Proxy Port Number
);

unsigned int CCWebConfigurationTermination(
char *pszIPAddress, // > Gateway HostName/IP Address
int iPort, // > Gateway Port Number
unsigned int uiTerminatingEP // > Terminating EP
);

unsigned int CCWebConfigurationLogFile(
);

#endif
Aug 4 '08 #3

gpraghuram
Expert 100+
P: 1,275
What command you use to compile the code....
Are you specifying the _D option for this CUSTOMERCENTRAL_V10
as there is a #ifdef in your code


Raghu
Aug 4 '08 #4

P: 12
gcc -c file_name.c

Please suggest some useful ways.
Aug 4 '08 #5

P: 12
I am unable to figure out typo mistake can u please suggest ...


Without seeing any code I guess that you've made a typo at, or before line 70 in
your .h file; you also forgot to #include <string.h> n your .c file.

kind regards,

Jos

ps. next time also include some relevant code and not just those error messages.
We don't like to guess here. Also please use the proper code tags for readability.
Aug 4 '08 #6

Expert 10K+
P: 11,448
I am unable to figure out typo mistake can u please suggest ...
Carefully read that line 70 and before; there is a typo in there somewhere. I am
not your corrector, you have to do it yourself. A keyword 'extern' wasn't expected
at that particular location.

kind regards,

Jos
Aug 4 '08 #7

100+
P: 687
Expand|Select|Wrap|Line Numbers
  1. #ifdef CUSTOMERCENTRAL_V10
  2. #define CUSTOMERCENTRAL_HEADER_TEXT "Customer Central All Rights Reserved.\n"
  3. #else
  4. ERROR_INVALID_CUSTOMERCENTRAL_VERSION
  5. #endif
  6. ....
  7. extern int foo;
  8.  
you have not defined that _v10 stuff, hence not defined HEADER_TEXT ( error ) and have stray ERROR_INVALID_... in your code before #else and #endif, the rest ( ...) is ifdef-ed and you end up with
Expand|Select|Wrap|Line Numbers
  1. ERROR_INVALID_CUSTOMERCENTRAL_VERSION extern int foo;
compiler objects - in doesn't like ERROR_INVALID before extern.
Aug 4 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.