Jump to content
43oh

Error #10056 when including headers


Recommended Posts

I'm trying to get some of Energia's digital pins functions to work with Olimex's MSP430-T5510, which uses a MSP430F5510 but I'm running into a bit of a pickle with a linking error. I've included the source file. Can you please have a look at it and see how including #include guards doesn't solve the problem? 

#10010 errors encountered during linking; 
#10056 symbol "port_to_output" redefined: first defined in "./DigitalPinsMap/PinFunctions.obj"; redefined in "./main.obj"	
#10056 symbol "port_to_dir" redefined: first defined in "./DigitalPinsMap/PinFunctions.obj"; redefined in "./main.obj"
#10056 symbol "digital_pin_to_bit_mask" redefined: first defined in "./DigitalPinsMap/PinFunctions.obj"; redefined in "./main.obj"
#10056 symbol "digital_pin_to_port" redefined: first defined in "./DigitalPinsMap/PinFunctions.obj"; redefined in "./main.obj"	
#10056 symbol "port_to_ren" redefined: first defined in "./DigitalPinsMap/PinFunctions.obj"; redefined in "./main.obj"
#10056 symbol "port_to_input" redefined: first defined in "./DigitalPinsMap/PinFunctions.obj"; redefined in "./main.obj"

Cheers.

Link to post
Share on other sites

The error complains that the symbol is redefined in main.c. I found that if I removed the included header file that was causing the problem from the main.c source file, the error disappear so my guess was that the variable was not defined properly. Reading through C tutorials on scope and linkage, the recommended way to declare and define a global variable is as follows:

 

For example, if I want to make a new constant integer variable called queues. The variable should be declared in a header file once and only once, and defined in a source file once:

 

Header1.h

//#include guards

extern const int queues;

//...

Source1.c

#include "Header1.h" //or whichever header the variable was declared in

const int queues = 5;

//the rest of the source file
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...