I have a class defined in headerfile x.h in dll-1 which is
class A{
public:
static int val;
__declspec(dllexport) static void setval(int v) {val = v;}
};
and x.cpp has
int A::val = 256;
Now I built dll-1 and it went through, but the other dlls that link this dll failed to build with error unresolved external symbol public: static int A::val . This got resolved when I defined the exported function in x.cpp. but I don't understand why it broke. Thanks.