|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
"extern" linking issues.
It's me and my silly errors again. This time it has to do with variable types.
This error originates from trying to use an "extern" variable extension to get data from the tracking.c file. This should theoretically work, but it doesn't. I get an error that reads (abridged): Fatal[151] -internal- populateExternalReferences() -symbol 'virtual_servo_tilt' is not an external reference. I declare both instances of the variable in each file, I used a .h file to declare the variable, and I include the .h file in both .c files. (For the record, it's tracking.h). You guys have been wonderfully patient with me, and I thank you people. |
|
#2
|
|||
|
|||
|
Re: "extern" linking issues.
go to the .c file that you are trying to get the data to and at the top, declare an extern variable that is the same name as the variable in the tracking.c file.
example: say in tracking.c i have a global variable called servo_position that i want to get to user_routines.c i just go to user routines and type: extern unsigned char servo_position; then i can use the variable in user_routines.c you do not put extern in front of the variable in tracking.c or else you will get an error |
|
#3
|
||||
|
||||
|
Re: "extern" linking issues.
You probably have something like "extern int myvariable;" in each file.
Note that you must also have "int myvariable" in one file (the owner of the variable) and it should be global and static in scope (not embedded in a function). Regards, Mike |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New NEMO White Papers! "Creating a Killer Packet" and "25 Ways to Sponsor" | Jessica Boucher | Team Organization | 0 | 10-08-2005 10:55 |
| Linking Errors: "section '????' can not fit the section. ..." | Astronouth7303 | Programming | 3 | 16-01-2005 21:36 |
| "Thunderbirds" Vs. "Team America" Which one will rule the box office? | Elgin Clock | Chit-Chat | 3 | 07-09-2004 19:53 |
| Conflict between "Initialize_Tracker()" and "pwm13 & pwm15"? Kevin? | gnormhurst | Programming | 3 | 22-02-2004 02:55 |
| how tall is the ramp when in "up" and "balanced" position??? | archiver | 2001 | 1 | 24-06-2002 00:54 |