| re: Passing Through Constructor - Simple Error
GRoll35 wrote:[color=blue]
> yes you are right it made no sense. so i changed the class to move.
> then in the driver i created the object theMovies by doing this.
>
> move theMovies(userAge);
>
> so here is my header file. the bottom is the errors i get now.
>
> #ifndef HEADER_H
> #define HEADER_H
>
> class move
> {
> private:
> int age;
> int ticket;
>
> public:
> move();
> move(int);
> int getAge();
> };
>
> #endif
>
>
> Movie1 fatal error LNK1169: one or more multiply defined symbols found
> Movie1 error LNK2005: "public: int __thiscall move::getAge(void)"
> (?getAge@move@@QAEHXZ) already defined in Driver.obj
> Movie1 error LNK2005: "public: __thiscall move::move(int)"
> (??0move@@QAE@H@Z) already defined in Driver.obj
>
> any idea what thats saying. again, I appologize for my lack of
> knowledge and appreciate your help.[/color]
You probably compiled your '.cc' files separately, and then linked them
together to form your final program. But remember, you included the
implementation file into the driver? You used #include, remember? Why?
If you include the text of one source file into the other source file,
do not compile the one you included, separately. Otherwise, do not
include the other one, just compile them separately, then link.
Get a good book that explains multi-file projects.
V
--
Please remove capital As from my address when replying by mail |