B
BG
Hi,
I have created a C++/CLI dll, say D, with VS 2005.
Now I want to use it in a project, say P, which is a console solution of
type managed C++.
They both compile with /clr .
D has a ref class which I want to use in P.
With header file of D included in P, P compiles fine, but then I get several
such link errors
TestDriver.obj : error LNK2020: unresolved token (06000018) MyClass::MyFunc
Attempted solutions:
1. _declspec(dllexport)
In D, if I change
ref class MyClass to
ref class __declspec(dllexport) MyClass, I get several such errors
__declspec(dllexport)/__declspec(dllimport) cannot be applied to a managed
type
during compile.
2. Tried to add D.dll as reference in P using Properties page. Didn't work.
Still got link time errors.
3. Tried to add D.dll as Project reference in P using Properties page. Still
got linking errors.
Questions:
1. In D, do I need to specify some functions for export? If so, how? All the
functions I want to use are in a ref class.
2. In P, where do I need to add a reference to D?
3. Any other link time attribute I need to add/modify?
Thanks for your help.
I have created a C++/CLI dll, say D, with VS 2005.
Now I want to use it in a project, say P, which is a console solution of
type managed C++.
They both compile with /clr .
D has a ref class which I want to use in P.
With header file of D included in P, P compiles fine, but then I get several
such link errors
TestDriver.obj : error LNK2020: unresolved token (06000018) MyClass::MyFunc
Attempted solutions:
1. _declspec(dllexport)
In D, if I change
ref class MyClass to
ref class __declspec(dllexport) MyClass, I get several such errors
__declspec(dllexport)/__declspec(dllimport) cannot be applied to a managed
type
during compile.
2. Tried to add D.dll as reference in P using Properties page. Didn't work.
Still got link time errors.
3. Tried to add D.dll as Project reference in P using Properties page. Still
got linking errors.
Questions:
1. In D, do I need to specify some functions for export? If so, how? All the
functions I want to use are in a ref class.
2. In P, where do I need to add a reference to D?
3. Any other link time attribute I need to add/modify?
Thanks for your help.