I have a header file A.h
namespace DIV
{
int Fun();
}
A source file A.cpp
namespace DIV
{
class A
{
public:
A(){}
~A(){}
int Fun();
};
int A::Fun()
{
return 0;
}
}
Now I have another source file B.cpp in another project of the same solution.
This source uses google's GTest framework. Inside the test function I use
#include "gtest/gtest.h"
#include "A.h"
TEST(FunTest, Param)
{
int value = DIV::Fun();
}
Because of the DIV::Fun()
call I get linker error. I don't understand the reason behind the linker error.
EDIT: B.cpp is in an .exe project and A.h/cpp is in a lib project.