Hello you guys, i'm new to this community and relatively new to c++.
right now i have a big problem with namespaces and i'm not able to resolve this issue on my own, so here we go:
I want to integrate 2 simmilar projects into my project. they are so simmilar, that they have the same class names, so i had to put them into different namespaces. first i tried to put just one into a specified namespace "os", but that didnt work out, so i put the second one into the namespace "cs":
#ifndef INTEGRAL_H
#define INTEGRAL_H
namespace cs {
cudaImage* Integral(IplImage *src);
}
#endif /* INTEGRAL_H */
#include "integral.h"
namespace cs {
cudaImage* Integral(IplImage *src) {
...
}
}
#ifndef OINTEGRAL_H
#define OINTEGRAL_H
namespace os {
IplImage *Integral(IplImage *img);
inline float BoxIntegral(IplImage *img, int row, int col, int rows, int cols)
{
...
}
}
#endif
#include "integral.h"
namespace os {
IplImage *Integral(IplImage *source)
{
...
}
}
in my main class i import both files (lying in different folders, lets call them a and b)
#include "a/integral.h"
#include "b/integral.h"
int main(int argc, char** argv[])
{
os::Integral(image);
cs::Integral(image);
}
but i still get the following error:
error LNK2019: unresolved external symbol "struct cudaImage * __cdecl cs::Integral(struct _IplImage *)" (?Integral@cs@@YAPAUcudaImage@@PAU_IplImage@@@Z) referenced in function "private: int __thiscall myclass:myfunction(struct _IplImage *,struct _IplImage *,struct CvMat * *,struct CvMat * *,float)" (?myfunction@myclass@@AAEHPAU_IplImage@@0PAPAUCvMat@@1M@Z)
btw: im using visual studio 2008 and i'm really desperate. please help me! :)