PC Review


Reply
Thread Tools Rate Thread

LNK2005: "void __cdecl operator delete(void *)" ......

 
 
Guest
Posts: n/a
 
      7th Aug 2003
My hear is dropping out of these linker errors of VC++ .NET. :-(
I try to create a mixed managed/unmanaged .NET dll to be used for my futur
projects, but I always bump in a linker error and no way to get around
this...

The error is: sLibBase error LNK2005: "void __cdecl operator delete(void *)"
(??3@YAXPAX@Z) already defined in libcmtd.lib(dbgdel.obj)

These are 2 the same header files. The first uses <string> and generates the
link error.
If I remove this <string> then the linker does not get an error.

It is not only <string > the gives this error, also includes with <istream>
and <ostream>,... and my code uses <string> dramatically.

Any idea how to fix this? I found references to this problem on msdn, but
that is for VC 6 and the sollutions suggested doesn't solve this error.

Any help would be great.


This generates the link error
----------------------------------------------
#pragma once
using namespace System;
#include <afx.h>
#include <string>

namespace sLibBase
{
public __gc class Class1
{
};
}


This generates no link error
----------------------------------------------
#pragma once
using namespace System;
#include <afx.h>

namespace sLibBase
{
public __gc class Class1
{
};
}


 
Reply With Quote
 
 
 
 
Lionel Schiepers
Guest
Posts: n/a
 
      7th Aug 2003
I think that you link your project with the static release C Runtime instead
of the static debug C Runtime on a debug configuration.



<(E-Mail Removed)> wrote in message
news:3f321587$0$314$(E-Mail Removed)...
> My hear is dropping out of these linker errors of VC++ .NET. :-(
> I try to create a mixed managed/unmanaged .NET dll to be used for my futur
> projects, but I always bump in a linker error and no way to get around
> this...
>
> The error is: sLibBase error LNK2005: "void __cdecl operator delete(void

*)"
> (??3@YAXPAX@Z) already defined in libcmtd.lib(dbgdel.obj)
>
> These are 2 the same header files. The first uses <string> and generates

the
> link error.
> If I remove this <string> then the linker does not get an error.
>
> It is not only <string > the gives this error, also includes with

<istream>
> and <ostream>,... and my code uses <string> dramatically.
>
> Any idea how to fix this? I found references to this problem on msdn, but
> that is for VC 6 and the sollutions suggested doesn't solve this error.
>
> Any help would be great.
>
>
> This generates the link error
> ----------------------------------------------
> #pragma once
> using namespace System;
> #include <afx.h>
> #include <string>
>
> namespace sLibBase
> {
> public __gc class Class1
> {
> };
> }
>
>
> This generates no link error
> ----------------------------------------------
> #pragma once
> using namespace System;
> #include <afx.h>
>
> namespace sLibBase
> {
> public __gc class Class1
> {
> };
> }
>
>



 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      7th Aug 2003
> I think that you link your project with the static release C Runtime
instead
> of the static debug C Runtime on a debug configuration.
>

It was not that but you gave me some new ideas and instead of statically
linking MFC I link now dynamic.
This solved my link errors. An dfinally it seems that then unmanaged code
also works for me now. :-)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LNK2001: unresolved external symbol "void __cdecl free(void *)" (?free@@$$J0YAXPAX@Z) =?Utf-8?B?UWlhb25p?= Microsoft Dot NET 1 25th Mar 2004 07:01 AM
unresolved external symbol "void * __cdecl operator new(unsigned int) =?Utf-8?B?Q1A=?= Microsoft VC .NET 1 23rd Mar 2004 01:39 AM
__cdecl callback function with P/Invoke pawel Microsoft Dot NET 1 17th Jan 2004 10:32 AM
__cdecl callback function with P/Invoke pawel Microsoft Dot NET Framework 1 17th Jan 2004 10:32 AM
unresolved external __cdecl __CxxCallUnwindDtor edx Microsoft VC .NET 1 9th Sep 2003 06:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:43 PM.