mixed (managed/unmanaged) dll link errors

D

Droopy

Hi,

I wrote a C# program that is calling C++ legacy code.
I wrote a C++ managed wrapper for this legacy code.
It seems to work well.

In Debug mode, I had a linker error LNK4210 that I solved using the MSDN
article #814472.

But in Release mode, I have following errors :

with /MD parameter :

3 errors LNK2001 ("__argc", "__argv", "__mbctype")
4 errors LNK2005 ("delete" + "new") for msvcrt.lib (MSVCC71.dll)
1 error LNK2019 __mbctype referenced in function "void __stdcall
_AfxAbbreviateName ..."

with /MT parameter :

2 errors LNK2005 for libcmt.lib (typinfo.obj)
10 errors LNK2005 for msvcrt.lib (MSVCC71.dll)
4 errors LNK2005 for msvcrt.lib (cinitexe.obj)
1 error LNK2019

What linker options do I have to set ?

Thanks in advance for your help.

Droopy.
 
I

ismailp

In linker settings, input, "Additional dependencies":
mscoree.lib msvcrt.lib

Force symbol references: __DllMainCRTStartup@12

I guess force symbol references is already set to this on your code.
Hope this helps.

Ismail
 
D

Droopy

In linker settings, input, "Additional dependencies":
mscoree.lib msvcrt.lib

Force symbol references: __DllMainCRTStartup@12

I guess force symbol references is already set to this on your code.
Hope this helps.

Ismail

Yes it is set (it allowed me to compile in debug mode, see MSDN
article #814472).
But it did not help in release mode.

Thanks for your answer.

Any other idea ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top