Microsoft KB Archive/113429

= FIX: C1001: coff.c, Line 280, new of __declspec(dllimport) =

Article ID: 113429

Article Last Modified on 7/5/2005

-

APPLIES TO


 * Microsoft Visual C++ 1.0 Professional Edition

-



This article was previously published under Q113429



SYMPTOMS
The compiler generates the following internal compiler error message when the sample program below is compiled:

fatal error C1001: INTERNAL COMPILER ERROR

(compiler file '@(#)coff.c:1.14', line 280)

The internal compiler error is triggered by the code, which does a new of an array of a class that is marked __declspec(dllimport).



RESOLUTION
To avoid the error, remove the __declspec(dllimport) from the class declaration and link with an import library instead.



STATUS
Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. The problem was corrected in Visual C++, 32-bit edition, version 2.0.

Sample Code
/* Compile options needed: /c

class __declspec(dllimport) CImport { public: CImport; ~CImport; };

class CMyClass { protected: CImport * piArray; public: CMyClass {piArray = new CImport[2];} ~CMyClass {delete[] piArray;} };

Additional query words: 8.00 9.00 9.10 1.00 2.00 2.10

Keywords: kbbug kbfix kbcpponly kbcompiler KB113429

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.