• Advertisement
Sign in to follow this  

Multiple definition Error :(

This topic is 2062 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]I'm in the[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]process of creating[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]a program[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]to load[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]and display[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]the TGA files[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]and[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]I have these[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]errors[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]when[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]compiling[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]:[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- Multiple[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]definition[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]of[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]`[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]tgaheader[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]'[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- First[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]defined[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]here[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- Multiple[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]definition[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]of[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]`[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]tga[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]'[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- First[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]defined[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]here[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- Multiple[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]definition[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]of[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]`[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]uTGAcompare[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]'[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- First[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]defined[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]here[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- Multiple[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]definition[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]of[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]`[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]cTGAcompare[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]'[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- First[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]defined[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]here[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- Multiple[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]definition[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]of[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]`[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]tgaheader[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]'[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- First[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]defined[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]here[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- Multiple[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]definition[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]of[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]`[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]tga[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]'[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- First[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]defined[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]here[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- Multiple[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]definition[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]of[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]`[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]uTGAcompare[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]'[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- First[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]defined[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]here[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- Multiple[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]definition[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]of[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]`[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]cTGAcompare[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]'[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- First[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]defined[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]here[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]- D:[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]\[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Ivo[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]\[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Programming[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]\C[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]+[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]+\[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Projects\[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]3D[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Anim[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Test\[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Makefile.win[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)][[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Build[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Error][/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]["[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]3D][/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Error 1[/background][/font]

[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]It isn't[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]written,[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]where[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]there is an error[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)], but apparently[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]something has been[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]defined [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]several times[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)].[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]But[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]I checked[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]many times and[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]it turns out that[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]these variables[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]are defined[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]only once sad.png [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)].[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Can you help?[/background][/font]
[color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]P. S.[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]I am using the[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]compiler[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]Dev[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]C[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]+[/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)] [/background][/font][color=#333333][font=arial, sans-serif]

[background=rgb(245, 245, 245)]+[/background][/font]

Share this post


Link to post
Share on other sites
Advertisement
Are you including the same header file in multiple files ?

You may need to enclose the definitions in the header by a set of directives like so


#if !defined(SOME_CONSTANTE_OF_YOUR_CHOICE)
#define SOME_CONSTANTE_OF_YOUR_CHOICE
// Your definitions here ...
#endif


Event if those definitions are only found in one file, if the file is included in multiple other files (directly or indirectly), they will be difined multiple times.

I don't know Dev C++ nor the compiler you are using but #pragma once may also work.

I hope this helps. Edited by Laval B

Share this post


Link to post
Share on other sites

*quick version*


If you want the 'long' version you can check out Wikipedia (#include guards).

This is a pretty 'beginners' error? Perhaps you should check out some more C++ books/tutorials to prevent you from making mistakes like this again. (The more you known from the language, the more optimized and clean your code will be. I speak out of experience wink.png )

Share this post


Link to post
Share on other sites
We also need to be sure that these are multiple definition and not multiple declaration errors. All the header guards in the world won't prevent the linker crapping out if you declare a variable in a header that is included in more than one translation unit.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement