Have searched enough answers but none of the solutions work for me.
scenario : I am trying to include a .h file that has some functions declared (not defined) and some variables declared.
If I include this header file in the source files (2 to be precise) that actually use the functions and variables, then the last one that compiles has a linker error that states
undefined reference to `abc::myfun(char const*, char const*, char*)'
All the functions and variables in the header files have been declared as extern and include guards are present.
I wish to have one cpp file put a value in the variable defined in the .h file and another cpp file to be able to read it.
Also if it helps, every piece of my code is in a namespace that I have defined ( namespace abc{ //all my code, in all the files }
)
abc::abc::something
– paddyabc::myfun(char const*, char const*, char*)
as noted from your error seems to be at least one culprit. Could you posted the declaration from your header file and where it is defined in a source file? – MartyE