473,241 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

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

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
7 70182
JosAH
11,448 Expert 8TB
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
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
1,275 Expert 1GB
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
gcc -c file_name.c

Please suggest some useful ways.
Aug 4 '08 #5
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
JosAH
11,448 Expert 8TB
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
newb16
687 512MB
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

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

Similar topics

3
by: Per Johansson | last post by:
Compiling code using GCC 3.2.2 with the following function declaration give this error. extern void APIENTRY glutDisplayFunc (void (* APIENTRY)(void)); Changing to: extern void APIENTRY...
1
by: DiskMan | last post by:
System: Redhat 7.2 Kernel-2.6.11.8 GCC-3.4.3 CCC-6.5.9 Binutils-2.15 Make-3.80 GTK/GLIB-2.6.7 For some reason my Linux box is suddenly having issues trying to read ;
4
by: jakkem | last post by:
For example the following gives me error "expected `(' before '{' token" "expected asm body before '{' token " etc. int main() { asm { /* some asm-functions */ } }
3
by: SpreadTooThin | last post by:
I am trying to figure out why I am getting this error: I define a type in a header file. I include that file. typedef struct x * xref; I include it in my class class myclass { xref xr;
3
by: creativeinspiration | last post by:
Hey guys. I am trying to implement a system call in linux kernel. I usually use ubutntu, but this I am doing on Fedora. I am using kernel 2.6. Here is what I did: 1. Added a line to...
1
by: m.selvakannan | last post by:
hi iam working with uclinux i got errors while compilation.. /opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/include/asm/ system.h: In function 'long unsigned int __cmpxchg(volatile void*,...
2
by: entellus | last post by:
I'm using gcc to compile the code listed below when I get the following error error: expected '=', ',', ';', 'asm' or '__attribute__' before ' is_prime_number /* * What is the largest...
2
by: akhilesh.noida | last post by:
I am trying to compile glibc-2.5 for ARM based board. But I am getting errors while configuring it. Please check and give your inputs for resolving this. configure command : $...
10
by: anju1401 | last post by:
Hi I am using WINAVR compiler for ATMEGA32. While compiling c progam , I am getting the error error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before '{' token before evrey function. ...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.