constructor

can someone help me about this error:

undefined reference to `Worm::Worm(sf::Vector2<float>, float, (anonymous namespace)::dir)
1
2
3
4
5
6
7
8
9
10
11
12
namespace
{
    enum dir { Down, Up, Left, Right };
}
class Worm
{
Worm(sf::Vector2f,float,dir);
}
int main()
{
Worm w(sf::Vector2f(300,300),0.5,dir::Down);
}

i also tried to add the header and source files to the project but nothing happened
Last edited on
On line 7 you have declared the constructor Worm, but where do you implement it ?
Worm.cpp
1
2
3
4
5
6
Worm::Worm(sf::Vector2f defaultP, float defaultSP,dir defaultDir)
    : Entity("snake.png")
{


}
Last edited on
fixed it, the anonymous namespace was actually from another file.

sorry for not including it from OP :)
Last edited on
Topic archived. No new replies allowed.