Re: Linker error multiple definitions
From: E. Robert Tisdale (E.Robert.Tisdale_at_jpl.nasa.gov)
Date: 11/18/03
- Next message: tekenenSPAM_at_BUSThotmailE.Rcom: "Re: Asking if elements in struct arre zero"
- Previous message: Thomas Matthews: "Re: How do you save input in a text file?"
- In reply to: Andrew: "Linker error multiple definitions"
- Next in thread: Andrew: "Re: Linker error multiple definitions"
- Reply: Andrew: "Re: Linker error multiple definitions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 18 Nov 2003 08:29:53 -0800
Andrew wrote:
> I am receiving a multiple definition error from the linker
> when I try to build a project I am working on.
> The message states that the functions I that defined
> within an external .c source file are already defined
> in the main program .obj file.
> I declared the functions in separate header files
Are you sure that you didn't actually *define* the function
in the header files?
> and used the pre-processor conditional #ifndef FILE_H
> to make sure each header is only included once.
But your compiler isn't complaining about multiple *declarations*.
It is complaining about multiple *definitions*.
You can *declare* a function multiple times
but it should only be *defined* once.
> Each .c source file includes the associated header as does the
> main .c file which calls the functions. I know I have done this before
> without any problems, but am I missing a step? Thanks for any help.
- Next message: tekenenSPAM_at_BUSThotmailE.Rcom: "Re: Asking if elements in struct arre zero"
- Previous message: Thomas Matthews: "Re: How do you save input in a text file?"
- In reply to: Andrew: "Linker error multiple definitions"
- Next in thread: Andrew: "Re: Linker error multiple definitions"
- Reply: Andrew: "Re: Linker error multiple definitions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|