multiple definition of..

Started by
2 comments, last by rakoon2 19 years, 8 months ago
Hello! I have a little problem. I get an error if I put my constructor function in a .cpp file

CArrow_i::CArrow_i( int x, int y, int w, int h, int bla )                 
             : CItem( x, y, w, h )
             {
                bla2 = bla;   
             }

then I get:

 multiple definition of `CArrow_i::CArrow_i( ...



It works if I put it in my .hpp file! ( in the class ) Thank you! :)
Advertisement
What does your .hpp file look like?
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
#ifndef __CARROW_HPP__#define __CARROW_HPP__class CArrow_i : public CItem{  public:             CArrow_i( int x, int y, int w, int h, int bla );             //..  //..};#endif
? =/
#ifndef __CARROW_HPP__#define __CARROW_HPP__CItem__CArrow.hppclass CArrow_i : public CItem{  public:             CArrow_i( int x, int y, int w, int h, int bla );             //..  //..};#endif

.cpp
[/source]
#include "header.hpp"
CArrow_i::CArrow_i( int x, int y, int w, int h, int bla )
: CItem( x, y, w, h )
{
bla2 = bla;
}
[/source]
header.hpp
#include "CItem__CArrow"//..

? :/
thank you


This topic is closed to new replies.

Advertisement