Thread: MPLink Error
View Single Post
  #2   Spotlight this post!  
Unread 01-02-2005, 23:00
probizzle's Avatar
probizzle probizzle is offline
Registered User
AKA: Prabhas Pokharel
#0639 (Code Red)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2003
Location: Ithaca
Posts: 78
probizzle will become famous soon enoughprobizzle will become famous soon enough
Send a message via AIM to probizzle
Re: MPLink Error

It is not a bug in the linker.

When you declare a long int in the header file, every time a .c includes this header file, space will be allocated for KP_P. Even if you have the #ifndef __header_file_name_h_ #define __header_file_name_h_ at the top of the file.

Here is the solution:

declare lont int KP_P in a .c file.
However, also
add
Quote:
extern long int KP_P;
in the header file.
Now, if you include this header file, you should be able to use KP_P.

Another comment:
the define doesn't show an error, because it is essentially a copy paste operation, and the compiler is smart enough to figure it out.
__________________
Code Red Team 639 Winners of the 2005 FingerLakes Regional with 191 and 494.
--
http://pset.deu83.com << my baby
http://www.setgame.com/set/ << it's mother