Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linkage error

Status
Not open for further replies.

powerb23

Technical User
Sep 11, 2003
11
0
0
US
Hi,
I was wondering what causes this error:
'isPrime' was declared implicitly 'extern' and later static

if i had my declarations as

static int isPrime(int n){
...
}

int doSomething(int m){
...
if (!isPrime(5))
/* do something */

}

Your help will be appreciated
 
> 'isPrime' was declared implicitly 'extern' and later static
I guess your prototype says
int isPrime(int n);

Where it should say
static int isPrime(int n);


--
 
extern and static are mutually exclusive specifiers.
static means module scope name and extern declare a global (program, inter-module) scope name...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top