[SDL] error with 'multiple definition'
Will Langford
unfies at gmail.com
Tue Feb 13 13:38:45 PST 2007
If more than one file #include's A.H, each one will attempt to declare
std::string rem. Fine during compiling, but when it comes time to link, the
linker will see multiple things with the same name.
On 2/13/07, nathayan de los valles <semiogro at hotmail.com> wrote:
>
> Hi all,
> Perhaps this is not the best place to throw my doubt... but I have no
> friends who can answer me.
> I am using C++ and SDL.
> I have several files .h like this:
> A.h
> #ifndef A_H
> #define A_H
> #include <iostream>
> #include <sstream>
> #include <string>
> #include <fstream>
> std::string rem = "//";
> //more definitions
> #endif
>
> B.h
> #ifndef B_H
> #define B_H
> #include "A.h"
> //definitions
> #endif
>
> My compiler says me: multiple definition of 'rem'. I think my compiler
> doesn't run properly. Any idea?
>
> I use:
> Dev C++ 4.9.9.2 (I know there is more interesting information but I don't
> remember where to find it).
> Thanks in advance.
>
> _________________________________________________________________
> Horóscopo, tarot, numerología... Escucha lo que te dicen los astros.
> http://astrocentro.msn.es/
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070213/770a08bb/attachment.html
More information about the SDL
mailing list