M
Michael Geyer
Hi there,
maybe this is a really stupid question...
One of the basic things in C++ is to allocate arrays like
char *bla = new char[19];
This compiles fine in a managed C++ class in a C++ application. But -
if I want to do the same thing in a managed Class in a DLL I get a
link error:
error LNK2001: unresolved external symbol "void * __cdecl operator
new(unsigned int)" (??2@$$FYAPAXI@Z)
(I only put the above line in the standard C++ .NET DLL project, that
appears if you choose "new project" in Visual Studio).
Using managed arrays works:
char ch __gc[] = new char __gc[19];
What am I doing wrong - is there a basic misunderstanding I have? Am I
not allowed to use good old unmanaged arrays in C++.NET ? Do I need
some libraries that are not linked to a DLL project by default?
Thanks in advance,
Michael
maybe this is a really stupid question...
One of the basic things in C++ is to allocate arrays like
char *bla = new char[19];
This compiles fine in a managed C++ class in a C++ application. But -
if I want to do the same thing in a managed Class in a DLL I get a
link error:
error LNK2001: unresolved external symbol "void * __cdecl operator
new(unsigned int)" (??2@$$FYAPAXI@Z)
(I only put the above line in the standard C++ .NET DLL project, that
appears if you choose "new project" in Visual Studio).
Using managed arrays works:
char ch __gc[] = new char __gc[19];
What am I doing wrong - is there a basic misunderstanding I have? Am I
not allowed to use good old unmanaged arrays in C++.NET ? Do I need
some libraries that are not linked to a DLL project by default?
Thanks in advance,
Michael