472,131 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,131 software developers and data experts.

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 8705
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.