473,386 Members | 1,775 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,386 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 70228
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.