Why is my program saying I didn't implement my friend insertion operator?
I'm getting a linker error, even though I'm pretty sure I implemented the friend operator correctly.
![](https://utfs.io/f/a782b29b-ed5b-43d3-a45a-9b1bd25f084f-1nq2cb.png)
![](https://utfs.io/f/40a951bb-da9c-4221-a366-492117c6ed0c-1nq2cb.png)
![](https://utfs.io/f/dd29c489-7305-49c8-b01f-09806a948360-1nq2cb.png)
20 Replies
Where's the friend keyword
If you want that to be a friend
oh whoops i forgot to add that
ok i put the friend keyword in my header file and i moved the declaration into the class, but im still getting the same error
![](https://utfs.io/f/c8b3b3f8-f4c8-411f-ac2d-8f213988aff7-1nq2cb.png)
I thought you just call it like os << tk ?
do you mean my declaration parameters is wrong?
So in your class, you have friend ostream& operator<< etc.
Then define the ostream& operator<< externally
And to call it you would just say os << tk
oh im not personally calling the operator, the main program file thats given to me is, and when i try to compile it i get an error.
the message on vs code says theres not definition of the operator even though i did provide a defintion in my cpp file
![](https://utfs.io/f/865875d4-3a32-4bae-87a3-c792cd5634f9-1nq2cb.png)
You can't just say os<<tk
Not when you're defining what << will do
Unless you made a mistake with namespaces or something it looks fine?
If you zip your code and dm it I can take a closer look
yeah i can dm the code, thanks
@revan4477 can you share you header file for TimedTask
Issue was in the cpp file
thanks for all the help guys👍
It does work though
![](https://utfs.io/f/c55f3af4-8bda-40e3-9656-d63b49d34c93-1nq2cb.png)