By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,759 Members | 1,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,759 IT Pros & Developers. It's quick & easy.

mixed (managed/unmanaged) dll link errors

P: n/a
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.
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

Nov 17 '05 #2

P: n/a
"ismailp" <pa*******@gmail.com> wrote in news:1112951496.600007.211930
@g14g2000cwa.googlegroups.com:
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 ?
Nov 17 '05 #3

P: n/a
Droopy <dr**************@hotmail.com> wrote in
news:Xn**********************************@195.129. 110.71:
"ismailp" <pa*******@gmail.com> wrote in news:1112951496.600007.211930
@g14g2000cwa.googlegroups.com:
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 ?


Is anybody can help please ?

Nov 17 '05 #4

P: n/a
Droopy <dr**************@hotmail.com> wrote in
news:Xn**********************************@195.129. 110.71:
Droopy <dr**************@hotmail.com> wrote in
news:Xn**********************************@195.129. 110.71:
"ismailp" <pa*******@gmail.com> wrote in news:1112951496.600007.211930
@g14g2000cwa.googlegroups.com:
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 ?


Is anybody can help please ?


Did I ask my question wrongly or nobody can help ?
Please tell me what I should add to get an answer.

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.