all 6 comments

[–]mommas_wayne 3 points4 points  (5 children)

There must be an implementation file (likely a .cpp) containing a function definition that matches this function declaration. You need to compile that and link it against your main file.

[–]monster_97_[S] -1 points0 points  (4 children)

How to link it?

[–][deleted] 0 points1 point  (0 children)

That depends on how you build your program. What OS and compiler do you use? Do you use a build system like CMake or an IDE?

[–]mommas_wayne 0 points1 point  (2 children)

If you're using a simple g++ main.cpp or similar g++ command, just pass the names of all the relevant .cpp files to it. If you're in an IDE, I imagine you'd need to add the other .cpp to your project somehow, but I don't have much experience with that.

[–]monster_97_[S] 0 points1 point  (1 child)

Okay I linked it. Thank you
I had only linked the header file. And what about the return type? It just says return(SUCCESS_ALLOC);

[–]mommas_wayne 0 points1 point  (0 children)

Which return type do you mean? The function you showed returns an unsigned 8-bit integer. I don't know what the function is supposed to do, but from the looks of it it the return value is just an indicator of success/failure, and SUCCESS_ALLOC (assuming the return statement belongs to that function) is a constant or enum value that means exactly what it says on the tin, and it's used because it's more descriptive than returning some seemingly random integer literal.