Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 926257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:39:21+00:00 2026-05-15T19:39:21+00:00

I am getting errors with the linker such as: osd.o(.ndata+0x514):C:\Documents and Settings\Thomas\My Documents\PIC\dsPIC33FJ128GP802\On Screen

  • 0

I am getting errors with the linker such as:

osd.o(.ndata+0x514):C:\Documents and Settings\Thomas\My Documents\PIC\dsPIC33FJ128GP802\On Screen Display\osd.c: multiple definition of `video_buff_vis_num'
main.o(.ndata+0x0):C:\Documents and Settings\Thomas\My Documents\PIC\dsPIC33FJ128GP802\On Screen Display\main.c: first defined here
osd.o(.ndata+0x515):C:\Documents and Settings\Thomas\My Documents\PIC\dsPIC33FJ128GP802\On Screen Display\osd.c: multiple definition of `video_buff_draw_num'
main.o(.ndata+0x1):C:\Documents and Settings\Thomas\My Documents\PIC\dsPIC33FJ128GP802\On Screen Display\main.c: first defined here
osd.o(.ndata+0x516):C:\Documents and Settings\Thomas\My Documents\PIC\dsPIC33FJ128GP802\On Screen Display\osd.c: multiple definition of `vid_format'
main.o(.ndata+0x2):C:\Documents and Settings\Thomas\My Documents\PIC\dsPIC33FJ128GP802\On Screen Display\main.c: first defined here
osd.o(.ndata+0x518):C:\Documents and Settings\Thomas\My Documents\PIC\dsPIC33FJ128GP802\On Screen Display\osd.c: multiple definition of `vid_line'
main.o(.ndata+0x4):C:\Documents and Settings\Thomas\My Documents\PIC\dsPIC33FJ128GP802\On Screen Display\main.c: first defined here

This is bugging me, because in the source code I have include guards around the only place these definitions could come from.

#ifndef OSD_H 
#define OSD_H 

// code here, including definitions for the above

#endif // OSD_H 

This is getting on my nerves. I’ve cleaned, rebuilt, and tried again. I even started a new project from scratch with the same files and I’m getting exactly the same problem! Would anyone please enlighten me on why this isn’t working! 🙂

Compiling with PIC-GCC v3.23 (a version of GCC for PIC24F/H and dsPIC30F/33F microcontrollers.)

Let me know if anyone wants to see the sources of more files. I didn’t want to overcrowd this page.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:39:21+00:00Added an answer on May 15, 2026 at 7:39 pm

    If you include this header in more than 1 .c file you will have multiple definitions. And you have main.c and osd.c.

    The .h is the right place for functions and extern data declarations. But for a variable you will have to pick one of the source files. the #defined guards don’t change that.

    Also see this question. And this answer describes the standard pattern .

    And a little more explanation/analysis:

    1) Each .c source file is compiled independently. The guards only protect from reading a header file twice during 1 compile.

    2) The error you are getting is a linker (not compiler) error.

    When your header defines a variable, the compiler will treat it as a definition in each separate run. The linker will detect the multiple instances.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting linker errors when I try to set this up. I'm using
I'm converting a project from vs2008 to vs2010 and getting linker errors for std:ifstream/ofstream
I keep getting errors that my functions have been defined multiple times. Of course
I'm trying to link to a static library and I keep getting linker errors.
I am getting this error: /Users/AppleMacbook/Documents/Tab/Tab/../../../Downloads/GDataXMLNode.h:38:24: error: libxml/tree.h: No such file or directory I
I am trying to compile the following code but I am getting linker errors.
I am getting linker errors that suggest I am not using #ifndef and #define.
I need help! I am getting following linker errors using g++: `__static_initialization_and_destruction_0(int, int)': undefined
I'm getting linker errors for one of the classes I created. 1>Dict.obj : error
I am getting unexpected linker errors after refactoring my solution from 1 to 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.