Thread: Linker Error
View Single Post
  #1   Spotlight this post!  
Unread 17-05-2004, 14:41
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Linker Error

I get the following error whenever i try to compile FRCcode with any variables declared in user_routines.h (in this case, "int bob;"):

MPLINK 3.40, Linker
Copyright (c) 2003 Microchip Technology Inc.
Error - symbol 'bob' has multiple definitions.
Errors : 1


I'm positive i don't have multiple definitions. It appears that user_routines.h is being included several times. i understand repeated #defines would be protected by the

Code:
#ifndef __user_program_h_
#define __user_program_h_
....
#endif

but how do i protect real code (not #define's) from being repeatedly inserted?

The program compiles fine with the variables in user_routines.c, i'd just prefer these global constants to be in the header for convenience.
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award