It's the first time I'm using C++ namespaces and I am having trouble making my main.cpp find the functions... Is there something I'm missing? (All files are in the project)
Thank you in advance!
Error:
"main.cpp|16|undefined reference to `fileManage::open(fileManage::ArchiveInfo*, char const*)"
i haven't worked with namespaces much, but my thought is you should do the same think as with classes and declaring functions outside the class
In your case
As nedo has already pointed out, you need to define the function fileManage::open() in fileManager.cpp, not ::open() as you have done so.
I usually use the same approach as nedo, explictly prefixing the name space. But some people use this approach (i.e. put the function definition(s) in the namespace.) I do use this second approach for small, usually helper, functions.
Yeah, separating the functions definitions from the namespace is better since the code is easier to read when projects become bigger as you pointed out.
Thank you very much for the help! It now works smoothly!