LINK : error LNK2020: unresolved token (060000EA) CMCNetToken::.ctor 
Author Message
 LINK : error LNK2020: unresolved token (060000EA) CMCNetToken::.ctor

Greetings all,
I'm having a problem linking in a mixed-class to an Unmanaged application.

I have created an unmanaged DLL where I export a class that utilizes
a managed class (CMCNetToken).
I have used the convention of:

gcroot<CMCNetToken *> m_pToken;

to call this object within my unmanaged code, per MSDN's docs on mixing
managed and unmanaged classes.

I get the above error for all public methods, though I don't define ctor, I
suspect
this is being generated as a byproduct of some derivative definition.

Anyone seen anything like this?
thanks,
Bob



Tue, 21 Sep 2004 20:56:40 GMT  
 LINK : error LNK2020: unresolved token (060000EA) CMCNetToken::.ctor


Quote:
> Greetings all,
> I'm having a problem linking in a mixed-class to an Unmanaged
> application.

> I have created an unmanaged DLL where I export a class that utilizes
> a managed class (CMCNetToken).
> I have used the convention of:

> gcroot<CMCNetToken *> m_pToken;

> to call this object within my unmanaged code, per MSDN's docs on
> mixing managed and unmanaged classes.

> I get the above error for all public methods, though I don't define
> ctor, I suspect
> this is being generated as a byproduct of some derivative definition.

You cannot use managed (compiled with /clr) code in unmanaged (not
compiled with /clr) C++ code.

gcroot is for mixing managed C++ (using managed extentions) and
normal C++ (not using managed extensions, but compiled with /clr;
so it is also managed code!).

If you want to call a managed Object from unmanaged code (not compiled
with /clr) you have to use InterOp with COM

--
Greetings
  Jochen



Tue, 21 Sep 2004 21:07:15 GMT  
 LINK : error LNK2020: unresolved token (060000EA) CMCNetToken::.ctor
That's what I was afraid of.
I was hoping for a simpler approach, but like most things in life,
nothing comes free or easy.
Thanks.
Bob


Quote:


> > Greetings all,
> > I'm having a problem linking in a mixed-class to an Unmanaged
> > application.

> > I have created an unmanaged DLL where I export a class that utilizes
> > a managed class (CMCNetToken).
> > I have used the convention of:

> > gcroot<CMCNetToken *> m_pToken;

> > to call this object within my unmanaged code, per MSDN's docs on
> > mixing managed and unmanaged classes.

> > I get the above error for all public methods, though I don't define
> > ctor, I suspect
> > this is being generated as a byproduct of some derivative definition.

> You cannot use managed (compiled with /clr) code in unmanaged (not
> compiled with /clr) C++ code.

> gcroot is for mixing managed C++ (using managed extentions) and
> normal C++ (not using managed extensions, but compiled with /clr;
> so it is also managed code!).

> If you want to call a managed Object from unmanaged code (not compiled
> with /clr) you have to use InterOp with COM

> --
> Greetings
>   Jochen



Tue, 21 Sep 2004 21:50:58 GMT  
 LINK : error LNK2020: unresolved token (060000EA) CMCNetToken::.ctor
Bob,

Quote:
> That's what I was afraid of.
> I was hoping for a simpler approach, but like most things in life,
> nothing comes free or easy.

Well, you could create a managed MC++ library project, implement som __nogc
classes that wrap your managed code and then export those (or just a few
methods, if that's all you need)... I think that would work and might be
easy.

--
Tomas Restrepo



Tue, 21 Sep 2004 22:15:16 GMT  
 LINK : error LNK2020: unresolved token (060000EA) CMCNetToken::.ctor
You know, I was just about to write back and ask that very question.
If I have a MC++ class and wrap it. Why can I not then export some
unmanaged Methods from the Unmanaged class that work with the MC++
class.
It seems you were a step ahead. I think the problem I ran into was that
I used the DLLExport/DLLImport on the Unmanaged Class level, thus
forcing it to expose the managed functionality.
Thanks again for the help.
-Bob


Quote:
> Bob,
> > That's what I was afraid of.
> > I was hoping for a simpler approach, but like most things in life,
> > nothing comes free or easy.

> Well, you could create a managed MC++ library project, implement som
__nogc
> classes that wrap your managed code and then export those (or just a few
> methods, if that's all you need)... I think that would work and might be
> easy.

> --
> Tomas Restrepo




Tue, 21 Sep 2004 22:21:07 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. LINK : error LNK2020: unresolved token (0A000055) (managed to unmanaged)

2. LNK2020 - unresolved token (0A000182) SEP_PASTE.Paste

3. VC++ 7 Link Error : unresolved external symbol

4. Linking error 2019 unresolved external symbol _main when porting to .NET

5. Linking error 2019 unresolved external symbol _main ...

6. msvc link-error: _printf unresolved external

7. Linking Problem when trying to create ReleaseUMinDependency[error LNK2001: unresolved external symbol _main]

8. Linking Errors - unresolved external symbol _SQLConnect@28

9. link error LNK2001 - unresolved external symbol

10. Templates and UnResolved External Link Error!

11. Link error.(unresolved external symbol _main)

12. NtCreateFile() unresolved external link error in VC++ 4.2

 

 
Powered by phpBB® Forum Software