Article:
 |
|
Intro to Managed C++, Part 2: Mixing Managed and Unmanaged Code
|
| Subject: |
|
base type array problems |
| Date: |
|
2003-07-24 02:08:56 |
| From: |
|
anonymous2
|
|
|
|
Can anybody shed some light on my little problem?
I am trying to build a manged c++ dll.
When I try the code:
double *d = new double[10];
or any other base type, the code compiles, but will not link, erroring with unresolved symbols or tokens for 'new' and 'delete'
If I try this building an exe, the linker is fine. The code appears to reside in LIBCMTD, which - unfortunatly is the start-up code, and so requires a 'main' function.
Has anybody seen this before, and how can I fix it?
Cheers,
Dave
|
Showing messages 1 through 1 of 1.
-
base type array problems
2003-09-03 03:56:50
anonymous2
[View]
To convert the managed DLL to mixed mode
Link with /NOENTRY. In Solution Explorer, right-click the project node and click Properties. In the project's Property Pages dialog box, click Linker, and then click Command Line. Add this switch to the Additional Options field.
Link msvcrt.lib. In the project's Property Pages dialog box, click Linker, and then click Input. Add msvcrt.lib to the Additional Dependencies property.
Remove nochkclr.obj. On the Input page (same page as previous step), remove nochkclr.obj from the Additional Dependencies property.
Link in the CRT. On the Input page (same page as previous step), add __DllMainCRTStartup@12 to the Force Symbol References property.