469,362 Members | 2,441 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

cpp new operator ?

jmd
Hello.
I would like to dynamically allocate a 2-dimensionns int array in C++ with
the followwing :
I create, in VS Studio.Net 2003, a new Visual Studio C++ Class Library
(.net) project.
I add a few lines in the .h and .cpp generated files which are :
//========= cppnew.h =========
// cppnew.h
#pragma once
using namespace System;
namespace cppnew
{
public __gc class Class1
{
public:
Class1 ( int maxRows, int maxCols ) ;
private:
int **arr;
};
}
//========= cppnew.cpp =========
// This is the main DLL file.
#include "stdafx.h"

#include "cppnew.h"

cppnew::Class1::Class1 ( int maxRows, int maxCols )
{
arr = new int*[maxRows];
// for ( int i = 0; i < maxRows; arr[i++] = new int[maxCols] ) ;
}
//============================

The problem is -> when I compile and link the above code I receive the
following errors :

cppnew error LNK2001: unresolved external symbol "void * __cdecl operator
new(unsigned int)" (??2@$$FYAPAXI@Z)
cppnew fatal error LNK1120: 1 unresolved externals

Can someone help ?

Thank you in advance.

Jean-Marie.

Nov 16 '05 #1
2 8641
Your error message is caused by the problem described in
Microsoft Knowledge Base article 814472
<http://support.microsoft.com/?id=814472>.
Nov 16 '05 #2
jmd
Ok.
Thank you.
I will study it.

"Bart Jacobs" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Your error message is caused by the problem described in
Microsoft Knowledge Base article 814472
<http://support.microsoft.com/?id=814472>.

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by joesoap | last post: by
reply views Thread by Martin Magnusson | last post: by
3 posts views Thread by Sensei | last post: by
6 posts views Thread by YUY0x7 | last post: by
3 posts views Thread by gugdias | last post: by
8 posts views Thread by valerij | last post: by
3 posts views Thread by y-man | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.