I am trying to export/import a variable between exe and a dll. There are three folders. B.cpp in in one folder which is producing exe. C.cpp is in another folder which is producing a dll.
A.h is in a shared folder, if we need to use something between folders we use this folder. It only has the header files.
A.cpp is in folder which is producing the dll.
In A.h
__declspec(dllexport) extern int* val;
In A.cpp
__declspec(dllexport) int* val;
B.cpp
#include <A.h>
set val
C.cpp
#include <A.h>
get val and using val in some function
**I am getting error B.obj : error LNK2001: unresolved external symbol
I would really appreciate, any help or atleast some advice, where I can learn more about this problem.