'operator new': redefinition, various binding (using _dllspec for redefined new operator)

I am using __declspec (dllimport / export) in the debug version of the new one as such:

#ifdef _DEBUG
 DECLSPECCORE extern   void* operator new(unsigned int size, const char* file, int line);
 extern void* operator new[](unsigned int size, const char* file, int line);
 extern void operator delete(void* address, const char* file, int line);
 extern void operator delete[](void* address, const char* file, int line);
 extern void Delete(void* address);

#define LUDO_NEW new(__FILE__, __LINE__)
#define LUDO_DELETE delete

#endif

It makes me get

error C2375: "new operator": redefinition; different connection.

Why is this and how can you fix it? This is the only project that I am compiling right now.

+5
source share
4 answers

If you have two prototypes for overloading a new operator, you should export both. Hopefulyl is your problem.

0
source

++ operator new, DECLSPECCORE - , " ", . operator new, , .

+2

, , ++ "operator new" , - DLL. , (, ): , ?

0

, . new delete .

0

All Articles