Build Errors Help

Error Number	Category	Click
BKnnnn	BSCMAKE
Cnnnn	CL Compiler
CKnnnn	CVPACK
Dnnnn	CL Command-Line
LNKnnnn	LINK, LIB, DUMPBIN, EDITBIN
Mnnnn	Run-Time Math
PRnnnn	Profiler
R60nn	C Run-Time
RWnnnn	RC
Unnnn	NMAKE
Other Topics	Errors Overview
	Viewing Errors Help


Overview of Errors

Error numbers generally have the following form:

Xmnnn

where X represents a prefix of one, two, or three letters and mnnn represents an error code consisting of four digits. The digit m is usually one of the following:

1nnn	Fatal errors. These errors generally cause the tool to halt.
2nnn	Errors. These errors usually allow the tool to attempt to continue but are serious enough to prevent success.
4nnn	Warnings. These errors are advisory and do not prevent success, though they might indicate a serious condition.


How to View Errors Help

To get help on an error that is shown in the Output window, place the insertion point on the error number and press F1.

You can also view this help by opening ERRORS.HLP from the File Manager.


Version
Errors Help

ERRORS.HLP

Version 1.00.3146


Copyright Notice

Information in this online document is subject to change without notice and does not represent a commitment on the part of Microsoft Corporation. The software, including any databases and online documents, described this document are furnished under a license agreement or nondisclosure agreement. The software, including any databases and online documents, may be used or copied only in accordance with the terms of the agreement. It is against the law to copy the software on any medium except as specifically allowed in the license or nondisclosure agreement. The purchaser may make one copy of the software for backup purposes. No part of this online document and/or databases may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or information storage and retrieval systems, for any purpose other than the purchaser's personal use, without the express written permission of Microsoft Corporation.

© 1993 Microsoft Corporation. All rights reserved.

Microsoft, MS, MS-DOS, CodeView, and Xenix are registered trademarks and Windows is a trademark of Microsoft Corporation.


Compiler Errors

C1000-C1999	C2300-C2499	C4000-C4099
C2000-C2099	C2500-C2599	C4100-C4199
C2100-C2199	C2600-C2699	C4200-C4599
C2200-C2299	C2700-C2999	C4600-C4799
Compiler Fatal Errors C1000 - C1999

C1000	C1022	C1048	C1083
C1001	C1023	C1049	C1084
C1002	C1024	C1052	C1085
C1003	C1026	C1054	C1086
C1004	C1031	C1055	C1087
C1005	C1032	C1056	C1088
C1006	C1033	C1057	C1126
C1007	C1034	C1058	C1500
C1008	C1035	C1059	C1501
C1009	C1036	C1060	C1502
C1010	C1037	C1062	C1503
C1011	C1038	C1063	C1504
C1012	C1039	C1064	C1505
C1013	C1040	C1065	C1506
C1014	C1041	C1066	C1507
C1016	C1042	C1068	C1700
C1017	C1043	C1069	C1852
C1018	C1044	C1070	C1853
C1019	C1045	C1071
C1020	C1046	C1072
C1021	C1047	C1082
Compiler Errors C2000 - C2099

C2000	C2024	C2052	C2077
C2001	C2025	C2053	C2078
C2002	C2026	C2054	C2079
C2003	C2027	C2055	C2081
C2004	C2028	C2056	C2082
C2005	C2030	C2057	C2083
C2006	C2032	C2058	C2084
C2007	C2033	C2059	C2085
C2008	C2034	C2060	C2086
C2009	C2036	C2061	C2087
C2010	C2037	C2062	C2088
C2011	C2039	C2063	C2089
C2012	C2040	C2064	C2090
C2013	C2041	C2065	C2091
C2014	C2042	C2066	C2092
C2015	C2043	C2067	C2093
C2016	C2044	C2068	C2094
C2017	C2045	C2069	C2095
C2018	C2046	C2070	C2097
C2019	C2047	C2071	C2098
C2020	C2048	C2072	C2099
C2021	C2049	C2073
C2022	C2050	C2074
C2023	C2051	C2075
C2100 - C2199

C2100	C2123	C2147	C2172
C2101	C2124	C2148	C2173
C2102	C2125	C2149	C2174
C2103	C2126	C2150	C2176
C2104	C2127	C2151	C2177
C2105	C2128	C2152	C2178
C2106	C2129	C2153	C2179
C2107	C2130	C2156	C2180
C2108	C2132	C2157	C2182
C2109	C2133	C2158	C2183
C2110	C2134	C2159	C2184
C2111	C2135	C2160	C2186
C2112	C2136	C2161	C2187
C2113	C2137	C2162	C2188
C2114	C2138	C2163	C2189
C2115	C2139	C2164	C2190
C2116	C2140	C2165	C2191
C2117	C2141	C2166	C2192
C2118	C2142	C2167	C2197
C2119	C2143	C2168	C2198
C2120	C2144	C2169	C2199
C2121	C2145	C2170
C2122	C2146	C2171
 C2200 - C2399

C2200	C2229	C2250	C2272
C2201	C2230	C2251	C2273
C2202	C2231	C2252	C2274
C2203	C2232	C2253	C2275
C2204	C2234	C2254	C2276
C2205	C2235	C2255	C2277
C2206	C2236	C2256	C2278
C2207	C2237	C2257	C2279
C2208	C2238	C2258	C2280
C2216	C2239	C2259	C2281
C2217	C2240	C2260	C2282
C2219	C2241	C2261	C2283
C2220	C2242	C2262	C2284
C2221	C2243	C2264	C2285
C2222	C2244	C2265	C2286
C2223	C2245	C2266	C2287
C2224	C2246	C2267	C2289
C2226	C2247	C2268	C2290
C2227	C2248	C2270	C2292
C2228	C2249	C2271
 C2300 - C2499

C2300	C2387	C2426	C2461
C2301	C2390	C2427	C2462
C2302	C2391	C2429	C2463
C2303	C2400	C2430	C2464
C2350	C2401	C2431	C2465
C2351	C2402	C2432	C2466
C2352	C2403	C2433	C2467
C2353	C2404	C2434	C2468
C2354	C2405	C2435	C2470
C2355	C2406	C2436	C2471
C2356	C2407	C2437	C2480
C2360	C2408	C2438	C2481
C2361	C2409	C2439	C2482
C2362	C2410	C2440	C2483
C2369	C2411	C2441	C2484
C2370	C2412	C2443	C2485
C2371	C2413	C2444	C2486
C2372	C2414	C2446	C2487
C2373	C2415	C2447	C2488
C2374	C2416	C2448	C2489
C2375	C2417	C2449	C2490
C2376	C2418	C2450	C2491
C2377	C2419	C2451	C2492
C2378	C2420	C2452	C2493
C2379	C2421	C2453
C2380	C2423	C2458
C2385	C2424	C2459
C2386	C2425	C2460
 C2500 - C2599

C2500	C2528	C2551	C2576
C2501	C2529	C2552	C2577
C2502	C2530	C2553	C2579
C2503	C2531	C2555	C2580
C2504	C2532	C2556	C2581
C2505	C2533	C2557	C2582
C2506	C2534	C2558	C2583
C2507	C2535	C2560	C2584
C2508	C2536	C2561	C2585
C2509	C2537	C2562	C2586
C2510	C2538	C2563	C2587
C2511	C2539	C2564	C2588
C2512	C2540	C2565	C2589
C2513	C2541	C2566	C2590
C2514	C2542	C2567	C2591
C2515	C2543	C2568	C2592
C2517	C2544	C2569	C2593
C2519	C2545	C2570	C2595
C2523	C2546	C2571	C2595
C2524	C2547	C2572	C2596
C2525	C2548	C2573	C2597
C2526	C2549	C2574	C2598
C2527	C2550	C2575	C2599
 C2600 - C2699

C2601	C2621	C2639	C2659
C2602	C2622	C2640	C2660
C2603	C2623	C2641	C2661
C2604	C2624	C2642	C2662
C2605	C2625	C2643	C2663
C2606	C2626	C2644	C2664
C2607	C2627	C2645	C2665
C2608	C2628	C2646	C2666
C2609	C2629	C2648	C2667
C2610	C2630	C2649	C2668
C2611	C2631	C2650	C2669
C2612	C2632	C2652	C2671
C2613	C2633	C2653	C2672
C2614	C2634	C2654	C2673
C2617	C2635	C2655	C2674
C2618	C2636	C2656
C2619	C2637	C2657
C2620	C2638	C2658
 C2700 - C2999

C2710	C2753	C2812	C2830
C2711	C2754	C2813	C2831
C2720	C2755	C2814	C2832
C2721	C2756	C2815	C2833
C2722	C2757	C2816	C2834
C2723	C2758	C2817	C2835
C2724	C2800	C2818	C2836
C2730	C2801	C2819	C2837
C2731	C2802	C2820	C2850
C2732	C2803	C2821	C2851
C2733	C2804	C2822	C2852
C2734	C2805	C2823	C2853
C2735	C2806	C2824	C2854
C2736	C2807	C2825	C2855
C2737	C2808	C2826	C2856
C2750	C2809	C2827	C2857
C2751	C2810	C2828
C2752	C2811	C2829

Compiler Warnings  C4000 - C4099

C4000	C4027	C4053	C4078
C4001	C4028	C4054	C4079
C4002	C4029	C4055	C4081
C4003	C4030	C4056	C4082
C4004	C4031	C4057	C4083
C4005	C4032	C4058	C4084
C4006	C4033	C4059	C4085
C4007	C4034	C4060	C4086
C4008	C4035	C4061	C4087
C4009	C4036	C4062	C4088
C4010	C4037	C4063	C4089
C4011	C4040	C4064	C4090
C4013	C4041	C4065	C4091
C4014	C4042	C4067	C4092
C4015	C4043	C4068	C4093
C4016	C4044	C4069	C4094
C4018	C4045	C4070	C4095
C4019	C4047	C4071	C4096
C4020	C4048	C4072	C4097
C4021	C4049	C4073	C4098
C4022	C4050	C4074	C4099
C4024	C4051	C4076
C4026	C4052	C4077
 C4100 - C4199

C4100	C4114	C4131	C4147
C4101	C4115	C4132	C4150
C4102	C4116	C4133	C4152
C4103	C4117	C4134	C4153
C4104	C4118	C4135	C4154
C4105	C4121	C4136	C4155
C4106	C4122	C4137	C4156
C4107	C4124	C4138	C4157
C4108	C4125	C4139	C4158
C4109	C4126	C4141	C4162
C4110	C4127	C4142	C4163
C4111	C4128	C4144	C4164
C4112	C4129	C4145	C4165
C4113	C4130	C4146
 C4200 - C4599

C4200	C4221	C4305	C4414
C4201	C4222	C4306	C4500
C4202	C4224	C4307	C4501
C4203	C4225	C4308	C4502
C4204	C4226	C4309	C4504
C4205	C4242	C4310	C4505
C4206	C4243	C4341	C4506
C4207	C4245	C4354	C4507
C4208	C4247	C4355	C4508
C4209	C4248	C4385	C4510
C4210	C4249	C4386	C4511
C4211	C4250	C4387	C4512
C4212	C4251	C4401	C4513
C4213	C4260	C4402	C4520
C4214	C4261	C4403	C4521
C4215	C4270	C4404	C4522
C4216	C4271	C4405	C4523
C4217	C4273	C4406	C4524
C4218	C4275	C4409	C4525
C4219	C4300	C4410	C4527
C4220	C4304	C4411
 C4600 - C4999

C4610	C4651	C4710	C4761
C4612	C4652	C4711	C4763
C4613	C4699	C4712	C4765
C4615	C4700	C4713	C4766
C4616	C4701	C4720	C4773
C4617	C4702	C4723	C4786
C4620	C4703	C4724	C4788
C4621	C4704	C4726	C4790
C4622	C4705	C4727	C4791
C4630	C4706	C4741	C4792
C4650	C4709	C4756


UNKNOWN FATAL ERROR Contact Microsoft Product Support Services
Fatal Error C1000

UNKNOWN FATAL ERROR Contact Microsoft Product Support Services

An unknown error condition was detected by the compiler.

Note the circumstances of the error, and notify Microsoft Corporation by following the instructions in the Technical Support help file.


internal compiler error (compiler file 'file', line number)
Fatal Error C1001

internal compiler error
(compiler file 'file', line number)

This error is most often generated in one of two cases:

1.   Failure to recover the compiler's internal state following detection of a syntax error in the program. The first pass of the compiler will occasionally fail when attempting to recover its state following the detection of a malformed program. Typically, the compiler will have printed an error message (or messages) and will later produce an internal compiler error. In most cases, fixing the errors reported in your code and recompiling will solve the problem.

2.   Failure of the code generator to find a way to generate correct code for a construct. This is most often caused by the interaction of an expression and an optimization option. The optimization has generated a tree which the compiler does not know how to handle. Such a problem can often be fixed by removing one or more optimization options when compiling the particular function containing the line indicated in the error message.

If no error messages have been emitted prior to the internal compiler error, then the next step is to determine which pass of the compiler is emitting the internal compiler error. This can be determined by recompiling the application with the /Bd option included. The /Bd option will cause each pass to print its name and arguments when it is invoked. The last pass invoked before the error is emitted is the one responsible.

If the pass indicated is P1, then the likely problem is still error recovery, as in number one above, but it is happening before the compiler has had a chance to emit the error message for the error it has just discovered. In such a case, examine the line on which the internal compiler error is reported. This line may also contain an unreported syntax error. Fixing any errors you find on that line will solve the internal compiler error in most cases. If you cannot find any error on that line or on the line previous to the one reported, contact Microsoft Product Support Services for help.

If the pass indicated is P2, then the problem can usually be fixed by removing one or more optimization options (or using a different code generator). You can determine which option is at fault by removing them one at a time and recompiling until the message goes away. Generally the last one removed is the problem and all other optimizations can be used safely. The most common culprits are /Og, /Oi, and /Oa. Once the offending optimization is discovered, it need not be turned off for the entire compilation. The offending optimization can be disabled with the optimize pragma while compiling the function where the error occurred, but enabled for the rest of the module.

More rarely, such errors occur at very low optimization levels or even when optimization is disabled. In such cases, rewriting the line where the error is reported (or possibly several lines including the one causing the error) may be a solution. If none of these options works, contact Microsoft Product Support Services for help.


compiler is out of heap space in pass 2
Fatal Error C1002

compiler is out of heap space in pass 2

The compiler ran out of dynamic memory space during execution of the second pass of the compiler (C2.EXE). Usually this means the program has too many symbols and/or complex expressions.

One of the following may be a solution:

Divide the file into several smaller source files.

Break expressions into smaller subexpressions.

Remove other programs or drivers running in the system that could be consuming significant amounts of memory.


error count exceeds 'number'; stopping compilation
Fatal Error C1003

error count exceeds 'number'; stopping compilation

Errors in the program were too numerous to allow recovery, and the compiler must terminate.


unexpected end of file found
Fatal Error C1004

unexpected end of file found

The default disk drive did not contain sufficient space for compiler-generated temporary files. The space required is approximately two times the size of the source file.

This message appears when an #if directive evaluates to false without a corresponding closing #endif directive.

This message also appears if the precompiled headers option (/Yu) is enabled but the file doesn't contain a hdrstop pragma.

This message also appears when the /Yufilename option is used and the source file being compiled does not contain an #include "filename" directive that uses the same filename used with /Yu.


string too big for buffer
Fatal Error C1005

string too big for buffer

A string in a compiler intermediate file overflowed a buffer.


write error on compiler generated file
Fatal Error C1006

write error on compiler generated file

The compiler was unable to create the intermediate files used in the compilation process.

This error can be caused by a disk media error or by an open floppy drive door.


unrecognized flag 'string' in 'option'
Fatal Error C1007

unrecognized flag 'string' in 'option'

The string in the command-line option was not valid.

Check the CL command line and CL environment variable for option specifications.


no input file specified
Fatal Error C1008

no input file specified

The compiler was not given a file to compile.

The compiler must be given a C or C++ source file to compile. Check the CL command line and CL environment variable for filename specifications.


compiler limit : macros nested too deeply
Fatal Error C1009

compiler limit : macros nested too deeply

Too many macros were being expanded at the same time.

This error occurs when a macro definition contains macros to be expanded and those macros contain other macros. The compiler has a limit of 256 levels of nested macros.

Try to split the nested macros into simpler macros.


unexpected end of file while looking for precompiled header directive
Fatal Error C1010

unexpected end of file while looking for precompiled header directive

A precompiled header was specified, but it did not contain a precompiled header directive.

This error can be caused by specifying an incorrect file as a header file.


compiler limit : 'identifier' : macro definition too big
Fatal Error C1011

compiler limit : 'identifier' : macro definition too big

The macro definition was longer than allowed.

Try to split the definition into shorter definitions.


unmatched parenthesis : missing 'character'
Fatal Error C1012

unmatched parenthesis : missing 'character'

The parentheses in a preprocessor directive were not matched. The missing character is either a left or right parenthesis.


compiler limit : too many open parentheses
Fatal Error C1013

compiler limit : too many open parentheses

Too many levels of parentheses were used.

Simplify the expression, or calculate part of the expression in a separate statement.


too many include files : depth = 'level'
Fatal Error C1014

too many include files : depth = 'level'

The nesting depth of #include directives was too great.

Open files can be included by the use of nested directives. The source file containing the directive is counted as one of the files.


#if[n]def expected an identifier
Fatal Error C1016

#if[n]def expected an identifier

The #ifdef or #ifndef conditional compilation directive was not supplied with an identifier to evaluate.

An identifier must be specified with the #ifdef and #ifndef directives.


invalid integer constant expression
Fatal Error C1017

invalid integer constant expression

The expression in an #if directive either did not exist or did not evaluate to a constant.


unexpected #elif
Fatal Error C1018

unexpected #elif

The #elif directive did not appear within an #if, #ifdef, or #ifndef construct.

Make sure that there is a #if, #ifdef, or #ifndef statement in effect before this statement.


unexpected #else
Fatal Error C1019

unexpected #else

The #else directive did not appear within an #if, #ifdef, or #ifndef construct.

Make sure that there is a #if, #ifdef, or #ifndef statement in effect before this statement.


unexpected #endif
Fatal Error C1020

unexpected #endif

An #endif directive appeared without a matching #if, #ifdef, or #ifndef directive.

Make sure that there is a matching #endif for each #if, #ifdef, and #ifndef statement.


invalid preprocessor command 'string'
Fatal Error C1021

invalid preprocessor command 'string'

The characters following the number sign (#) did not form a valid preprocessor directive.

The number sign cannot be used as the first character in an identifier.


expected #endif
Fatal Error C1022

expected #endif

An #if, #ifdef, or #ifndef directive was not terminated with an #endif directive.

Make sure that there is a #if, #ifdef, or #ifndef statement in effect before this statement.


cannot open source file 'filename'
Fatal Error C1023

cannot open source file 'filename'

The given file either did not exist, could not be opened, or was not found.

Make sure that the environment settings are valid and that the correct path for the file is specified.

If this error appears without an error message, the compiler has run out of file handles. To increase the number of file handles available under MS-DOS, change the FILES setting in CONFIG.SYS. FILES=50 is the recommended setting.


cannot open include file 'filename'
Fatal Error C1024

cannot open include file 'filename'

The specified file in an #include preprocessor directive could not be found.

Make sure that the settings for the INCLUDE and TMP environment variables are valid and that the correct path for the file is specified.

If this error appears without an error message, the compiler has run out of file handles. To increase the number of file handles available under MS-DOS, change the FILES setting in CONFIG.SYS. FILES=50 is the recommended setting.


parser stack overflow : program too complex
Fatal Error C1026

parser stack overflow : program too complex

The program could not be processed because the space required to parse the program caused a stack overflow in the compiler.

Simplify the program by decreasing the complexity of expressions. Decrease the level of nesting in for and switch statements by putting some of the more deeply nested statements in separate functions. Break up very long expressions involving comma operators or function calls.


compiler limit : function calls nested too deeply
Fatal Error C1031

compiler limit : function calls nested too deeply

The program exceeded the dynamic compiler limit on nested function calls.

Split the nested calls, saving the return value from one of the nested functions in a temporary variable.


cannot open object code listing file 'filename'
Fatal Error C1032

cannot open object code listing file 'filename'

The output listing file specified with the /Fl command-line option could not be opened.

There are several possible causes for this error:

The given name is not valid.

The file cannot be opened because of a lack of space.

A read-only file with the given name already exists.

The file is in use by another process.


cannot open assembly language output file 'filename'
Fatal Error C1033

cannot open assembly language output file 'filename'

The output listing file specified with the /Fc or /Fa command-line option could not be opened.

There are several possible causes for this error:

The given name is not valid.

The file cannot be opened because of a lack of space.

A read-only file with the given name already exists.

The file is in use by another process.


'file': no include path set
Fatal Error C1034

'file': no include path set

The INCLUDE envirionment variable was not set.

Set this variable in the Visual Workbench using the Directories command on the Options menu.

If you are using the command line compiler run the MSVCVARS.BAT batch file to set the INCLUDE environment variable.


expression too complex; simplify expression
Fatal Error C1035

expression too complex; simplify expression

The compiler was unable to generate code for a complex expression.

Try to split the expression into simpler subexpressions and recompile.


cannot open source listing file 'filename'
Fatal Error C1036

cannot open source listing file 'filename'

The output listing file specified with the /Fs command-line option could not be opened.

There are several possible causes for this error:

The given name is not valid.

The file cannot be opened because of a lack of space.

A read-only file with the given name already exists.

The file is in use by another process.


cannot open object file 'filename'
Fatal Error C1037

cannot open object file 'filename'

The object file specified with the /Fo command-line option could not be opened.

There are several possible causes for this error:

The given name is not valid.

The file cannot be opened because of a lack of space.

A read-only file with the given name already exists.

The file is in use by another process.


compiler limit : 'function' : control flow state too complex; simplify function
Fatal Error C1038

compiler limit : 'function' : control flow state too complex; simplify function

The number of possible control flow states in the specified function exceeded the limit imposed by the compiler. The flow control of the function should be simplified or the function should be split into smaller functions.


unrecoverable heap overflow in pass 3
Fatal Error C1039

unrecoverable heap overflow in pass 3

The postoptimizer compiler pass overflowed the heap and could not continue.

One of the following may be a solution:

Break up the function containing the line that caused the error.

Recompile with the /Od option to remove optimization.

Remove other programs or drivers running in the system that could be consuming significant amounts of memory.


unexpected end-of-file condition in source file 'filename'
Fatal Error C1040

unexpected end-of-file condition in source file 'filename'

The compiler detected an unexpected end-of-file condition while creating a source listing or mixed source and object listing.

This error occurs if the source file is deleted or overwritten while it is being read.


cannot open compiler intermediate file - no more files
Fatal Error C1041

cannot open compiler intermediate file - no more files

The compiler could not create intermediate files for use in the compilation process because no more file handles were available.

To increase the number of file handles available under MS-DOS, change the FILES setting in CONFIG.SYS. FILES=50 is the recommended setting.


cannot open compiler intermediate file - no such file or directory
Fatal Error C1042

cannot open compiler intermediate file - no such file or directory

The compiler could not create intermediate files for use in the compilation process because the TMP environment variable was set to an invalid directory or path.

Use the SET command to change the TMP environment variable so that it points to a valid directory.


cannot open compiler intermediate file
Fatal Error C1043

cannot open compiler intermediate file

The compiler could not create intermediate files for use in the compilation process. The exact reason could not be determined.

One of the following may be a solution:

Make sure that the environment variable TMP points to a drive and directory in which a file can be created.

Delete unneeded files in the TMP directory.


out of disk space for compiler intermediate file
Fatal Error C1044

out of disk space for compiler intermediate file

The compiler could not create intermediate files for use in the compilation process because no more space was available.

Make more space available on the disk pointed to by the TMP environment variable and then recompile.


compiler limit : linkage specifications nested too deeply
Fatal Error C1045

compiler limit : linkage specifications nested too deeply

The nesting of externals exceeded the capacity of the compiler. Nested externals are allowed when specifying the external linkage type (such as extern C++).

Make sure that nested externals have appropriate closing braces.


compiler limit : 'structure' nested too deeply
Fatal Error C1046

compiler limit : 'structure' nested too deeply

The given structure, union, or class exceeded the nesting limit of the compiler.

Structures, unions, and classes cannot be nested to more than 15 levels.

Rewrite the definition so that fewer structures, unions, or classes are nested. The structure, union, or class can be split into two or more parts by defining one or more of the nested structures using typedef.


limit of 'option' exceeded at 'string'
Fatal Error C1047

limit of 'option' exceeded at 'string'

The given option was specified too many times. The given string is the argument to the option that caused the error.

Check the CL environment variable for additional occurrences of the given command-line option.


unknown option 'character' in 'option'
Fatal Error C1048

unknown option 'character' in 'option'

The given character was not a valid letter for the option.

For example, the following line:

#pragma optimize( "*", on )

causes the following error:

unknown option '*' in '#pragma optimize'


invalid numerical argument 'string'
Fatal Error C1049

invalid numerical argument 'string'

The compiler expected a numerical argument but received the given string.

This error may be caused by giving a hexadecimal number without the necessary \\x prefix or by a misformed floating-point number.


compiler limit :  #if or #ifdef nested too deeply
Fatal Error C1052

compiler limit :  #if or #ifdef nested too deeply

The program exceeded the maximum of 32 nesting levels for #if and #ifdef directives.

This error can be caused by include files that use these preprocessor directives.


compiler limit : initializers nested too deeply
Fatal Error C1054

compiler limit : initializers nested too deeply

The compiler limit on the nesting of initializers was exceeded. The limit depends on the combination of types being initialized and may range from 10 to 15 levels.

Simplify the data types being initialized to reduce the levels of nesting, or assign initial values in separate statements after the declaration.


compiler limit : out of keys
Fatal Error C1055

compiler limit : out of keys

The file being compiled contained too many symbols.

Try to split the file into smaller files, and compile them separately.


compiler limit : out of macro expansion space
Fatal Error C1056

compiler limit : out of macro expansion space

The compiler overflowed an internal buffer during the expansion of a macro.

Try to split the macros into simpler macros or remove nonessential space and tab characters from macro definitions that were used in the expansion.


unexpected end of file in macro expansion
Fatal Error C1057

unexpected end of file in macro expansion

The compiler has encountered the end of the source file while gathering the arguments of a macro invocation. Usually this is the result of a missing right parenthesis in the macro invocation.


compiler limit : too many formal arguments
Fatal Error C1058

compiler limit : too many formal arguments

The function declaration had too many formal arguments.

Reduce the number of arguments by passing structures or pointers to structures.


compiler is out of near heap space
Fatal Error C1059

compiler is out of near heap space

The compiler ran out of storage for items that it stores in its near (default data segment) heap.

One of the following may be a solution:

Eliminate unnecessary include files, especially unneeded function prototypes.

Split the function at the given line number into two or more functions.

Split the current file into two or more files and compile them separately.


compiler is out of far heap space
Fatal Error C1060

compiler is out of far heap space

The compiler ran out of storage for items that it stores in its far heap. Usually this is the result of having too many symbols.

One of the following may be a solution:

Increase the Windows swap file space. A swap file of at least 4 Mb is recommended on a system with 4 Mb of RAM. For more information about increasing the swap-file space refer to the Microsoft Windows User's Guide.

Eliminate unnecessary include files, especially unneeded #defines and function prototypes.

Eliminate some global variables.

Split the current file into two or more files and compile them separately.

Remove other programs or drivers running in the system, which could be consuming significant amounts of memory.

Check your CONFIG.SYS and AUTOEXEC.BAT files for device drivers that are not currently needed. For example, you may need to remove SMARTDRV.EXE or reconfigure it to use less memory.


error while writing to preprocessor output file
Fatal Error C1062

error while writing to preprocessor output file

The compilation command included the /P option to produce a preprocessor output file, but not enough disk space was available to hold the file.

Free more space on the destination drive or choose an alternate output drive.


compiler limit : compiler stack overflow
Fatal Error C1063

compiler limit : compiler stack overflow

The program was too complex and caused the compiler stack to overflow.

Simplify the program, making it more modular, and recompile.


compiler limit : token overflowed internal buffer
Fatal Error C1064

compiler limit : token overflowed internal buffer

The compiler read an identifier that was longer than the internal buffer used for identifier names.

Shorten the name and recompile.


compiler limit : out of tags
Fatal Error C1065

compiler limit : out of tags

The file being compiled contained too many symbols.

Try to split the file into smaller files, and compile them separately.


compiler limit : decorated name length exceeded
Fatal Error C1066

compiler limit : decorated name length exceeded

After the symbol's name was made unique ("decorated"), it became too long. The maximum length of a decorated C++ name is 247 characters.

Shorten the name of the symbol.


cannot open file 'filename'
Fatal Error C1068

cannot open file 'filename'

The given file either did not exist, could not be opened, or was not found.

Make sure that the environment settings are valid and that the correct path for the file is specified.

If this error appears without an error message, the compiler has run out of file handles. To increase the number of file handles available under MS-DOS, change the FILES setting in CONFIG.SYS. FILES=50 is the recommended setting.


write error on file 'filename'
Fatal Error C1069

write error on file 'filename'

An error occurred while the compiler was trying to write to the file. One possible cause of this error is insufficient disk space.


mismatched #if/#endif pair in file 'filename'
Fatal Error C1070

mismatched #if/#endif pair in file 'filename'

The preprocessor found the #if, #ifdef, or #ifndef directive but did not find a corresponding #endif directive in the same source file.


unexpected end of file found in comment
Fatal Error C1071

unexpected end of file found in comment

The compiler found the end of a file while scanning a comment.

Probably a comment was not terminated. Begin at the end of the file and search backward for the beginning of a comment. A comment begins with /* and ends with */ as in:

/* This is a
comment */

A comment cannot be split across source files.

This error can also be caused by a comment on the last line of a source file that is not followed by a newline character as in:

int i; // error: last line not terminated by newline

To eliminate this error, go to the end of the line and enter a newline.


'filename' : cannot read file
Fatal Error C1072

'filename' : cannot read file

The compiler encountered an error when trying to read a file.

This error can be caused by a disk error or by a file-sharing conflict.


Cannot close filetype file: 'file': message (file:line number)
Fatal Error C1082

Cannot close filetype file: 'file': message (file:line number)

If the message "bad file number" is given, this error may have been caused by closing a file in the foreground while it is being used by a background compilation.


Cannot open filetype file: 'file': message
Fatal Error C1083

Cannot open filetype file: 'file': message

The specified file could not be opened.

This error can be caused if the file, or the disk on which it resides, is read-only. Make the file writeable with the ATTRIB utility, or move the file to a writeable disk.

This error may be caused by not having enough file handles. Close some open applications and recompile.

Trying to open a file or directory which you do not have permission to access can cause this error.

If an include file could not be opened check that the INCLUDE environment variable is set correctly, and that the name of the file is spelled correctly.


Cannot read filetype file: 'file': message
Fatal Error C1084

Cannot read filetype file: 'file': message

If the message "bad file number" is given, this error may have been caused by saving a file in the foreground while it is being used by a background compilation.


Cannot write filetype file: 'file': message (file:line number)
Fatal Error C1085

Cannot write filetype file: 'file': message (file:line number)

If the message "bad file number" is given, this error may have been caused by saving a file in the foreground while it is being used by a background compilation.

This error can be caused by attempting to write to a read-only drive, a drive that is full, or by a sharing violation.


Cannot seek filetype file: 'file': message (file:line number)
Fatal Error C1086

Cannot seek filetype file: 'file': message (file:line number)

The compiler was unable to complete an I/O operation.


Cannot tell filetype file: 'file': message (file:line number)
Fatal Error C1087

Cannot tell filetype file: 'file': message (file:line number)

The compiler was unable to complete an I/O operation.


Cannot flush filetype file: 'file': message (file:line number)
Fatal Error C1088

Cannot flush filetype file: 'file': message (file:line number)

The compiler was unable to complete an I/O operation.


'identifier' : automatic allocation exceeds 'size'
Fatal Error C1126

'identifier' : automatic allocation exceeds 'size'

The space allocated for the local variables of a function exceeded the given limit.

Use the malloc run-time function or the new function to allocate large amounts of space for data.


'filename' : cannot open inline function definition file
Fatal Error C1500

'filename' : cannot open inline function definition file

The given file either did not exist, could not be opened, or was not found.

Make sure that the environment settings are valid and that the correct path for the file is specified.

If this error appears without an error message, the compiler has run out of file handles. To increase the number of file handles available under MS-DOS, change the FILES setting in CONFIG.SYS. FILES=50 is the recommended setting.


compiler limit : too many temporary variables
Fatal Error C1501

compiler limit : too many temporary variables

The source file contained more than 17,500 temporary variables.

Split the file into smaller parts.


inline member-function definition missing '}'
Fatal Error C1502

inline member-function definition missing '}'

The compiler reached the end of the file and did not find a matching closing brace.

Make sure that curly braces are matched.


default parameter definition missing ',' or ')'
Fatal Error C1503

default parameter definition missing ',' or ')'

After one or more default parameters were defined, neither a comma to indicate continuation nor a closing parenthesis to indicate termination of the function declaration was found.

Make sure that there are matching parentheses around the set of formal parameters.


type ambiguous after 'number' tokens
Fatal Error C1504

type still ambiguous after parsing 'number' tokens, unable to recover

The compiler could not resolve the type after looking ahead in the code.

Simplify the code to make the statement clearer. This error can often be eliminated by using an explicit type cast to an ambiguous expression.


type still ambiguous after parsing 'number' tokens, unable to recover
Fatal Error C1505

unrecoverable parser lookahead error

The compiler could not evaluate the code.

Simplify the code by making smaller classes or functions.


unrecoverable block scoping error
Fatal Error C1506

unrecoverable block scoping error

The block was too large to compile.

This error can be caused by mismatched curly braces or by an extremely large function or class.


previous user errors and subsquent error recovery halt further compilation
Fatal Error C1507

previous user errors and subsquent error recovery halt further compilation

There were too many errors to continue compiling.

Correct some of the errors and compile again.


compiler compiler is out of far heap space
Fatal Error C1700

compiler compiler is out of far heap space

The compiler ran out of storage for items that it stores in its far heap. Usually this is the result of having too many symbols.

One of the following may be a solution:

Increase the amount of real mode memory available under MS-DOS. If possible, load device drivers into upper memory blocks (UMBs) to conserve real mode memory. See your MS-DOS manual for more information on optimizing memory use.

Eliminate some global variables.

Split the current file into two or more files and compile them separately.

Remove other programs or drivers running in the system, which could be consuming significant amounts of memory.

Check your CONFIG.SYS and AUTOEXEC.BAT files for device drivers that are not currently needed. For example, you may need to remove SMARTDRV.EXE or reconfigure it to use less memory.


'filename' is not a valid precompiled header file
Fatal Error C1852

'filename' is not a valid precompiled header file

The given filename is not a precompiled header file.

Make sure that all /Yu command-line option and #pragma hdrstop statements specify valid precompiled header files. The compiler assumes the .PCH extension if none is provided.

This error is caused by giving the filename of a file that is not a precompiled header, such as an .HPP file.


'filename' is not a precompiled header file created with this compiler
Fatal Error C1853

'filename' is not a precompiled header file created with this compiler

The given precompiled header is not compatible with this version of the compiler.

Recompile the program or the header with the same version of the compiler.

This error can be caused by mixing 16-bit and 32-bit source files and precompiled headers.


UNKNOWN ERROR Contact Microsoft Product Support Services
Compiler Error C2000

UNKNOWN ERROR Contact Microsoft Product Support Services

The compiler detected an unknown error condition.

Note the circumstances of the error, and notify Microsoft Corporation by following the instructions in the Technical Support help file or the Microsoft Product Assistance Request form at the back of one of your manuals.


newline in constant
Compiler Error C2001

newline in constant

A string constant was continued on a second line without either a backslash (\) or closing and opening double quotation marks (").

To break a string constant that is on two lines in the source file, do one of the following:

End the first line with the line-continuation character, a backslash.

Close the string on the first line with a double quotation mark, and open the string on the next line with another quotation mark.

It is not sufficient to end the first line with \n, the escape sequence for embedding a newline character in a string constant.

The following are examples of incorrect and correct usage:

printf("Hello,             // error
    world");
printf("Hello,\n          //  error
    world");
printf("Hello,\           //  OK
 world");
printf("Hello,"            // OK
    " world");

Note that any spaces at the beginning of the next line after a line-continuation character are included in the string constant and that neither solution actually places a newline character into the string constant. The following examples embed this character:

printf("Hello,\n\
world");
printf("Hello,\
\nworld");
printf("Hello,\n"
    "world");
printf("Hello,"
 "\nworld");


invalid wide-character constant
Compiler Error C2002

invalid wide-character constant

The use of the multibyte-character constant was not legal.

This error can be caused if a wide character contains more bytes than expected.

Wide characters cannot be concatenated with ordinary string literals and cannot be used if the standard header, STDDEF.H, is not included.

Wide-character strings and constants must be preceded by the character L.

The following example shows a wide-character constant:

L'mbconst'

Wide characters are not supported in C.


expected 'defined id'
Compiler Error C2003

expected 'defined id'

An identifier was expected after the specified preprocessing keyword.


expected 'defined(id)'
Compiler Error C2004

expected 'defined(id)'

An identifier was expected after the left parenthesis following the specified preprocessing keyword.


#line expected a line number, found 'token'
Compiler Error C2005

#line expected a line number, found 'token'

A #line directive lacked the required line-number specification.


#include expected a filename, found 'token'
Compiler Error C2006

#include expected a filename, found 'token'

An #include directive lacked the required filename specification.


#define syntax
Compiler Error C2007

#define syntax

An identifier was expected following #define in a preprocessing directive.


'character' : unexpected in macro definition
Compiler Error C2008

'character' : unexpected in macro definition

The given character was found immediately following the name of the macro.


reuse of macro formal 'identifier'
Compiler Error C2009

reuse of macro formal 'identifier'

The given identifier was used more than once in the formal parameter list of a macro definition.


'character' : unexpected in macro formal parameter list
Compiler Error C2010

'character' : unexpected in macro formal parameter list

The given character was used incorrectly in the formal parameter list of a macro definition.


'identifier' : 'type' type redefinition
Compiler Error C2011

'identifier' : 'type' type redefinition

The specified identifier was already defined as type type.

The following is an example of this error:

struct S;
union S;    // error


missing name following '<'
Compiler Error C2012

missing name following '<'

An #include directive lacked the required filename specification.


missing '>'
Compiler Error C2013

missing '>'

The closing angle bracket (>) was missing from a #include directive.


preprocessor command must start as first nonwhite space
Compiler Error C2014

preprocessor command must start as first nonwhite space

Nonwhite space characters appeared before the number sign (#) of a preprocessor directive on the same line.


too many characters in constant
Compiler Error C2015

too many characters in constant

A character constant contained more than two characters.

Character constants are limited to one character (standard charcter constants) or two characters (long character constants).

Note that an escape sequence (for example, \t for tab) is converted to a single character.


no closing single quotation mark
Compiler Error C2016

no closing single quotation mark

A newline character was found before the closing single quotation mark of a character constant.


illegal escape sequence
Compiler Error C2017

illegal escape sequence

An escape sequence appeared where one was not expected.

An escape sequence (a backslash, \, followed by a number or letter) may occur only in a character or string constant.


unknown character 'hexnumber'
Compiler Error C2018

unknown character 'hexnumber'

The ASCII character corresponding to the given hexadecimal number appeared in the source file but is an illegal character.

One possible cause of this error is corruption of the source file.


expected preprocessor directive, found 'character'
Compiler Error C2019

expected preprocessor directive, found 'character'

The given character followed a number sign (#), but it was not the first letter of a preprocessor directive.


'member' : 'class' member redefinition
Compiler Error C2020

'member' : 'class' member redefinition

The specified member of the specified base class or structure was redefined.

A function inherited from a base class or structure cannot be redefined.

If the function is redefined in the derived class, it should be declared as virtual in the base class.


expected exponent value, not 'character'
Compiler Error C2021

expected exponent value, not 'character'

The given character was used as the exponent of a floating-point constant but was not a valid number.


'number' : too big for character
Compiler Error C2022

'number' : too big for character

The octal number following a backslash (\) in a character or string constant was too large to be represented as a character.


divide by 0
Compiler Error C2023

divide by 0

The expression resulted in a division by zero.


mod by 0
Compiler Error C2024

mod by 0

The expression resulted in a modulo 0 operation.


'identifier' : enum/struct/union type redefinition
Compiler Error C2025

'identifier' : enum/struct/union type redefinition

The given identifier had already been used for an enumeration, structure, or union tag.


string too big, trailing characters truncated
Compiler Error C2026

string too big, trailing characters truncated

The string was longer than the limit of 2048 characters.

After adjacent strings are concatenated, a string cannot be longer than 2048 characters.


use of undefined type 'identifier'
Compiler Error C2027

use of undefined type 'identifier'

The specified type was not defined.

A type cannot be used until it is defined.


struct/union member must be inside a struct/union
Compiler Error C2028

struct/union member must be inside a struct/union

Structure or union member must be declared within the structure or union, respectively.


'identifier' : struct/union member redefinition
Compiler Error C2030

'identifier' : struct/union member redefinition

The identifier was used for more than one member of the same structure or union.


'identifier' : function cannot be member of struct/union 'identifier'
Compiler Error C2032

'identifier' : function cannot be member of struct/union 'identifier'

The specified structure or union was declared with a member function.

Member functions are allowed in C++ but not in C.


'identifier' : bit field cannot have indirection
Compiler Error C2033

'identifier' : bit field cannot have indirection

The given bit field was declared as a pointer (*), which is not allowed.

The following is an example of this error:

struct S
{
   int *b : 1;  // error
};


'identifier' : type of bit field too small for number of bits
Compiler Error C2034

'identifier' : type of bit field too small for number of bits

The number of bits specified in the bit-field declaration exceeded the number of bits in the given base type.


identifier 'class-key' : unknown size
Compiler Error C2036

identifier 'class-key' : unknown size

The address of the specified undeclared identifier was used.

The size of an undeclared object cannot be used.

The following is an example of this error:

struct A* pA;
struct B { int i; };
B* pB;
void main()
{
   pA++;   // error, size of A not known
   pB++;   // OK, B has been declared
}


left of 'operator' specifies undefined struct/union 'identifier'
Compiler Error C2037

left of 'operator' specifies undefined struct/union 'identifier'

The expression before the member-selection operator ( -> or .) identified a structure or union type that was not defined.


'identifier' : is not a member of 'class-key'
Compiler Error C2039

'identifier' : is not a member of 'class-key'

A nonmember of a structure or union was incorrectly used.

The following is an example of this error:

struct S
{
   int mem0;
} *pS;
void main()
{
   pS->mem1 = 0;       // error, mem1 is not a member
   pS->mem0 = 0;       // OK
}


'operator' : 'identifier1' differs in levels of indirection from 'identifier2'
Compiler Error C2040

'operator' : 'identifier1' differs in levels of indirection from 'identifier2'

An expression involving the specified operator had inconsistent levels of indirection.

If both operands are of arithmetic type or if both are not (such as array or pointer), then they are used without change. If one operand is arithmetic, but the other is not, the arithmetic operator is converted to the type of the other operator.


illegal digit 'character' for base 'number'
Compiler Error C2041

illegal digit 'character' for base 'number'

The specified character was not a legal digit for the base that was used.

The following is an example of this error:

int i = 081; // error, 8 is not a legal digit
int i = 071; // OK


signed/unsigned keywords mutually exclusive
Compiler Error C2042

signed/unsigned keywords mutually exclusive

The keywords signed and unsigned were both used in a single declaration.

The following is an example of this error:

unsigned signed int i;      // error


illegal break
Compiler Error C2043

illegal break

A break statement is legal only within a do, for, while, or switch statement.


illegal continue
Compiler Error C2044

illegal continue

A continue statement is legal only within a do, for, or while statement.


'identifier' : label redefined
Compiler Error C2045

'identifier' : label redefined

The label appeared before more than one statement in the same function.


illegal case
Compiler Error C2046

illegal case

The keyword case can appear only within a switch statement.


illegal default
Compiler Error C2047

illegal default

The keyword default can appear only within a switch statement.


more than one default
Compiler Error C2048

more than one default

A switch statement contained more than one default label.


case value 'value' already used
Compiler Error C2049

case value 'value' already used

The case value was already used in this switch statement.

This error can be caused by enumerations or macros that evaluate to the same value.


nonintegral switch expression
Compiler Error C2050

nonintegral switch expression

A switch expression did not evaluate to an integral value.


case expression not constant
Compiler Error C2051

case expression not constant

Case expressions must be integral constants.


case expression not integral
Compiler Error C2052

case expression not integral

Case expressions must be integral constants.


'identifier' : wide string mismatch
Compiler Error C2053

'identifier' : wide string mismatch

The specified wide string was assigned to an incompatible type.

The following is an example of this error:

char array[] = L"Rika";    // error


expected '(' to follow 'identifier'
Compiler Error C2054

expected '(' to follow 'identifier'

The context requires parentheses after the function identifier.

One cause of this error is omitting an equal sign (=) on a complex initialization, as in:

int array1[] { 1, 2, 3 };   // error, missing =
int array2[] = { 1, 2, 3 }; // OK


expected formal parameter list, not a type list
Compiler Error C2055

expected formal parameter list, not a type list

A parameter type list instead of a formal parameter list appeared in a function definition.

In ANSI C, the formal parameters in a function definition must all be named unless they are void or an elipsis (...).


illegal expression
Compiler Error C2056

illegal expression

An expression was illegal because of a previous error, which may not have produced an error message.


expected constant expression
Compiler Error C2057

expected constant expression

The context requires a constant expression.


constant expression is not integral
Compiler Error C2058

constant expression is not integral

The context requires an integral constant expression.


syntax error : 'token'
Compiler Error C2059

syntax error : 'token'

The token caused a syntax error.


syntax error : end-of-file found
Compiler Error C2060

syntax error : end-of-file found

At least one more token was expected.

Causes of this error include omitting a semicolon (;), as in:

int *p    // error

or omitting a closing brace (}) from the last function, as in:

main()
{         // error


syntax error : identifier 'identifier'
Compiler Error C2061

syntax error : identifier 'identifier'

The identifier caused a syntax error.


type 'type' unexpected
Compiler Error C2062

type 'type' unexpected

The compiler did not expect the given type to appear here, possibly because it already had a required type.

This error can also be caused by a missing semicolon.


'identifier' : not a function
Compiler Error C2063

'identifier' : not a function

The given identifier was not declared as a function but was used as a function.

The following example in C generates this error:

int i, j;
j = i();    // error, i is not a function


term does not evaluate to a function
Compiler Error C2064

term does not evaluate to a function

A call was made to a function through an expression that did not evaluate to a function pointer.

This error is probably caused by attempting to call a nonfunction.

The following is an example of this error:

int i, j;
char* p;
void func()
{
   j = i();    // error, i is not a function
   p();        // error, p doesn't point to a function
}


'identifier' : undeclared identifier
Compiler Error C2065

'identifier' : undeclared identifier

The specified identifier was not declared.

A variable's type must be specified in a declaration before it can be used. The parameters that a function uses must be specified in a declaration before the function can be used.

This error can be caused if an include file containing the required declaration was omitted.


cast to function type is illegal
Compiler Error C2066

cast to function type is illegal

An object was cast to a function type, which is illegal.

In ANSI C, it is not legal to cast between a pointer to a function and a pointer to data.


cast to array type is illegal
Compiler Error C2067

cast to array type is illegal

An object was cast to an array type.


illegal cast from 'type1' to 'type2'
Compiler Error C2068

illegal cast from 'type1' to 'type2'

A type used in a cast operation was not legal for this expression.


cast of 'void' term to non-'void'
Compiler Error C2069

cast of 'void' term to non-'void'

A term of type void was cast to a different type.

Type void cannot be cast to any other type.


illegal sizeof operand
Compiler Error C2070

illegal sizeof operand

The operand of a sizeof expression was not an expression or a type name.


'identifier' : illegal storage class
Compiler Error C2071

'identifier' : illegal storage class

The named identifier was declared with an illegal storage class.


'identifier' : initialization of a function
Compiler Error C2072

'identifier' : initialization of a function

An initializer for a function was illegally specified.


'identifier' : partially initialized array requires a default constructor
Compiler Error C2073

'identifier' : partially initialized array requires a default constructor

An array of user-defined types or an array of consts was specified with too few initializers.

If an explicit initializer (and its corresponding constructor) is not specified for a member of an array, then a default constructor must be supplied.

The following is an example of this error:

class A
{
public:
   A( int );              // constructor for ints only
};
A a[3] = { A(1), A(2) };  // error, no default constructor
class B
{
public:
   B();                   // default constructor declared
   B( int );
};
B b[3] = { B(1), B(2) };  // OK


'identifier' : 'class-key' initialization needs curly braces
Compiler Error C2074

'identifier' : 'class-key' initialization needs curly braces

There were no curly braces ({}) around the specified class, structure, or union initializer.


'identifier' : array initialization needs curly braces
Compiler Error C2075

'identifier' : array initialization needs curly braces

There were no curly braces ({}) around the specified array initializer.

The following is an example of this error:

int i[] = 1, 2, 3 };     // error
int i[] = { 1, 2, 3 };   // OK


nonscalar field initializer 'identifier'
Compiler Error C2077

nonscalar field initializer 'identifier'

An attempt was made to initialize a bit-field member of a structure with a nonscalar value.


too many initializers
Compiler Error C2078

too many initializers

The number of initializers exceeded the number of objects to be initialized.


'identifier' uses undefined class/struct/union 'name'
Compiler Error C2079

'identifier' uses undefined class/struct/union 'name'

The specified identifier was declared as a class, structure, or union that was not defined.

This error can be caused by initializing an anonymous union.


'identifier' : name in formal parameter list illegal
Compiler Error C2081

'identifier' : name in formal parameter list illegal

The specified identifier caused a syntax error.

This error can be caused by using the old style for the formal parameter list. The type of formal parameters must be specified in the formal parameter list.

The following is an example of this error:

void func( int i, j )  // error, no type specified for j
{
}


redefinition of formal parameter 'identifier'
Compiler Error C2082

redefinition of formal parameter 'identifier'

A formal parameter to a function was redeclared within the function body.


struct/union comparison illegal
Compiler Error C2083

struct/union comparison illegal

A structure or union was directly compared with another user- defined type.

A user-defined type cannot be compared with another user-defined type unless a comparison operator has been defined or unless a conversion to a scalar type exists.

The following is an example of this error:

struct A
{
   int i;
} a, b;
void func()
{
   if( a == b );   // error, structure comparison
}


function 'function' already has a body
Compiler Error C2084

function 'function' already has a body

The function has already been defined.


'identifier' : not in formal parameter list
Compiler Error C2085

'identifier' : not in formal parameter list

The identifier was declared in a function definition but not in the formal parameter list.

A common cause of this error is the omission of a semicolon (;) at the end of a function prototype, as in:

void func1( void )
void main( void )
{
}

With the semicolon missing, func1() is taken to be a function definition, not a prototype. This means the function main() is being defined within func1(). Error C2085 is generated for the identifier 'main'.

This is an error in ANSI C only.


'identifier' : redefinition
Compiler Error C2086

'identifier' : redefinition

The given identifier was defined more than once, or a subsequent declaration differed from a previous one.

The following examples generate this error:

int a;
char a;
main()
{
}
main()
{
  int a;
  int a;
}

The following is an error in C++ but not in ANSI C:

int a;
int a;
main()
{
}


'identifier' : missing subscript
Compiler Error C2087

'identifier' : missing subscript

The definition of an array with multiple subscripts was missing a subscript value for a dimension other than the first dimension.

The following is an example of this error:

int func(a)
    char a[10][];         // error
    { }
int func(a)
    char a[][5];          // OK
    { }


'operator' : illegal for 'class-key'
Compiler Error C2088

'operator' : illegal for 'class-key'

The specified operator was not defined for the class, structure, or union.

This error can be eliminated by defining a conversion to convert the operands to the type for which the operator is defined. Alternatively, an overloaded conversion operator can be defined.

An example of this error and two solutions are:

class A
{
public:
   int i;
} a;
int i = 1 + a;       // this line causes the error
class B
{
public:
   operator int() { return i; }
   int i;
} b;
int j = 1 + b;       // OK, uses conversion operator
class C
{
public:
   int operator+( int j ) { return (j+i); }  // solution
   int i;
} c;
int k = c + 1;       // OK, uses overloaded operator+
+ c;                 // still an error, no conversion
                     // operator defined for class C

Note that the last line requires that a conversion operator be defined since overloaded operators cannot be defined for built-in types.


'identifier' : 'class-key' too large
Compiler Error C2089

'identifier' : 'class-key' too large

The specified structure or union was larger than 64K.

A structure or union cannot be larger than 64K.


function returns array
Compiler Error C2090

function returns array

A function cannot return an array. It can return a pointer to an array.


function returns function
Compiler Error C2091

function returns function

A function cannot return a function. It can return a pointer to a function.


array element type cannot be function
Compiler Error C2092

array element type cannot be function

Arrays of functions are not allowed. Arrays of pointers to functions are allowed.


cannot use address of automatic variable as static initializer
Compiler Error C2093

cannot use address of automatic variable as static initializer

The program tried to use the address of an automatic variable in the initializer of a static item, as in the following example:

func()
{
    int i;
    static int *ip=&i;    // error
}


label 'identifier' was undefined
Compiler Error C2094

label 'identifier' was undefined

A goto label was found, but the specified label did not exist in the same function.


'function' : actual parameter has type void : parameter 'number'
Compiler Error C2095

'function' : actual parameter has type void : parameter 'number'

An attempt was made to pass a void argument to a function. The given number indicates which parameter was in error.

Formal parameters and parameters to functions cannot have type void. They can, however, have type void * (pointer to void).


illegal initialization
Compiler Error C2097

illegal initialization

One of the following was illegally attempted:

Initialization of a variable using a nonconstant value

Initialization of a short address with a long address

Initialization of a local structure, union, or array with a nonconstant expression when compiling with /Za

Initialization with an expression containing a comma operator (,)

Initialization with an expression that is neither constant nor symbolic


nonaddress expression
Compiler Error C2098

nonaddress expression

An address was expected as the initialization expression.


nonconstant initializer
Compiler Error C2099

nonconstant initializer

The initializer was not a constant.

The following is an example of this error when compiled as C:

int i, j;
int *p;
j = i();    // error, i() is not constant
j = *p;     // error, *p is not a constant


illegal indirection
Compiler Error C2100

illegal indirection

The indirection operator (*) was applied to a nonpointer value.


'&' on constant
Compiler Error C2101

'&' on constant

The address-of operator (&) did not have an l-value as its operand.


'&' requires l-value
Compiler Error C2102

'&' requires l-value

The address-of operator (&) must be applied to an l-value expression.


'&' on register variable
Compiler Error C2103

'&' on register variable

An attempt was made to use the address of a register variable.


'&' on bit field ignored
Compiler Error C2104

'&' on bit field ignored

An attempt was made to use the address of a bit field.


'operator' needs l-value
Compiler Error C2105

'operator' needs l-value

The given operator did not have an l-value operand.


'operator' : left operand must be l-value
Compiler Error C2106

'operator' : left operand must be l-value

The left operand of the given operator was not an l-value.


illegal index, indirection not allowed
Compiler Error C2107

illegal index, indirection not allowed

A subscript was applied to an expression that did not evaluate to a pointer.


nonintegral index
Compiler Error C2108

nonintegral index

A nonintegral expression was used in an array subscript.


subscript on nonarray
Compiler Error C2109

subscript on nonarray

A subscript was used on a variable that was not an array.


pointer + pointer
Compiler Error C2110

pointer + pointer

An attempt was made to add one pointer to another using the plus operator (+).


pointer + nonintegral value
Compiler Error C2111

pointer + nonintegral value

An attempt was made to add a nonintegral value to a pointer using the plus operator (+).


illegal pointer subtraction
Compiler Error C2112

illegal pointer subtraction

An attempt was made to subtract pointers that did not point to the same type.


pointer subtracted from nonpointer
Compiler Error C2113

pointer subtracted from nonpointer

The right operand in a subtraction operation using the minus operator (-) was a pointer, but the left operand was not.


'operator' : pointer on left; needs integral value on right
Compiler Error C2114

'operator' : pointer on left; needs integral value on right

The left operand of the given operator was a pointer. Therefore, the right operand must be an integral value.


'identifier' : incompatible types
Compiler Error C2115

'identifier' : incompatible types

An expression contained incompatible types.


function parameter lists differed
Compiler Error C2116

function parameter lists differed

The parameters in the default parameter list did not match the formal parameter list.


'identifier' : array bounds overflow
Compiler Error C2117

'identifier' : array bounds overflow

Too many initializers were present for the given array.

Make sure that the array elements and initializers match in size and quantity.

This error can be caused by lot leaving space for the null terminator in a string.

The following is an example of this error:

char abc[4] = "abcd"; // error, array contains 5 members


negative subscript or subscript is too large
Compiler Error C2118

negative subscript or subscript is too large

A value defining an array size was negative or exceeded the maximum array size.


typedef types both define indirection
Compiler Error C2119

typedef types both define indirection

Two typedef types were used to declare an item, and both typedef types had indirection.

For example, the declaration of p in the following example is illegal:

typedef int *p_int;
typedef short *p_short;
p_short p_int p;        // error


'void' illegal with all types
Compiler Error C2120

'void' illegal with all types

The void type was used in a declaration with another type.


'operator' : bad left/right operand
Compiler Error C2121

'operator' : bad left/right operand

The left or right operand of the given operator was illegal for that operator.


'identifier' : prototype parameter in name list illegal
Compiler Error C2122

'identifier' : prototype parameter in name list illegal

The specified parameter was not a legal type.

User-defined types are not supported in ANSI C.


'function1' : cannot call __fastcall function 'function2' from p-code
Compiler Error C2123

'function1' : cannot call __fastcall function 'function2' from p-code

There was an attempt to call a fastcall function from within a p-code function.

Rebuild function2 with a different calling convention, or turn off p-code generation for function1 by using #pragma optimize( "q", off ).


divide or mod by zero
Compiler Error C2124

divide or mod by zero

A constant expression was evaluated and found to have a zero denominator.


'identifier' : allocation exceeds 64K
Compiler Error C2125

'identifier' : allocation exceeds 64K

The given item exceeded the size limit of 64K.


'operand' : incorrect operand
Compiler Error C2126

'operand' : incorrect operand

The specified operator was used on an enumeration.

The increment and decrement operators (++ and --) are not defined for enumerated types.


parameter allocation exceeds 32K
Compiler Error C2127

parameter allocation exceeds 32K

The storage space required for the parameters to a function exceeded the limit of 32K.


'function' : alloc_text/same_seg applicable only to functions with C linkage
Compiler Error C2128

'function' : alloc_text/same_seg applicable only to functions with C linkage

A #pragma alloc_text(segname, func_name) was specified for a function declared with C++ linkage.

The _based syntax should be used to control allocation of C++ functions in segments.


static function 'function' declared but not defined
Compiler Error C2129

static function 'function' declared but not defined

A forward reference was made to a static function that was never defined.

A function declared with static linkage must be defined within file scope. If the function is defined in another file, it should be declared with the keyword extern.


#line expected a string containing the file name, found 'token'
Compiler Error C2130

#line expected a string containing the file name, found 'token'

The optional token following the line number on a #line directive was not a string.


syntax error : unexpected identifier
Compiler Error C2132

syntax error : unexpected identifier

An identifier appeared in a syntactically illegal context.


'identifier' : unknown size
Compiler Error C2133

'identifier' : unknown size

An unsized array was declared as a member of a class, structure, union, or enumeration.

Unsized member arrays are not allowed when the /Za (ANSI) switch has been chosen.

The following is an example of this error:

struct X
{
   int a[0]; // error, unsized array
};


'identifier' : struct/union too large
Compiler Error C2134

'identifier' : struct/union too large

The size of a structure or union exceeded the compiler limit of 64K.


'identifier' : illegal bit field operation
Compiler Error C2135

'identifier' : illegal bit field operation

The address of the specified bit field was taken.

The address-of operator (&) cannot be applied to a bit field.

The following is an example of this error:

struct S
{
   int i : 1;
   int j;
};
void main()
{
   &S::i;      // error, address of a bit field
   &S::j;      // OK
}


'function' : prototype must have parameter types
Compiler Error C2136

'function' : prototype must have parameter types

A function prototype declaration had formal parameter names, but no types were provided for the parameters.

A formal parameter in a function prototype must either have a type or be represented by an ellipsis (...) to indicate a variable number of parameters and no type checking.

One cause of this error is a misspelling of a type name in a prototype that does not provide the names of the formal parameters.


empty character constant
Compiler Error C2137

empty character constant

The illegal empty character constant (' ') was used.


cannot define an enumeration with no members
Compiler Error C2138

cannot define an enumeration with no members

An empty enumeration was defined.

An enumeration must have at least one member.

This is an error when the /Za (disable Microsoft extensions) switch has been selected.


type following 'identifier' is illegal
Compiler Error C2139

type following 'identifier' is illegal

Two types were used in the same declaration, as in:

int double a;    // error


parameter cannot be function type
Compiler Error C2140

parameter cannot be function type

A function was illegally declared as a formal parameter of another function.


value out of range for enum constant
Compiler Error C2141

value out of range for enum constant

An enumeration constant had a value outside the range of values allowed for an integer type.


function declarations differ, variable parameters specified only in one of them
Compiler Error C2142

function declarations differ, variable parameters specified only in one of them

One declaration of the function contained a variable parameter list, but another declaration did not.

This causes an error in C when the /Za (ANSI) switch is chosen.

The following is an example of this error:

void func();
void func( int, ... );    // error


syntax error : missing 'token1' before 'token2'
Compiler Error C2143

syntax error : missing 'token1' before 'token2'

The compiler expected token1 to appear before token2.

This error can be caused by a missing closing brace (}), right parenthesis, or semicolon (;). The missing token may belong on the line above where the error was detected.

This error can also be caused by an invalid tag in a class declaration.

The following are examples of this error:

class X
{
   int member
} x;               // error, missing ; on previous line
class + {};        // error, + is invalid tag name

This error can also be caused by placing a label by itself without a being attached to a statement. If you need to place a label by itself, for example at the end of a compound statement, it can be attached to a null statement.

The following is an example of this error:

void func1()
{
   end:      // error
}            // this line is not a statement

void func2()
{
   end:      // OK
   ;         // this label attached to null statement
}

This error can also be caused when the ANSI compatibility option (/Za) is in effect and the source code contains single line comments.

The following is an example of this error:

int i;    // error: missing ';' before 'division operator'
int j;    /* no error */


syntax error : missing 'token' before type 'type'
Compiler Error C2144

syntax error : missing 'token' before type 'type'

The compiler expected the given token to appear before the given type name.

This error can be caused by a missing closing brace (}), right parenthesis, or semicolon (;).


syntax error : missing 'token' before identifier
Compiler Error C2145

syntax error : missing 'token' before identifier

The compiler expected the given token to appear before an identifier.

This error can be caused by a missing semicolon (;) after the last declaration in a block.


syntax error : missing 'token' before identifier 'identifier'
Compiler Error C2146

syntax error : missing 'token' before identifier 'identifier'

The compiler expected the given token to appear before the given identifier.


'identifier' : const array must be fully initialized
Compiler Error C2147

'identifier' : const array must be fully initialized

The specified array was declared as const but one or more elememts were not initialized.

All elements of a const array must be initialized when it is defined.

The following is an example of this error:

const int arr[10] = { 1, 2}; // error


array too large
Compiler Error C2148

array too large

An array exceeded the maximum legal size of 64K.

Either reduce the size of the array or declare it with __huge.


'identifier' : named bit field cannot have zero width
Compiler Error C2149

'identifier' : named bit field cannot have zero width

The given named bit field had zero width. Only unnamed bit fields are allowed to have zero width.


'identifier' : bit field must have type 'int', 'signed int', or 'unsigned int'
Compiler Error C2150

'identifier' : bit field must have type 'int', 'signed int', or 'unsigned int'

The ANSI C standard requires bit fields to have types of int, signed int, or unsigned int. This message appears only when compiling with the /Za option.


more than one language attribute
Compiler Error C2151

more than one language attribute

More than one keyword specifying a calling convention ( __cdecl, __fortran, __pascal, or __fastcall) for a function was given.


'identifier' : pointers to functions with different attributes
Compiler Error C2152

'identifier' : pointers to functions with different attributes

An attempt was made to assign a pointer to a function declared with one calling convention (__cdecl, __fortran, __pascal, or __fastcall) to a pointer to a function declared with a different calling convention.


hex constants must have at least one hex digit
Compiler Error C2153

hex constants must have at least one hex digit

The hexadecimal constants 0x, 0X, and \x are illegal. At least one hexadecimal digit must follow the x or X.


pragma must be outside function
Compiler Error C2156

pragma must be outside function

A pragma that must be specified at a global level (that is, outside a function body) occurred within a function.

The following is an example of this error:

main()
{
  #pragma optimize( "l", on )   // error

}


'function' : must be declared before use in pragma list
Compiler Error C2157

'function' : must be declared before use in pragma list

The function name in the list of functions for an alloc_text pragma has not been declared prior to being referenced in the list.


'identifier' : is a function
Compiler Error C2158

'identifier' : is a function

The given identifier was specified in the list of variables in a same_seg pragma but was previously declared as a function.


more than one storage class specified
Compiler Error C2159

more than one storage class specified

A declaration contained more than one storage class, as in:

extern static int i;      // error


## cannot occur at the beginning of a macro definition
Compiler Error C2160

## cannot occur at the beginning of a macro definition

A macro definition began with a token-pasting operator (##), as in:

#define mac(a,b) ##a    // error


## cannot occur at the end of a macro definition
Compiler Error C2161

## cannot occur at the end of a macro definition

A macro definition ended with a token-pasting operator (##), as in:

#define mac(a,b) a##    // error


expected macro formal parameter
Compiler Error C2162

expected macro formal parameter

The token following a stringizing operator (#) was not a formal parameter name.

The following is an example of this error:

#define print(a) printf(#b)    // error


'function' : not available as an intrinsic function
Compiler Error C2163

'function' : not available as an intrinsic function

A function specified in the list of functions for an intrinsic or function pragma is not one of the functions available in intrinsic form.


'function' : intrinsic function not declared
Compiler Error C2164

'function' : intrinsic function not declared

The given function was not declared before being used in an intrinsic pragma. This error appears only when compiling with the /Oi option.


'keyword' : cannot modify pointers to data
Compiler Error C2165

'keyword' : cannot modify pointers to data

The __fortran, __pascal, __cdecl, or __fastcall keyword was used illegally to modify a pointer to data, as in the following example:

char __pascal *p;   // error


l-value specifies const object
Compiler Error C2166

l-value specifies const object

An attempt was made to modify an item declared with const type.


'function' : too many actual parameters for intrinsic function
Compiler Error C2167

'function' : too many actual parameters for intrinsic function

A reference to a function declared as intrinsic contained too many actual parameters.


'function' : too few actual parameters for intrinsic function
Compiler Error C2168

'function' : too few actual parameters for intrinsic function

A reference to a function declared as intrinsic contained too few actual parameters.


'function' : intrinsic function; cannot be defined
Compiler Error C2169

'function' : intrinsic function; cannot be defined

An attempt was made to provide a function definition for a function already declared as an intrinsic.


'identifier' : not declared as a function; cannot be intrinsic
Compiler Error C2170

'identifier' : not declared as a function; cannot be intrinsic

The intrinsic pragma was used for an item other than a function or for a function that does not have an intrinsic form.


'operator' : illegal operand
Compiler Error C2171

'operator' : illegal operand

The given unary operator was used with an illegal operand type, as in the following example:

int (*fp)();
double d, d1;

fp++;           // error
d = ~d1;        // error


'function' : actual parameter is not a pointer : parameter 'number'
Compiler Error C2172

'function' : actual parameter is not a pointer : parameter 'number'

An attempt was made to pass an parameter that was not a pointer to a function that expected a pointer. The given number indicates which parameter was in error.


'function' : actual parameter is not a pointer : parameter 'number1', parameter list 'number2'
Compiler Error C2173

'function' : actual parameter is not a pointer : parameter 'number1', parameter list 'number2'

An attempt was made to pass a nonpointer parameter to a function that expected a pointer.

This error occurs in calls that return a pointer to a function. The first number indicates which parameter was in error; the second number indicates which parameter list contained the invalid parameter.


'function' : actual parameter has type 'void' : parameter 'number1', parameter list 'number2'
Compiler Error C2174

'function' : actual parameter has type 'void' : parameter 'number1', parameter list 'number2'

An attempt was made to pass a void parameter to a function. Formal parameters and parameters to functions cannot have type void. They can, however, have type void* (pointer to void).

This error occurs in calls that return a pointer to a function. The first number indicates which parameter was in error; the second number indicates which argument list contained the invalid parameter.


static huge data not supported by 'identifier'
Compiler Error C2176

static huge data not supported by 'identifier'

A huge array was declared in a p-code function.

Arrays declared using __huge are not allowed in p-code functions.


constant too big
Compiler Error C2177

constant too big

A constant value was too large to be represented in the type to which it was assigned.


'identifier' : storage class for same_seg variables must be extern
Compiler Error C2178

'identifier' : storage class for same_seg variables must be extern

The given variable was specified in a same_seg pragma, but the variable was not declared with extern storage class.


'identifier' : was used in same_seg, but storage class is no longer extern
Compiler Error C2179

'identifier' : was used in same_seg, but storage class is no longer extern

The given variable was specified in a same_seg pragma, but the variable was redeclared with a storage class other than extern.


controlling expression has type 'void'
Compiler Error C2180

controlling expression has type 'void'

The controlling expression in an if, while, for, or do statement was either a function with void return type or an expression cast to void.


'identifier' : has type 'void'
Compiler Error C2182

'identifier' : has type 'void'

The given variable was declared with the keyword void, which can be used only in function declarations.


syntax error: translation unit is empty
Compiler Error C2183

syntax error: translation unit is empty

A source file was empty after preprocessing.


illegal return of a 'void' value
Compiler Error C2184

illegal return of a 'void' value

The function did not return a value.

The function was declared as returning a nonvoid value, but the return statement did not return a value.


'operand' : illegal operand of type 'void'
Compiler Error C2186

'operand' : illegal operand of type 'void'

The specified operator had a void operand.

The following is an example of this error:

void func1( void );
int  func2( void );
int i = 2 + func1();   // error, func1() is type void
int j = 2 + func2();   // OK, both operands are type int


cast of near function pointer to far function pointer
Compiler Error C2187

cast of near function pointer to far function pointer

A near function pointer was cast to a far function pointer.

This cast is not allowed.


'number' : too big for wide character
Compiler Error C2188

'number' : too big for wide character

The given number is too large to be held in the wide-character type.

Choose a larger type to hold the given value.


#error : 'string'
Compiler Error C2189

#error : 'string'

An #error directive was encountered.

The string is the descriptive text supplied in the directive.


first parameter list longer than second
Compiler Error C2190

first parameter list longer than second

The function was declared a second time with a shorter parameter list.

C does not support overloaded functions.

The following is an example of this error:

void func( int, float );
void func( int,  );        // error, different parameter list


second parameter list longer than first
Compiler Error C2191

second parameter list longer than first

The function was declared a second time with a longer parameter list.

C does not support overloaded functions.

The following is an example of this error:

void func( int );
void func( int, float ); // error, different parameter list


parameter 'number' declaration different
Compiler Error C2192

parameter 'number' declaration different

The function was declared a second time with a different parameter list.

C does not support overloaded functions.

The following is an example of this error:

void func( float, int );
void func( int, float ); // error, different parameter list


'identifier' : too many actual parameters
Compiler Error C2197

'identifier' : too many actual parameters

The specified function was called with too many parameters, or the function declaration was incorrect.

The following is an example of this error:

void func( int );
main()
{
   func( 1, 2 );   // error, two actual parameters
}


'identifier' : too few actual parameters
Compiler Error C2198

'identifier' : too few actual parameters

The specified function was called with too few parameters, or the function declaration was incorrect.

The following is an example of this error:

void func( int, int );
main()
{
   func( 1 );   // error, only one actual parameter
}


syntax error : found 'identifier (' at global scope (was a declaration intended?)
Compiler Error C2199

syntax error : found 'identifier (' at global scope (was a declaration intended?)

The specified context caused a syntax error.

This error can be caused by incorrect declaration syntax.

The following is an example of this error:

struct S
{
public:
   int i;
   S( int si ) { i = si; }
};
S(1) s; // error, incorrect syntax
S s(1); // OK


'function' : function has already been defined
Compiler Error C2200

'function' : function has already been defined

A function name passed as an parameter in an alloc_text pragma has already been defined.


'identifier' : cannot export static declarations
Compiler Error C2201

'identifier' : cannot export static declarations

The specified static identifier was exported.

The following is an example of this error:

static void __export func() {}  // error, func() is static
void __export func() {}         // OK


'function' : not all control paths return a value
Compiler Error C2202

'function' : not all control paths return a value

The specified function can potentially not return a value.

The following is an example of this error:

int func1( int i )
{
   if( i ) return 3;  // error, nothing returned if i = 0
}
int func2( int i )
{
   if( i ) return 3;
   else return 0;     // OK, always returns a value
}


delete operator cannot specify bounds for an array
Compiler Error C2203

delete operator cannot specify bounds for an array

The delete operator can only delete an entire array; it cannot delete parts or specific members of the array. This error is generated only with the /Za ANSI-compatibility option.

This was not an error in C++ 2.0 but is an error in C++ 2.1.

The following statement generates this error:

delete [4] ArrayOfObjects;   // error


'identifier' : parenthesized type definition
Compiler Error C2204

'identifier' : parenthesized type definition

The specifed type was defined in prototype scope or as an operand.

The following is an example of this error:

( struct S {}; );  // error


'identifier' : cannot initialize extern block scoped variables
Compiler Error C2205

'identifier' : cannot initialize extern block scoped variables

A variable with extern storage class cannot be initialized in a function.


'function' : typedef cannot be used for function definition
Compiler Error C2206

'function' : typedef cannot be used for function definition

A typedef was used to define a function type.

For example:

typedef int functyp();
functyp func1 {};        // error


'member' in struct/union 'tag' has a zero-sized array
Compiler Error C2207

'member' in struct/union 'tag' has a zero-sized array

The given member in the structure or union contains an array that does not have a subscript or that has a zero subscript. This kind of array is legal only as the last member of a structure or union.


'type' : no members defined using this type
Compiler Error C2208

'type' : no members defined using this type

An enumeration, structure, or union was defined without any members. This is an error only when compiling with /Za; otherwise, it is a warning.


'attribute1' cannot be used with 'attribute2'
Compiler Error C2216

'attribute1' cannot be used with 'attribute2'

The given function attributes are incompatible.

Some combinations of attributes that cause this error are:

__saveregs and __interrupt

__fastcall and __saveregs

__fastcall and __interrupt

__fastcall and __export


'attribute1' must be used with 'attribute2'
Compiler Error C2217

'attribute1' must be used with 'attribute2'

The first function attribute requires the use of the second attribute.

Some causes for this error include:

An interrupt function explicitly declared as near. Interrupt functions must be declared as far.

An interrupt function that is declared with the __fortran, __pascal, or __fastcall attribute. Functions declared with the __interrupt attribute must use  C calling conventions.

A function with a variable number of parameters that is declared with the __fortran, __pascal, or __fastcall attribute. These functions must use C calling conventions. Remove the __fortran, __pascal, or __fastcall attribute from the function declaration.


syntax error : type qualifier must be after '*'
Compiler Error C2219

syntax error : type qualifier must be after '*'

Either const or volatile appeared where a type or qualifier is not permitted, as in:

int (const *p);    // error


warning treated as error - no object file generated
Compiler Error C2220

warning treated as error - no object file generated

When the compiler option /WX is used, the first warning generated by the compiler causes this error message to be displayed.

Either correct the condition that caused the warning or compile at a lower warning level or without /WX.


'.' : left operand points to class/struct/union. use '->'
Compiler Error C2221

'.' : left operand points to class/struct/union. use '->'

The left operand of the member-of operator (.) must be a class, (or structure or union) but not a pointer to a class type.

The class member access operator (->) can be used with a pointer to a class, structure, or union.


'->' : left operand has class/struct/union type, use '.'
Compiler Error C2222

'->' : left operand has class/struct/union type, use '.'

The left operand of the class member access operator (->) must be a pointer to a class (or structure or union) type but not a class type.

The member-of operator (.) can be used with a class, structure, or union type.


left of '->member' must point to class/struct/union
Compiler Error C2223

left of '->member' must point to class/struct/union

The left operand of the member access operator (->) is not a pointer to a class, structure, or union type.

This error can occur when the left operand is an undefined variable. Undefined variables have type int.


left of '.member' must have class/struct/union type
Compiler Error C2224

left of '.member' must have class/struct/union type

The left operand of the member-of operator (.) is not a class, structure, or union type.

This error can occur when the left operand is an undefined variable. Undefined variables have type int.


syntax error : unexpected type 'type'
Compiler Error C2226

syntax error : unexpected type 'type'

A syntax error occured before, or in, the given type specifier.

The following is an example of this error:

int func1( int, ... , float ); // error, misplaced ellipsis
int func2( int, float, ... );  // OK


left of '->identifier' must point to class/struct/union
Compiler Error C2227

left of '->identifier' must point to class/struct/union

The left side of the specified class member access operator (->) was not a pointer to a class, structure, or union.

The following is an example of this error:

int  *pInt;

struct S
{
public:
    int member;
} *pS;
void main()
{
    pInt->member = 0;   // error, pInt points to an int
    pS->member = 0;     // OK, pS points to a structure S
}


left of '.identifier' must have class/struct/union type
Compiler Error C2228

left of '.identifier' must have class/struct/union type

The left side of the specified class member access operator (.) was not a class (or structure or union) type.

The following is an example of this error:

int i;

struct S
{
public:
    int member;
} s, *ps;
void main()
{
   i.member = 0;   // error, i is not a class type
   ps.member = 0;  // error, ps is a pointer to a structure
   s.member = 0;   // OK, s is a structure type
   ps->member = 0; // OK, ps points to a structure S
}


type 'identifier' has an illegal zero-sized array
Compiler Error C2229

type 'identifier' has an illegal zero-sized array

The specified member of the structure or bit field contained a zero-sized array.

The following is an example of this error:

struct S
{
   int a[0];  // error, zero-sized array
   int b[1];  // OK
};


'operator' : indirection to different types
Compiler Error C2230

'operator' : indirection to different types

The pointer expressions used with the given operator had different base types.

The pointer expressions were used without conversion. This causes a warning in ANSI C but is an error in C++.

The following is an example of this error:

struct ts1 *s1;
struct ts2 *s2;
s2 = s1;   // error


'.' : left operand points to 'class-key', use '->'
Compiler Error C2231

'.' : left operand points to 'class-key', use '->'

The left operand to the member selection operator (.) was a pointer to a class, structure, or union.

The left operand to the member selection operator must be a class, structure, or union.

The following is an example of this example:

struct S
{
public:
    int member;
} s, *ps;
void main()
{
   ps.member = 0;  // error, ps points to structure S
   ps->member = 0; // OK, ps points to a structure S
   s.member = 0;   // OK, s is a structure type
}


'->' : left operand has 'class-key' type, use '.'
Compiler Error C2232

'->' : left operand has 'class-key' type, use '.'

The class member access operator (->) was used on a nonpointer.

The pointer form of the class member access operator can only be used with a pointer to a class, structure, or union. The dot (.) form of the operator should be used with a class, structure, or union type.

The following is an example of this error:

struct X
{
    int member;
} x, *px;
void main()
{
    x->member = 0;   // error, x is not a pointer
    px->member = 0;  // OK, px is a pointer to an X
    x.member = 0;    // OK
}


arrays of references are illegal
Compiler Error C2234

arrays of references are illegal

An array of references was declared.

Since pointers to references are not allowed, arrays of references are not possible. A pointer should be used to implement the array.


';' in formal parameter list
Compiler Error C2235

';' in formal parameter list

A semicolon (;) was found in a formal parameter list.

The error is usually caused by using a semicolon instead of a comma (,) to separate parameters in a formal parameter list.

The following is an example of this error:

void func( int i; float f );   // error, uses semicolon
void func( int i, float f );   // OK, uses comma


unexpected 'class-key' 'identifer'
Compiler Error C2236

unexpected 'class-key' 'identifer'

The specified identifier was already defined as a type and cannot be overridden by another user-defined type.


unexpected class-key 'identifer'
Compiler Error C2237

unexpected class-key 'identifer'

The specified class-key was not followed by a valid class name.

The following is an example of this error:

class + {};  // error, + is invalid class name


unexpected token[s] preceding 'token'
Compiler Error C2238

unexpected token[s] preceding 'token'

An incorrect token, or tokens, was found before the specified token.

This error can be caused by an invalid name in a bit-field declaration.

The following is an example of this error:

struct bits
{
   int field1 : 16;
   int 9      : 16;  // error, 9 is not a valid name
};


unexpected token 'token' following declaration of 'identifier'
Compiler Error C2239

unexpected token 'token' following declaration of 'identifier'

An unexpected token was found in the specified declaration.

The following is an example of this error:

int i 8;   // error, missing =
int j = 7; // OK


unexpected 'token' following formal list. (only modifiers are allowed.)
Compiler Error C2240

unexpected 'token' following formal list. (only modifiers are allowed.)

The specified token was found after a formal parameter list.

The following is an example of this error:

void func() int;  // error
void func();      // OK


'identifier' : member access is restricted
Compiler Error C2241

'identifier' : member access is restricted

There was an attempt to access a private or protected member function or data.

If the program needs to access this member, change the object access level or make the member a friend of the function that needs to be accessed.


'typedef name cannot follow class/struct/union
Compiler Error C2242

typedef name cannot follow class/struct/union


'conversion type' conversion exists from 'type1' to 'type2', but is inaccessible
Compiler Error C2243

'conversion type' conversion exists from 'type1' to 'type2', but is inaccessible

A pointer to a derived class was converted to a pointer to a base class, but the derived class inherited the base class with private or protected access.

The following is an example of this error:

class B {};
class D : private B {};

D d;
B *p = &d;      // error


'identifier' : unable to resolve function overload
Compiler Error C2244

'identifier' : unable to resolve function overload

The specified overloaded function call was ambiguous.

The following is an example of this error:

int func( char );
int func( int );
void main ()
{
   +func;       // error, can't resolve which func to use
   +func( 0 );  // OK
}


nonexistent function 'identifier' specified as friend
Compiler Error C2245

nonexistent function 'identifier' specified as friend

The specified identifier was not a function.

Only a function can be specified as a friend.

The following is an example of this error:

class C
{
public:
   int i;                  // i is not a function
   void func();
};
class S
{
public:
   friend void C::i();     // error
   friend void C::func();  // OK
};


'identifer' : illegal static data member in locally defined class
Compiler Error C2246

'identifer' : illegal static data member in locally defined class

The specified member of a class, structure, or union with local scope was declared as static.

The following is an example of this error:

void func( void )
{
   class A
   {
 static int i;    // error, i is local to func
   };
};
class B
{
   static int i;       // OK
};


'identifier' not accessible because 'class' uses 'specifier' to inherit from 'class'
Compiler Error C2247

'identifier' not accessible because 'class' uses 'specifier' to inherit from 'class'

The specified identifier was inherited from a class declared with private or protected access.

The following is an example of this error:

class A
{
public:
   int i;
};
class B : private A {};    // B inherits a private A
class C : public B {} c;   // so even though C's B is public
int j = c.i;               // error, i not accessible


'member' : cannot access 'access' 'member' declared in class 'class'
Compiler Error C2248

'member' : cannot access 'access' 'member' declared in class 'class'

The specified private or protected member of a class, structure, or union was accessed.

This error can be caused by accessing a member that is declared as private or protected, or by accessing a public member of a base class that is inherited with private or protected access.

The member should be accessed through a member function with public access or should be declared with public access.

The following is an example of this error:

class X
{
public:
   int pubMemb;
   void setPrivMemb( int i ) { privMemb = i; }
protected:
   int protMemb;
private:
   int privMemb;
} x;
class Y : X {} y;       // default access to X is private
void main()
{
   x.privMemb;          // error, privMemb is private
   x.protMemb;          // error, protMemb is protected
   y.pubMemb;           // error, Y inherits X as private
   x.pubMemb;           // OK, pubMemb is public
   x.setPrivMemb( 0 );  // OK, uses public access function
}


'identifier' : no accessible path to 'specifier' member declared in virtual base 'class'
Compiler Error C2249

'identifier' : no path to 'access' 'member' declared in virtual base 'class'

The specified inherited member was inherited from a nonpublic virtual base class or structure.

The following is an example of this error:

class A
{
private:
   void privFunc( void ) {};
public:
   void pubFunc( void ) {};
};
class B : virtual public A {} b;
void main( void )
{
   b.privFunc();        // error, private member of A
   b.pubFunc();         // OK
}


'identifier' : ambiguous inheritance of 'class::member'
Compiler Error C2250

'identifier' : ambiguous inheritance of 'class::member'

The derived class inherited more than one override of a virtual function of a virtual base.  These overrides are ambiguous in the derived class.

The following is an example of this error:

struct V { virtual void vf(); };
struct A : virtual V { void vf(); };
struct B : virtual V { void vf(); };
struct D : A, B {};                   //error


'identifier' : defined but not declared
Compiler Error C2251

'identifier' : defined but not declared

The specified destructor was defined, but not declared in the class body. A compiler-generated destructor is used if a destructor declaration is not in the class body.

The following is an example of this error:

class C
{
  C();     // only a constructor is declared
};

C::C() {}  // OK, constructor is defined

C::~C()    // undeclared destructor definition
{          // error on this line
}


'identifier' : pure specifier can only be specified for functions
Compiler Error C2252

'identifier' : pure specifier can only be specified for functions

The given nonfunction was specified as pure virtual.

Only member functions specified as virtual can be declared with a pure specifier.

The following is an example of this error:

class A
{
   virtual int i = 0;          // error, i is an int
   virtual void func() = 0;    // OK, func is a function
};


'function' : pure specifier only applies to virtual function -- specifier ignored
Compiler Error C2253

'function' : pure specifier only applies to virtual function -- specifier ignored

The specified nonvirtual function was specified as pure virtual.

The specifier was ignored.

The following is an example of this error:

class A
{
public:
  void func1() = 0;          // error, not virtual
  virtual void func2() = 0;  // OK
};


'function' : pure specifier not allowed on friend functions
Compiler Error C2254

'function' : pure specifier not allowed on friend functions

The specified friend function was specified as pure virtual.

The following is an example of this error:

class A
{
public:
   friend void func1() = 0;   // error, func1 is friend
   void virtual func2() = 0;  // OK, pure virtual
   friend void func3();       // OK, friend not virtual nor
};                            //     pure
void func1() {};
void func3() {};


'function' : a friend function can only be declared in a class
Compiler Error C2255

'function' : a friend function can only be declared in a class

The specified function was declared with the friend specifier outside of a class, structure, or union.

The following is an example of this error:

class A
{
private:
   void func1();
   friend void func2();
};
friend void func1() {};    // error
void func2() {};           // OK


illegal use of friend specifier on 'destructor'
Compiler Error C2256

illegal use of friend specifier on 'destructor'

The specified destructor was specified as a friend.

A destructor cannot be specifed as a friend.

The following is an example of this error:

class C
{
public:
   friend ~C(); // error
   ~C();        // OK
};


p-code generation pragma not allowed without /Oq
Compiler Error C2257

p-code generation pragma not allowed without /Oq

The "q" optimization pragma is not allowed without the /Oq p-code command-line option.

To generate p-code from CL, use the /Oq p-code command-line option. Once the option has been set, the optimization pragmas can turn p-code generation on and off.


illegal pure syntax, must be '= 0'
Compiler Error C2258

illegal pure syntax, must be '= 0'

A pure virtual function was declared with incorrect syntax.

The following is an example of this error:

class A
{
public:
   void virtual func1() = 1; // error, not = 0
   void virtual func2() = 0; // OK
};


'class' : illegal attempt to instantiate abstract class
Compiler Error C2259

'class' : illegal attempt to instantiate abstract class

An object of the specified abstract class or structure was declared.

A class (or structure) with one or more pure virtual functions cannot be instantiated. Each pure virtual function must be overridden in a derived class before objects of the derived class can be instantiated.

The following is an example of this error:

class V
{
public:
   void virtual func() = 0;
};
class A : public V {};
class B : public V
{
public:
   void func();
};
V v;  // error, V is an abstract class
A a;  // error, A inherits func() as pure virtual
B b;  // OK, B defines func()


function pointer cast to a data pointer
Compiler Error C2260

function pointer cast to a data pointer

A pointer to a function was cast to a pointer to data.

This cast is not legal in ANSI C.

This cast is legal in C++ and is allowed by the Microsoft extensions (using the /Ze switch).


data pointer cast to a function pointer
Compiler Error C2261

data pointer cast to a function pointer

A pointer to data was cast to a pointer to a function.

This cast is not legal in ANSI C.

This cast is legal in C++ and is allowed by the Microsoft extensions (using the /Ze switch).


'identifier' : cannot be destroyed
Compiler Error C2262

'identifier' : cannot be destroyed

The specified identifier was not instantiated because an appropriate destructor was not available.

The following is an example of this error:

class B
{
   ~B();
};
class D : public B {};
D d;         // error, B's destructor is private


'function' : error in function definition or declaration; function not called
Compiler Error C2264

'function' : error in function definition or declaration; function not called

Since specified function was incorrectly defined or declared, it could not be called.

The following is an example of this error:

class C
{
public:
   operator int( int = 10 );    // incorrect declaration here
};
void main()
{
   int i;
   C c;
   i = c;                       // error
}


'identifier' : reference to a zero sized array is illegal
Compiler Error C2265

'identifier' : reference to a zero sized array is illegal

The specified reference was declared for an array with zero size.

References can only be declared for arrays with nonzero, nonconstant bounds.


'identifier' : reference to a nonconstant bounded array is illegal
Compiler Error C2266

'identifier' : reference to a nonconstant bounded array is illegal

The specified reference was declared for an array with a nonconstant bound.

References can only be declared for arrays with constant bounds.


'function' : block scoped static functions are illegal
Compiler Error C2267

'function' : block scoped static functions are illegal

The specified local function was declared as static.

Static functions must be declared with global scope.

The following is an example of this error:

void main()
{
    static int func1();    // error
}


'operation' : different const or volatile qualifiers
Compiler Error C2268

'operation' : different const or volatile qualifiers

The given operation was performed on a variable that was defined as being const or volatile. As a result, the const or volatile item could be modified without being detected by the compiler.

This error often occurs when a pointer to an item declared as const or volatile is assigned to a pointer that was not declared as pointing to either of these type modifiers.

The following is an example of this error:

const  char *p = "abcde";
int    str( char *s );
str( p );                // error


'identifier' : modifiers not allowed on nonmember functions
Compiler Error C2270

'identifier' : modifiers not allowed on nonmember functions

The specified nonmember function was declared with a memory-model modifier.

Only functions that are members of a class, structure, or union can have memory-model modifiers.

The following is an example of this error:

void func1() __near;     // error, nonmember function

class C
{
public:
   void func2() __near;  // OK
};


'operator' : new/delete cannot have formal list modifiers
Compiler Error C2271

'operator' : new/delete cannot have formal list modifiers

The specified operator was declared with a memory-model specifier.

A memory-model specifier cannot be specified for the new or delete operators.

The following is an example of this error:

class C
{
   void *operator new( unsigned ) __far;   // error
};


'function' : modifiers not allowed on static member functions
Compiler Error C2272

'function' : modifiers not allowed on static member functions

The specified static member function was declared with a memory- model specifier.

The following is an example of this error:

class C
{
public:
  static void func1() __far;  // error, func1 is static
  void func2() __far;         // OK
};


'type' : illegal as right side of '->' operator
Compiler Error C2273

'type' : illegal as right side of '->' operator

The given type was specified on the right hand side of the class member access operator (->).

To access a user-defined type conversion, use the operator keyword between the -> operator and the type.

The following is an example of this error:

i = ClassPtr->int( a );           // error
i = ClassPtr->operator int( a );  // OK


'type' : illegal as right side of '.' operator
Compiler Error C2274

'type' : illegal as right side of '.' operator

The given type was specified on the right side of the class member access operator (.).

To access a user-defined type conversion, use the operator keyword between the dot operator (.) and the type.

The following is an example of this error:

i = ClassName.int( a );           // error
i = ClassName.operator int( a );  // OK


'identifier' : illegal use of this type as an expression
Compiler Error C2275

'identifier' : illegal use of this type as an expression

The expression used the class member access operator (->) on the specified typedef identifier.

The following is an example of this error:

typedef struct S
{
    int mem;
} *S_t;
void func1( int *parm );
void func2()
{
    func1( &S_t->mem );   // error: S_t is a typedef
}


'identifier' : illegal address of bound member function expression
Compiler Error C2276

'operator' : illegal address of bound member function expression

The address of a virtual function was taken.

The following is an example of this error:

class A
{
public:
   virtual int foo();
} a;
int (*pf)() = &a.foo;   // error
class B
{
public:
   void mf()
   {
  &this->mf;       //error
   }
};


'identifier' : cannot take the address of a constructor
Compiler Error C2277

'identifier' : cannot take the address this member function

It is not possible to take the the member function.

The following is an example of this error:

class A
{
public:
   A();
};
(*pctor)() = &A::A;   // error


'function' : no function with C linkage found
Compiler Error C2278

'function' : no function with C linkage found

The specified function was not found.

This error is caused by omitting the file containing the function definition from the project list or makefile, by not defining the function within the file scope, or by omitting the keyword extern in the function prototype.


cannot use braces to initialize default arguments
Compiler Error C2279

cannot use braces to initialize default arguments

The following is an example of this error:

struct Point
{
   int x, y;
};
int f( Point p = { 1, 2 } );  // error 2279


missing '{' before identifier 'identifier'?
Compiler Error C2280

missing '{' before identifier 'identifier'?

The expression caused a syntax error that was probably due to a missing opening bracket ({).

The following is an example of this error:

int int_var;
void func( int a     // missing opening bracket
   t_var = 1;        // error is called on this line
}


'identifier1' : is not a function, but contains <function returning>; 'identifier2' is unexpected
Compiler Error C2281

'identifier1' : is not a function, but contains <function returning>; 'identifier2' is unexpected

The declaration of the specified identifier used incorrect syntax.

The following is an example of this error:

int (*f)() a;      // error


'identifier1' is followed by 'identifier2'. (missing ','?)
Compiler Error C2282

'identifier1' is followed by 'identifier2'. (missing ','?)

The declaration of the specified identifiers used incorrect syntax, probably due to a missing comma.

The following is an example of this error:

int *f g;          // error


'identifier' : pure specifier not allowed on un-named class-key
Compiler Error C2283

'identifier' : pure specifier not allowed on un-named class-key

The specified member function of an unnamed class or structure was illegally declared with a pure specifier.

The following is an example of this error:

struct
{
   virtual void func() = 0;   // error
};
struct S
{
   virtual void func() = 0;   // OK
};


unbalanced parenthesis found while processing a member function
Compiler Error C2284

unbalanced parenthesis found while processing a member function

The member function definition ended with a parenthesis instead of a curly brace

The following is an example of this error:

class C {
public:
   void func()
   {
   );            // error, parenthesis instead of curly brace
};


pointers to members representation has already been determined - pragma ignored
Compiler Error C2285

pointers to members representation has already been determined - pragma ignored

A different representation was already specified for the class. The first representation was used.

The following is an example of this error.

class  __single_inheritance X;
class  __multiple_inheritance X;   // error


pointers to members of 'identifier' representation is already set to inheritance inheritance - declaration ignored
Compiler Error C2286

pointers to members of 'identifier' representation is already set to inheritance inheritance - declaration ignored

A different pointers to members representation was already specified for the specified class.

The following is an example of this error.

class  __single_inheritance X;
class  __multiple_inheritance X;   // error


'class': inheritance representation: 'representation1' is less general than the required 'representation2'
Compiler Error C2287

'class': inheritance representation: 'representation1' is less general than the required 'representation2'

A class was declared with a more simple representation than was required.

The following example causes this error when compiled using the "General-purpose always" representation method (/vmg):

class __single_inheritance X;

struct A { };
struct B { };
struct X : A, B { };  // error, X uses multiple inheritance


same type qualifier used more than once
Compiler Error C2289

same type qualifier used more than once

same type qualifier used more than once

A type qualifier (const, volatile, signed, or unsigned) was used more than once in the same type declaration or definition.

This is an error when Microsoft extensions are disabled (/Za), and a warning when extensions are enabled (/Ze).

The following is an example of this error:

volatile volatile int i;   // error


C++ 'keyword' syntax is reserved for future use
Compiler Error C2290

C++ 'keyword' syntax is reserved for future use

The syntax for the specified C++ keyword is reserved for future use.

Rewrite the expression, omitting the keyword.


'identifier': best case inheritance representation: 'representation1' declared but 'representation2' required
Compiler Error C2292

'identifier': best case inheritance representation: 'representation1' declared but 'representation2' required

The following example causes this error when the "Best-case always" representation method  is chosen.

class __single_inheritance X;

struct A { };
struct B { };
struct X : A, B { };  // error, X uses multiple inheritance


'identifier' : class does not have a destructor called '~identifier'
Compiler Error C2300

'identifier' : class does not have a destructor called '~identifier'

The destructor for the specified class had a name different from a tilde (~) followed by the class name.


left of '->~identifier' must point to class/struct/union
Compiler Error C2301

left of '->~identifier' must point to class/struct/union

The expression on the left side of the -> operator did not evaluate to a pointer to a class, structure, or union.


left of '.~identifier' must have class/struct/union type
Compiler Error C2302

left of '.~identifier' must have class/struct/union type

The expression of the left side of the dot operator (.) was not a class, structure, or union.


left of '.identifier' must be an lvalue
Compiler Error C2303

left of '.identifier' must be an lvalue

Only an lvalue can be on the left side of the dot operator (.).


'identifier' is not a static member
Compiler Error C2350

'identifier' is not a static member

A nonstatic member of a class or structure was defined.

Only a static member or member of an instance or a class or structure can be defined.

The following is an example of this error:

class C
{
public:
   int i;
   static int s;
};
void main()
{
   int C::i = 0;  // error, nonstatic member
   int C::s = 0;  // OK, static member
   C.c;
   c.i = 0;       // OK, member of instance of C
}


obsolete C++ constructor initialization syntax
Compiler Error C2351

obsolete C++ constructor initialization syntax

A direct base class was not named in the constructor.

The new-style initialization list for a constructor member requires each direct base class to be explicitly named, even if it is the only base class in the list.

The following is an example of this error:

class B
{
public:
   B();
   B( int );
};
class D : public B
{
public:
   D( int i ) : ( i ) {}   // error, B was not named
   D( int i ) : B( i ) {}  // OK
};


'class::function' : illegal call of non-static member function
Compiler Error C2352

'class::function' : illegal call of non-static member function

The specified nonstatic member function was called in a static member function.

The following is an example of this error:

class X
{
public:
   static void func1();
   void func2();
   static void func3()
   {
 func1();          // error, calls static func1  func2();          // OK, calls nonstatic func2
   }
};


'constructor' : improper use of constructor initializers
Compiler Error C2353

'constructor' : improper use of constructor initializers

The constructor initializer syntax was incorrect.

This error can be caused by omitting the constructor definition from a constructor initializer.

The following is an example of this error:

class C
{
public:
   C() : i( 10 );   // error, missing definition
   C() : i( 10 ){}; // OK
private:
   int i;
};


'reference' : initialization of reference member requires a temporary variable
Compiler Error C2354

'reference' : initialization of reference member requires a temporary variable

A reference to a member was initialized in a constructor.

The member should be initialized instead of its reference.


'this' : can only be referenced inside non-static member functions
Compiler Error C2355

'this' : can only be referenced inside non-static member functions

The this pointer is only valid within nonstatic member functions. Make sure that the this pointer is being used in this context.

The following code generates this error in global scope:

char *p = this;     // error


initialization segment cannot change within translation unit
Compiler Error C2356

initialization segment cannot change within translation unit

The #pragma init_seg statement cannot be preceded by segment initialization code. The #pragma init_seg statement must precede any code and cannot be preceded by another #pragma init_seg statement.

Move the segment initialization code to the beginning of the module. If multiple areas must be initialized, move them to seperate modules.


initialization of 'identifier' is skipped by 'case' label
Compiler Error C2360

initialization of 'identifier' is skipped by 'case' label

The specified identifier initialization can be skipped in a switch statement.

It is illegal to jump past a declaration with an initializer unless the declaration is enclosed in a block.

The scope of the initialized variable lasts until the end of the switch statement unless it is declared in an enclosed block within the switch statement.

The following is an example of this error:

void func( void )
{
   int x;
   switch ( x )
   {
   case 0 :
      int i = 1;       // error, skipped by case 1
      { int j = 1; }   // OK, initialized in enclosing block
   case 1 :
      int k = 1;       // OK, initialization not skipped
   }
}


initialization of 'identifier' is skipped by 'default' label
Compiler Error C2361

initialization of 'identifier' is skipped by 'default' label

The specified identifier initialization can be skipped in a switch statement.

It is illegal to jump past a declaration with an initializer unless the declaration is enclosed in a block.

The scope of the initialized variable lasts until the end of the switch statement unless it is declared in an enclosed block within the switch statement.

The following is an example of this error:

void func( void )
{
   int x;
   switch (x)
   {
   case 0 :
      int i = 1;       // error, skipped by default
      { int j = 1; }   // OK, initialized in enclosing block
   default :
      int k = 1;       // OK, initialization not skipped
   }
}


initialization of 'identifier' is skipped by 'goto label'
Compiler Error C2362

initialization of 'identifier' is skipped by 'goto label'

A jump to the specified label prevented the specified identifier from being initialized.

It is illegal to jump past a declaration with an initializer unless:

The declaration is enclosed in a block that is not entered.

The jump is from a point where the variable has already been initialized.

The following is an example of this error:

void func()
{
   goto label1;
   int i = 1;         // error, initialization skipped
   {
      int j = 1;      // OK, this block is never entered
   }
label1:;
}


'identifer' : redefinition; different subscripts
Compiler Error C2369

'identifer' : redefinition; different subscripts

The given array was already declared with a different subscript.

The following is an example of this error:

int a[10];
int a[20];  // error


'identifer' : redefinition; different storage class
Compiler Error C2370

'identifer' : redefinition; different storage class

The given identifier was already declared with a different storage-class specifier.

The following is an example of this error:

extern int i;
static int i;  // error


'identifier' : redefinition; different basic types
Compiler Error C2371

'identifier' : redefinition; different basic types

The specified identifier was already declared.

The following is an example of this error:

int i;
int i();    // error


'identifier' : redefinition; different types of indirection
Compiler Error C2372

'identifier' : redefinition; different types of indirection

The given identifier was already defined with a different derived type.

The following is an example of this error:

extern int *fp;
extern int fp[];  // error


'identifier' : redefinition; different type modifiers
Compiler Error C2373

'identifier' : redefinition; different type modifiers

The specified identifier was already defined with a different type modifier.

The following is an example of this error:

void __pascal func( void );
void __cdecl func( void );  // error


'identifier' : redefinition; multiple initialization
Compiler Error C2374

'identifier' : redefinition; multiple initialization

The specified identifier was initialized more than once.

A variable can be initialized only once.

The following is an example of this error:

int i = 0;
int i = 1;  // error


'function' : redefinition; different linkage
Compiler Error C2375

'function' : redefinition; different linkage

The specified function was already declared with a different linkage specifier.

The following is an example of this error:

extern void func( void );
static void func( void );  // error


'function' : redefinition; different based allocation
Compiler Error C2376

'function' : redefinition; different based allocation

The specified function was already declared with a different based allocation.

The following is an example of this error:

int func();
int _based(_segname("S1")) func();
int _based(_segname("S2")) func();  // error


'identifier' : redefinition; typedef cannot be overloaded with any other symbol
Compiler Error C2377

'identifier' : redefinition; typedef cannot be overloaded with any other symbol

The specified typedef identifier was redefined.

The following is an example of this error:

typedef int i;
int i;  // error


'identifier' : redefinition; symbol cannot be overloaded with a typedef
Compiler Error C2378

'identifier' : redefinition; symbol cannot be overloaded with a typedef

The specified identifier was redefined as a typedef.

The following is an example of this error:

int i;
typedef int i;  //error


formal parameter 'number' has different type when promoted
Compiler Error C2379

formal parameter 'number' has different type when promoted

The type of the specified parameter is not compatible through default promotions with the type found in a previous declaration.

For functions are compatible only if the types of each parameter are compatible after the application of default argument promotions.

This is an error in ANSI C (/Za) and a warning when the Microsoft extension (/Ze) is used.

The following example causes this error:

void func();
void func(char);     // error, char promotes to int


type[s] preceding 'identifier' (constructor with return type or illegal redefinition of current class name?)
Compiler Error C2380

type[s] preceding 'identifier' (constructor with return type or illegal redefinition of current class name?)

The specified constructor returned a value or redefined the class name.

A constructor cannot specify a return value.

This error can be caused by redefining a class name.

The following is an example of this error:

class C
{
public:
   int C();  // error, specifies an int return
   int C;    // error, redefinition of i
   C();      // OK
};


'class::member' is ambiguous
Compiler Error C2385

'class::member' is ambiguous

The specified member was derived from more than one object.

This error is caused by referencing a member of an object that was inherited from more than one object. Make the member unambigous by providing a cast or by changing the name of the offending members of the base classes.

Warning C4385 is generated in conjunction with this error, and provides additional information about the ambiguity.

The following is an example of this error:

struct A { int x; };
struct B { int x; };
struct C : A, B {};
void func ()
{
   C aC;
   aC.x = 9;        // error
}


ambiguous conversion from 'type1*' to 'type2*'
Compiler Error C2386

ambiguous conversion from 'type1*' to 'type2*'

There was more than one way to make the specified conversion.

Provide an explicit type conversion or change the organization of classes so that the conversion is no longer ambiguous.

Warning C4386 is generated in conjunction with this error, and provides additional information about the ambiguity.

The following is an example of this error:

struct A {};
struct B : A {};
struct C : A {};
struct D : B, C {};
void bar ()
{
   D *pD;
   A *pA;
   pA = pD;            // error
}


ambiguous conversion from 'type1&' to 'type2&'
Compiler Error C2387

ambiguous conversion from 'type1&' to 'type2&'

There was more than one way to make the specified conversion.

Provide an explicit type conversion or change the organization of classes so that the conversion is no longer ambiguous.


'identifier' : incorrect storage class 'specifier'
Compiler Error C2390

'identifier' : incorrect storage class 'specifier'

The storage class was not legal for the specified identifer with global scope.

The default storage class for this context was used in place of the illegal class.

Correct use of storage classes include:

If the identifier is a function, it should be declared with extern storage.

If the identifier is a formal parameter or local variable, it should be declared with auto storage.

If the identifier is a global variable, it should be declared with no storage class (that is, auto storage).

The following is an example of this error:

register int i;        //error
void main ()
{
   register int j;     //OK
}


'identifier' : 'friend' cannot be used during type definition
Compiler Error C2400

'identifier' : 'friend' cannot be used during type definition

A complete class declaration was given in a friend declaration.

A friend declaration can specify a member function or an elaborated type specifier, but not a complete class declaration.

The following is an example of this error:

class D { void func( int ); };

class A {
   friend class B { int i; };   // error
   friend class C;              // OK
   friend void D::func(int);    // OK
};


inline syntax error in 'context'; found 'token'
Compiler Error C2400

inline syntax error in 'context'; found 'token'

The given token caused a syntax error within the given context.

Specifiying a Pentium instruction can cause this error. Choosing the Pentium option (/G5) will cause the compiler to generate instruction sequences optimized for the Pentium, but does not allow instructions specific to the Pentium.


'identifier' : register must be base in 'context'
Compiler Error C2401

'identifier' : register must be base in 'context'

The register used within an indirect memory operand must be a base register in this context.


'identifier' : register must be index in 'context'
Compiler Error C2402

'identifier' : register must be index in 'context'

The register used within an indirect memory operand must be an index register in this context.


'identifier' : register must be base/index in 'context'
Compiler Error C2403

'identifier' : register must be base/index in 'context'

The register used within an indirect memory operand must be either a base or index register in this context.


'identifier' : illegal register in 'context'
Compiler Error C2404

'identifier' : illegal register in 'context'

This register in this context is illegal.


illegal short forward reference with offset
Compiler Error C2405

illegal short forward reference with offset

Short forward references must refer only to a label. An additional offset cannot be used.


'identifier' : name undefined in 'context'
Compiler Error C2406

'identifier' : name undefined in 'context'

The identifier used with the SIZE or LENGTH operator or as a specifier with the member-selection operator (.) was not defined.


illegal float register in 'context'
Compiler Error C2407

illegal float register in 'context'

An NDP register was specified in an illegal context.


illegal type on PTR operator in 'context'
Compiler Error C2408

illegal type on PTR operator in 'context'

The first parameter of the PTR operator was not a legal type specification.


illegal type used as operator in 'context'
Compiler Error C2409

illegal type used as operator in 'context'

An illegal type was used within the given context as an operator.


'identifier' : ambiguous member name in 'context'
Compiler Error C2410

'identifier' : ambiguous member name in 'context'

The given identifier within the given context is a member of more than one structure or union.

Use a structure or union specifier on the operand that caused the error. A structure or union specifier is an identifier of type struct or union, either a typedef name or a variable of the same type as the structure or union being referenced. The specifier token must be the left operand of the first member-selection operator (.) to use the operand.


'identifier' : illegal struct/union member in 'context'
Compiler Error C2411

'identifier' : illegal struct/union member in 'context'

Either the given identifier used with this context is not a member of a visible structure or union or the identifier is not a member of the structure or union specified with the member- selection operator (.).


'identifier' : case-insensitive label redefined
Compiler Error C2412

'identifier' : case-insensitive label redefined

The given label was defined more than once within the current function. Change the spelling of the label and its references.


'token' : illegal align size
# C2413 Compiler Error C2413

'token' : illegal align size

The alignment size used with the ALIGN directive was either missing or outside the valid range.


illegal number of operands
Compiler Error C2414

illegal number of operands

The opcode does not support the number of operands used.

Check an assembly-language reference manual to determine the correct number of operands for this instruction.

It is possible that the instruction is supported with a different number of operands on a newer processor. The problem can be solved by compiling with the /G1 or /G2 option, but then only machines with the newer processor will be able to execute the extended instruction.


improper operand type
Compiler Error C2415

improper operand type

The opcode does not use operands of this type.

Check an assembly-language reference manual to determine the correct types of operands for this instruction.

It is possible that the instruction is supported with additional operand types on a newer processor. The problem can be solved by compiling with the /G1 or /G2 option, but then only machines with the newer processor will be able to execute the extended instruction.


'identifier' : illegal opcode for processor
Compiler Error C2416

'identifier' : illegal opcode for processor

The specified opcode is not valid in this context.

This error can be caused by by using an instruction that is legal on a later processor but not on the current processor. In this case the problem can be solved by specifying a processor using, for example, the /G1, /G2, or /G3 options.

This error can also be caused by using an opcode that is valid for the processor but that is not handled by the compiler.


divide by zero in 'context'
Compiler Error C2417

divide by zero in 'context'

The second parameter to the division operator (/) used within the given context is zero.


'identifier' : not in a register
Compiler Error C2418

'identifier' : not in a register

An inline assembler instruction referenced a variable with register storage class that was not actually allocated in a register.

To correct this, remove the register keyword from the variable definition and make sure that this instruction is legal with a memory operand.


mod by zero in 'context'
Compiler Error C2419

mod by zero in 'context'

The second parameter to the MOD operator used within the given context is zero.


'identifier' : illegal symbol in 'context'
Compiler Error C2420

'identifier' : illegal symbol in 'context'

The given identifier is illegal within the given context.


PTR operator used with register in 'context'
Compiler Error C2421

PTR operator used with register in 'context'

The PTR operator must not be used with a register operand.


'number' : illegal scale
Compiler Error C2423

'number' : illegal scale

The number used to scale a register in an inline assembler routine was illegal.

Registers can be scaled only by 1, 2, 4, or 8.

The following code generates this error:

_asm
{
  lea    EAX, [EAX*3]            //Error
  lea    EAX, [EAX+EAX*2]        //OK
}


'token' : improper expression in 'context'
Compiler Error C2424

'token' : improper expression in 'context'

The given token was used to form an improper expression within the given context.


'token' : nonconstant expression in 'context'
Compiler Error C2425

'token' : nonconstant expression in 'context'

The given token was used to form a nonconstant expression within the given context.


'token' : illegal operator in 'context'
Compiler Error C2426

'token' : illegal operator in 'context'

The given token must not be used as an operator within the given context. For example, index operators cannot be nested.


'identifier' : jump referencing label is out of range
Compiler Error C2427

'identifier' : jump referencing label is out of range

A branch to the specified label is farther than allowed.

For example, if the following example causes this error:

        jz label1
        inc AX

label1: inc CX

then this error can be corrected by either removing excess code between the branch and the label or inverting the jump, as in:

        jnz label2
        jmp label1
label2: inc AX

label1: inc CX


'label' : illegal far label reference
Compiler Error C2429

'label' : illegal far label reference

FAR PTR cannot be used on jumps or calls to labels. Far references to functions are allowed only if the function has been declared.


more than one index register in 'identifier'
Compiler Error C2430

more than one index register in 'identifier'

More than one of the specified registers were scaled.

The 32-bit targeted compiler supports scaled indexing, but you can only scale one register.

The following is an example of this error:

_asm mov eax, [ebx*2+ecx*4]


illegal index register in 'identifier'
Compiler Error C2431

illegal index register in 'identifier'

The ESP register was scaled or used as both the index and base register.

The SIB encoding for the 80386 processor does not allow scaling by ESP or using ESP as both the index and base register.

The following examples cause this error:

_asm mov ax, [ESI+2*ESP]
_asm mov ax, [esp+esp]


illegal reference to 16-bit data in 'identifier'
Compiler Error C2432

illegal reference to 16-bit data in 'identifier'

A 16-bit register was used as an index or base register.

The 32-bit targeted compiler does not support referencing 16-bit data, which is supported by the chip using the address size prefix. This means that 16-bit registers cannot be used as index or base registers if you are compiling for 32-bit code.

The following is an example of this error:

_asm mov eax, DWORD PTR [bx]


'identifier' : 'modifier' not permitted on data declarations
Compiler Error C2433

'identifier' : 'modifier' not permitted on data declarations

The specified modifier was used for a data declaration.

The friend, virtual, and inline modifiers cannot be used for data declarations.


'identifier' : cannot convert default argument from 'type1' to 'type2'
Compiler Error C2434

'identifier' : cannot convert default argument from 'type1' to 'type2'

The indicated default parameter could not be converted into the type specified in the function's formal parameter list.

This error can be caused by an incorrect function prototype or by using the wrong value for a default parameter. To use the indicated default parameter, you should define a conversion operator or a constructor that takes a single parameter of the same type as the specified default parameter.

The following is an example of this error. Note that if the conversion operator in A is supplied, then there is no error.

class A
{
public:
   int i;
} a;
class B
{
public:
   operator int() { return i; }    // conversion operator
   int i;
} b;
void func1( int j = a ) {}  // error, can't convert a to int
void func2( int j = b ) {}  // OK


'identifier' : function called before default arguments were resolved
Compiler Error C2435

'identifier' : function called before default arguments were resolved

The specified function was declared or defined with default arguments, but was called before the default arguments were defined.

The following is an example of this error:

class C
{
public:
   void a(void)
   {
      b();                   // error caught here
   }
   void b(void* ptr = sp);   // move this line above the definition
   static void *sp;          // a() to avoid error
};


'identifier' : cannot initialize member functions
Compiler Error C2436

'identifier' : cannot initialize member functions

A member function of the specified class was initialized.

Unlike variables, functions cannot be initialized. This error can be caused by trying to initialize a function instead of a pointer to the function.


'identifier' : already initialized
Compiler Error C2437

'identifier' : already initialized

The specified identifier was already initialized.

An object can be declared more than once but can be initialized only once.


'identifier' : cannot initialize static class data via constructor
Compiler Error C2438

'identifier' : cannot initialize static class data via constructor

A constructor was used to initialize a static member of a class.

Static members should be initialized in a definition outside of the class declaration.

The following example shows how static members are initialized:

class X
{
public:
   static const int i;
   static int j;
};
const int X::i = 1;
int X::j = 2;


'identifier' : member could not be initialized
Compiler Error C2439

'identifier' : member could not be initialized

The indicated class, structure, or union member could not be initialized.

This error can be caused by trying to initialize an indirect base class or structure or an inherited member of a class or structure. An inherited member should be initialized by the constructor of the class or structure.


'conversion' : cannot convert from 'type1' to 'type2'
Compiler Error C2440

'conversion : cannot convert from 'type1' to 'type2'

The indicated object could not be converted to the required type.

This error can be caused by converting a user-defined type to some other type without supplying a conversion operator.

A conversion operator should be supplied as shown in the following example for the class X, which returns an integer. Note that a parameter type or a return type is not specified.

class X
{
public:
   int j;
} x;
class Y
{
public:
   operator int() { return j; }  // conversion operator
   int j;
} y;
void main()
{
int i;      // error, x cannot be converted to an int i = y;
i = x;    // OK
}


function call through pointer before default arguments were resolved
Compiler Error C2441

function call through pointer before default arguments were resolved

A function was declared or defined with default arguments, but was called before the default arguments were defined.

The following is an example of this error:

class C
{
public:
   void a(void)
   {
      (*c)();                   // error caught here
   }
   void (*c)(void*ptr = sp);    // move this line above the definition of
   static void *sp;             // a() to avoid error
};


operand size conflict
Compiler Error C2443

operand size conflict

The instruction required operands of the same size.

One of the operands must be changed so that both operands have the same size.

The following is an example of this error:

short var;

void main()
{
   __asm xchg ax,bl            // error
   __asm mov al,foo            // error
   __asm mov al,BYTE PTR var   // OK
}


'identifier' : used ANSI prototype, found 'type', expected '{' or ';'
Compiler Error C2444

'identifier' : used ANSI prototype, found 'type', expected '{' or ';'

The specified function prototype was followed by a type.

This error can be caused by a missing semicolon.


'operator' : no conversion from 'type1' to 'type2'
Compiler Error C2446

'operator' : no conversion from 'type1' to 'type2'

The specified types could not be converted into the type required by the operator.

The following is an example of this error:

class C {};
class D {};
C aC;
D aD;
void main()
{
   aC = aD;  // error
}


missing function header (old-style formal list?)
Compiler Error C2447

missing function header (old-style formal list?)

An open curly brace ({) was found at global scope without a corresponding function header.

This error can be caused by using the old-style C-language formal list.

Check that the function being defined has an appropriate function declaration.

The following is an example of this error:

int c;
{}       // error


'identifier' : function-style initializer appears to be a function definition
Compiler Error C2448

'identifier' : function-style initializer appears to be a function definition

The specified function definition was incorrect.

This error can be caused by using the old-style C-language formal list.

The following is an example of this error:

void func(c)
   int c;
{}             // error


found '{' at file scope (missing function header?)
Compiler Error C2449

found '{' at file scope (missing function header?)

An opening curly brace ({) was found at file scope.

This error is probably caused by adding a semicolon between a function header and the opening curly brace of the function definition.

The following is an example of this error:

int __pascal func(void);  // extra semicolon on this line
{                         // error detected here


switch expression of type 'type' is illegal
Compiler Error C2450

switch expression of type 'type' is illegal

The specified switch expression evaluated to an illegal type.

A switch expression must evaluate to an integral type or a class type that has an unambiguous conversion to an integral type.

If the expression evaluates to a user-defined type, a conversion operator needs to be supplied.

The following is an example of this error:

class X
{
public:
   int i;
} x;
class Y
{
public:
   int i;
   operator int() { return i; }  // conversion operator
} y;
void main()
{
   int j = 1;
   switch ( x )              // error, x is not type int
   {
 default:  ;
   }
   switch ( y )              // OK
   {
 default:  ;
   }
}


conditional expression of type 'type' is illegal
Compiler Error C2451

conditional expression of type 'type' is illegal

The conditional expression evaluated to an illegal type.


array bound expression of type 'type' is illegal
Compiler Error C2452

array bound expression of type 'type' is illegal

An array was declared with a bound expression that could not be converted to type int.

The following is an example of this error:

class C { int a; } aC;
class D { public: int a; operator int() { return a; } } aD;
class E { public: double a; operator double() { return a; } } aE;
int (*pf)();

void func()
{
   char *buf;
   int *pi;

   buf = new char[aC];  // error, no conversion from C to int
   buf = new char[pi];  // error, int * is illegal type for array bound
   buf = new char[pf];  // error, int (*)() is illegal for array bound
   buf = new char[10L]; // OK
   buf = new char[aD];  // OK, conversion by D::operator int()
   buf = new char[aE];  // OK, conversion by E::operator double()
}


conditional expression of type 'type' is illegal
Compiler Error C2453

array bound expression uses function name

An array was declared with a bound expression that was a function name.

An array bound must by a type that has a conversion to type int.

The following is an example of this error:

int func();

void bunc()
{
    char *buf;

    buf = new char[10];     // OK
    buf = new char[func];   // error, array bound is function name
    buf = new char[bunc];   // error
}


array bound expression uses function name
Compiler Error C2458

'identifier' : redefinition within definition

The specified class, structure, union, or enumeration was redefined in its own declaration.

The following is an example of this error:

class C
{
    enum i { C };   // error
};


'identifier' : is being defined; cannot add as an anonymous member
Compiler Error C2459

'identifier' : is being defined; cannot add as an anonymous member

The specified class, structure, or union was redefined in its own scope by a member of an anonymous union.

The following is an example of this error:

class C
{
    union { int C; };   // error
};


'identifier1' : uses 'identifier2', which is being defined
Compiler Error C2460

'identifier1' : uses 'identifier2', which is being defined

The given class or structure (identifier2) was declared as a member of itself (identifier1).

Recursive definitions of classes and structures are not allowed.

The following is an example of this error:

class C
{
   C aC;    // error
};


'class' : constructor syntax missing formal parameters
Compiler Error C2461

'class' : constructor syntax missing formal parameters

The constructor for the given class did not specify any formal parameters. The declaration of a constructor must specify a formal parameter list in parentheses. This list can be null.

Add a pair of parentheses after the class::class identifier.

The following is an example of this error:

class C
{
    C::C;        // error
    C::C();      // OK
};


'identifier' : cannot define a type in a 'new-expression'
Compiler Error C2462

'identifier' : cannot define a type in a 'new-expression'

A type cannot be defined in the operand field of the new operator.

Put the type definition in a separate statement.

The following is an example of this error:

void main()
{
    new struct S { int i; };     // error
}


cannot define an anonymous type in a 'new-expression'
Compiler Error C2463

cannot define an anonymous type in a 'new-expression'

An anonymous type cannot be defined in the operand field of the new operator.

Create a named type definition in a separate statement, then use the new operator.

The following is an example of this error:

void main()
{
    new struct { int x; };  // error
}


'identifier' : cannot use 'new' to allocate a reference
Compiler Error C2464

'identifier' : cannot use 'new' to allocate a reference

The specified reference identifier was allocated with the new operator.

Since references are not memory objects, the new operator cannot return a pointer to them.

Use the standard variable declaration syntax to declare a reference.

The following is an example of this error:

void main()
{
    new ( int& ir );   // error
}


cannot define an anonymous type inside parentheses
Compiler Error C2465

cannot define an anonymous type inside parentheses

An anonymous structure, union, or enumerated type was defined inside a parenthetical expression.

This is illegal in C++ programs, as the definition is meaningless in function scope.


cannot allocate an array of constant size 0
Compiler Error C2466

cannot allocate an array of constant size 0

An array of constant size 0 was allocated or declared.

The constant expression used to allocate or declare an array must be an integral type greater than zero.

An array declaration with a zero subscript is legal only for a class, structure, or union member, and when the Microsoft extensions (/Ze) are enabled.

The following examples cause this error:

int *p = new X[0];        // error
C *aC = new [int_var] C;  // error
int[0]                    // error


illegal declaration of anonymous '%Fs'
Compiler Error C2467

illegal declaration of anonymous 'user-defined-type'

A nested user defined type was declared. This is an error when the ANSI compatibility option (/Za) has been enabled.

The following is an example of this error:

int main()
{
   struct X
   {
      union { int i; };  // error, nested declaration
   };
   return 0;
}


'new' : cannot allocate 'const'/'volatile' objects (type is 'type')
Compiler Error C2468

'new' : cannot allocate 'const'/'volatile' objects (type is 'type')

The new operator was used to create an object of the specified type that was declared as const or volatile.

The following is an example of this error:

void main(void)
{
   new int * const;       // error
   new int * volatile;    // error
}


cannot open database 'file'
Compiler Error C2470

cannot open database 'file'

The specified database could not be opened.

This error can be caused if the database file, or the disk on which it resides, is read-only.  Make the database file writeable with the ATTRIB utility, or move the project to a writeable disk.

This error can also be caused if insufficient file handles are available. Close some open applications to release some file handles.


cannot update database 'file'
Compiler Error C2471

cannot update database 'file'

The specified database could not be written to.

Possible causes of this error include:

insufficient disk space

attempting to write to a read-only volume

a sharing violation.


'identifier' : 'thread' is only valid for data items of static extent
Compiler Error C2480

'identifier' : 'thread' is only valid for data items of static extent

An automatic variable, nonstatic data member of a class, or a function parameter cannot be declared with the thread attribute.

A global variable, a static data member variable or a local static variable can be declared with the thread attribute.


'identifier1' : cannot be initialized using address of 'thread' variable 'identifier2'
Compiler Error C2481

'identifier1' : cannot be initialized using address of 'thread' variable 'identifier2'

The address of variable identifier2 is not static, but rather it is a dynamic value which can only be determined in the context of a particular thread. A static expression must be used to initialize identifier1.


'identifier' : dynamic initialization of 'thread' data not allowed
Compiler Error C2482

'identifier' : dynamic initialization of 'thread' data not allowed

Variables that are declared with the thread attribute cannot be initialized with an expression that requires evaluation at runtime. A static expression must be used to initialize thead data.


'identifier' : object with constructor cannot be declared 'thread'
Compiler Error C2483

'identifier' : object with constructor cannot be declared 'thread'

Variables that are declared with the thread attribute cannot be initialized with an expression that requires evaluation at runtime, such as a constructor. A static expression must be used to initialize thead data.


'identifier' : attribute 'attribute' doesn't match previous declaration
Compiler Error C2484

'identifier' : attribute 'attribute' doesn't match previous declaration

The specified identifier was already declared with a different attribute.


'identifier' : unrecognized extended attribute
Compiler Error C2485

'identifier' : unrecognized extended attribute

The specified declaration attribute is not valid.


'__LOCAL_SIZE' only allowed in function with the 'naked' attribute
Compiler Error C2486

'__LOCAL_SIZE' only allowed in function with the 'naked' attribute

In inline assembly functions, the name __LOCAL_SIZE is reserved for functions declared with the naked attribute.


'identifier' : member of dll interface class cannot be declared with dll interface
Compiler Error C2487

'identifier' : member of dll interface class cannot be declared with dll interface

You can declare a whole class with dll interface, or certain members of a non-dll interface class. However, you cannot declare a class with dll interface and then declare a member of that class with dll interface.


'identifier' : 'naked' can only be applied to function definitions
Compiler Error C2488

'identifier' : 'naked' can only be applied to function definitions

The naked attribute was applied to a function declaration.

The following is an example of this error:

__declspec( naked )  int func();  // error, declaration, not definition
__declspec( naked ) int i;        // error, i is not a function


identifier' : initialized auto or register variable not allowed at function scope in 'naked' function
Compiler Error C2489

identifier' : initialized auto or register variable not allowed at function scope in 'naked' function

The following is an example of this error:

__declspec( naked ) int func()
{
   int i = 1;            // error
   register int j = 1;   // error
}


'keyword' not allowed in function with 'naked' attribute
Compiler Error C2490

'keyword' not allowed in function with 'naked' attribute

A function defined as naked cannot use structured exception handling, or contain an explicit return.

The following is an example of this error:

__declspec( naked ) int func()
{
   __try{}     // error, structured exception handling
   return 1;   // error, explicit return
}


'identifier' : definition of dllimport identifier not allowed
Compiler Error C2491

'identifier' : definition of dllimport identifier not allowed

Data, static data members, or functions can be declared as dllimports, but not defined as dllimports.


'identifier' : 'thread' data cannot have dll interface
Compiler Error C2492

'identifier' : 'thread' data cannot have dll interface

The specified variable was declared with the thread attribute and with dll interface. However, the address of the thread variable cannot be known before runtime so it cannot be linked to a dll import or export.


illegal form of __based
Compiler Error C2493

illegal form of __based

A __based expression must be based on a pointer.

The following is an example of a valid __based expression:

char * mybase;
int __based(mybase) ptr;


'identifier1' : 'identifier2' is already a direct base class
Compiler Error C2500

'identifier1' : 'identifier2' is already a direct base class

The specified class (or structure) appeared more than once in a list of base classes for a derived class.

A class is called a direct base if it is mentioned in the base list. A class is called an indirect base if it is not a direct base but is a base class of one of the classes mentioned in the base list.

A class cannot be specifed as a direct base class more than once. A class can be used as an indirect base class more than once.

The following is an example of this error:

class A { };
class B : public A, public A { };    // error
class C : public A { };
class D : public A { };
class E : public C, public D { };    // OK, contains two As


'identifier' : missing decl-specifiers
Compiler Error C2501

'identifier' : missing decl-specifiers

The identifier was declared without specifying its type.

This error occurs when a type specifier is omitted in the declaration of an identifier.

The following is an example of this error:

int func();
pf = &func;           // error
int (*pf)() = &func;  // OK


'identifier' : too many access modifiers on the base class
Compiler Error C2502

'identifier' : too many access modifiers on the base class

The specified base class had more than one access modifier.

A base class or structure can be declared with only one access modifier (public, private, or protected).

The following is an example of this error:

class A { };
class B { };
class C : private public A { };     // error
class D : private A { };            // OK
class E : public A, private B { };  // OK


'class' : base classes cannot contain zero-sized arrays
Compiler Error C2503

'class' : base classes cannot contain zero-sized arrays

The specified base class (or structure) contained a zero-sized array.

An array in a class must have at least one element.


'class' : base class undefined
Compiler Error C2504

'class' : base class undefined

The specified base class was declared but never defined.

This error can be caused by a missing include file or an external base class that was not declared with the extern specifier.

The following is an example of this error:

class A;                 // error, A is undefined
class A {};              // OK, A is defined
class B : public A {};   // the error is detected here


'identifier' : is not a legal base class
Compiler Error C2505

'identifier' : is not a legal base class

The specified identifier was not a class (or structure) but was used to derive a class.

A class can be derived only from classes. This error can be caused by naming a variable or type in the base class list.

The following is an example of this error:

class B { };
class D : public B { };  // OK, D is derived from B
typedef int I;
class E : public I { };  //  error, I is not a class


'class::identifier' : ambiguous
Compiler Error C2506

'class::identifier' : ambiguous

The specified name referred to more than one class member.

To access a base class or structure, an expression must refer to one unique function, object, type, or enumerator. The scope resolution operator (::) can be used to resolve the ambiguity.

The check for ambiguity is done before access control. A private base class containing only private members has the same potential for ambiguity as a public class.

The following is an example of this error:

class A
{
public:
   int a;
};
class B
{
private:
   int a;
};
class C : public A, private B { };
C c;
int j = c.a;          // error, could be A::a or B::a
int i = c.A::a;       // OK, resolved ambiguity


'identifier' : too many virtual modifiers on the base class
Compiler Error C2507

'identifier' : too many virtual modifiers on the base class

The specified class or structure was declared as virtual more than once.

Only one virtual modifier can be used for each base class in a list of base classes.

The following is an example of this error:

class A {};
class B : virtual virtual public A {}; // error
class C : virtual public A {};         // OK


'identifier' : access denied
Compiler Error C2508

'identifier' : access denied

The specified nonpublic class member could not be accessed.

A class (or structure or union) member that has been declared with private or protected access can only be accessed by member functions of the class.


'identifier' : member function not declared in 'class'
Compiler Error C2509

'identifier' : member function not declared in 'class'

The function was not declared in the specified class.

This error can be caused by specifying the wrong class when calling the function.


'identifier' : left of '::' must be a class/struct/union
Compiler Error C2510

'identifier' : left of '::' must be a class/struct/union

The named identifier was not a class, structure, or union.

A class, structure, or union name must appear on the left side of the scope resolution operator (::) if any name is used.


'identifier' : overloaded member function not found in 'class'
Compiler Error C2511

'identifier' : overloaded member function not found in 'class'

The specified function was not declared for the given parameters.

This error can be caused by a mismatch in the parameter list of the specified function.


'identifier' : no appropriate default constructor available
Compiler Error C2512

'identifier' : no appropriate default constructor available

No default constructor was available for the specified class, structure, or union.

The compiler will supply a default constructor only if user-defined constructors are not provided. If you provide a constructor that takes a nonvoid parameter, then you must also provide a default constructor. The default constructor can be called with no parameters, that is, a constructor with default values for all parameters.


'specifier' : decl-specifier is missing a declarator before '='
Compiler Error C2513

'specifier' : decl-specifier is missing a declarator before '='

The specified type was used in a declaration that did not name an identifier.

The following is an example of this error:

int = 9;  // error


'class' : class has no constructors
Compiler Error C2514

'class' : class has no constructors

The specified class was initialized with parameters for which no constructor was defined.

Constructors must be declared with parameter lists that match every parameter list used to initialize objects of the class, structure, or union.


'identifier' : not in class 'class'
Compiler Error C2515

'identifier' : not in class 'class'

The specified identifier was not a member of the given class.


'identifier' : right of '::' is undefined
Compiler Error C2517

'identifier' : right of '::' is undefined

The identifier on the right side of the scope resolution operator (::) was not defined.

The identifier on the right side of the scope resolution operator must be a defined member of the class, structure, or union found on the left side of the operator. If no class, structure, or union is named, then the identifier on the right side of the operator must be declared with global scope.


cannot convert 'type1 *' to 'type2 *'
Compiler Error C2519

cannot convert 'type1 *' to 'type2 *'

A pointer to type1 could not be converted to a pointer to type2.

Since type1 was not derived from type2, implicit conversion was not possible.

A pointer to one type generally cannot be implicitly converted to a pointer to another type. Conversion to a void * is possible if the size of void * is greater than the size of the original pointer.

If a pointer to one type must be converted to a pointer to another type, then explicit conversion should be used.


'identifier1::~identifier2' : destructor tag mismatch
Compiler Error C2523

'identifier1::~identifier2' : destructor tag mismatch

A destructor for the specified class was declared with a different name.

The destructor for a class must have the same name as the class itself and must be preceded by a tilde (~).

The constructor and destructor are the only members of a class that have the same name as the class.


'identifier' : destructors must have a 'void' formal parameter list
Compiler Error C2524

'identifier' : destructors must have a 'void' formal parameter list

The specified destructor had a nonvoid formal parameter list.

A destructor can take only a void parameter. Other parameter types are not allowed.


'identifier' : explicit destructor is named but not called
Compiler Error C2525

'identifier' : explicit destructor is named but not called

The specified explicit destructor member selection did not have a function call operator (matched parentheses).

The following is an example of this error:

struct C
{
   ~C();
};

void func( C* pC )
{
   pC->~C;       // error
   pC->~C();     // OK
}


'identifier1' : C linkage function cannot return C++ class 'identifier2'
Compiler Error C2526

'identifier1' : C linkage function cannot return C++ class 'identifier2'

under construction


'identifier' : array of references must be fully initialized
Compiler Error C2527

'identifier' : array of references must be fully initialized

Elements of the specified array were not initialized.

An initializer must be supplied for every element of an array of references.

The following is an example of this error:

int a, b, c;
int &ai[3];               // error, elements not initialized
int &ai[3] = { a, b, c }; // OK


illegal pointer to reference
Compiler Error C2528

illegal pointer to reference

A pointer to a reference was declared.

The variable must be dereferenced before a pointer to it can be declared.


illegal reference to a reference
Compiler Error C2529

illegal reference to a reference

A reference to a reference was declared.

This error can be avoided by using pointer syntax and declaring a reference to a pointer.


'identifier' : references must be initialized
Compiler Error C2530

'identifier' : references must be initialized

A reference was not initialized when it was declared.

The following cases are the only times a reference can be declared without initialization:

It is declared with the keyword extern.

It is a member of a class, structure, or union and is initialized in the class's constructor function.

It is declared as a parameter in a function declaration or definition.

It is declared as the return type of a function.


'identifier' : reference to a bit field illegal
Compiler Error C2531

'identifier' : reference to a bit field illegal

A reference to the specified bit field was declared.

A reference to a bit field is not allowed.


'identifier' : cannot modify references
Compiler Error C2532

'identifier' : cannot modify references

The specified reference was changed.

References cannot be modified to refer to another object.

If the reference must be modified, then it should be implemented as a pointer instead.


'identifier' : constructors not allowed a return type
Compiler Error C2533

'identifier' : constructors not allowed a return type

The specified constructor was declared with a return type.

A constructor does not return a value and has no return type. A return type of void is not allowed.

The following is an example of this error.

class X
{
public:
   void X( void ) { ... };  // error, return type declared
   X( void ) { ... };       // OK, no return type declared
};


'identifier' : constructor cannot return a value
Compiler Error C2534

'identifier' : constructor cannot return a value

The specified constructor cannot return a value.

A constructor cannot return a value of any type, including a return type of void.

This error can be eliminated by removing the return statement from the constructor definition.


'identifier' : member function already defined or declared
Compiler Error C2535

'identifier' : member function already defined or declared

The specified member function was defined or declared earlier.

This error can be caused by repeating the same formal parameter list in more than one function definition or declaration.


'identifier1::identifier2' : cannot specify explicit initializer for arrays
Compiler Error C2536

'identifier1::identifier2' : cannot specify explicit initializer for arrays

The specified member of a class, structure, or union could not be initialized.

This error can be caused if a constructor is not available to initialize one or more members of an array. If the size of the array is greater than the number of initializers, then a default constructor must be defined.

Alternatively, this error can be caused by declaring a nonstatic array with the const specifier. This kind of array cannot be explicitly initialized.


'identifier' : illegal linkage specification
Compiler Error C2537

'identifier' : illegal linkage specification

The indicated linkage specifier was not legal.

This error can be caused by using a linkage specifier that is not supported. Only the "C" linkage specifier is supported.

This error can also be caused by overloading more than one function with "C" linkage. Only one of a set of overloaded functions can be declared with "C" linkage.


'new' : cannot specify initializer for arrays
Compiler Error C2538

'new' : cannot specify initializer for arrays

An initializer was given for the specified array created with the new operator.

The new operator creates arrays of objects by calling the default constructor for each element of the array. The elements of the array cannot be initialized to distinct values.


'new' : 'identifier' : no default constructor to initialize array of objects
Compiler Error C2539

'new' : 'identifier' : no default constructor to initialize array of objects

A default constructor was not available to initialize an array of objects of the specified class, structure, or union.

Initializing an array of objects requires a default constructor. The default constructor is called separately for each object in the array.

This error can be caused by not defining a default constructor. If any constructor is defined, then the compiler will not generate a default constructor. A default constructor (one that can be called with no parameters) must be explicitly defined in this case.


nonconstant expression as array bound
Compiler Error C2540

nonconstant expression as array bound

The specified array bound was not a constant expression.

An array must be declared with a constant bound.

The following example shows an illegal way to declare an array:

int i;
int A[i];        // error, i is nonconstant

and legal ways to declare an array:

const j = 20;
int A[j];        // OK, j is constant
int B[32];       // OK, 32 is a literal


delete : cannot delete nonpointer objects
Compiler Error C2541

delete : cannot delete nonpointer objects

The delete operator was used on an object that was not a pointer.

The delete operator can only be used on pointers.

The following is an example of this error:

void main()
{
   int i;
   delete i;            // error, i is not a pointer
   int* ip = new int;
   delete ip;           // OK
}


'identifier' : class object has no constructor for initialization
Compiler Error C2542

'identifier' : class object has no constructor for initialization

There was no constructor to initialize the specified object.

A constructor with the same parameter list used in the initialization must be supplied.

This error can also be caused by initializing an object with incorrect parameters.


expected ']' for operator '[]'
Compiler Error C2543

expected ']' for operator '[]'

The left square bracket of the subscripting operator was missing.

This error can be caused by expansion of a macro.


expected ')' for operator '()'
Compiler Error C2544

expected ')' for operator '()'

The left parenthesis of the function call operator was missing.

This error can be caused by expansion of a macro.


'identifier' : unable to find overloaded operator
Compiler Error C2545

'identifier' : unable to find overloaded operator

The specified operator could not be used with the provided operands.

An overloaded operator should be supplied with the required operands.

This error can be caused by using the operator with operands of the incorrect type. Defining a conversion operator or a constructor that takes a single parameter may allow the operator to be used.


'operator' : illegal mix of 'void' pointer with non-'void' pointer
Compiler Error C2546

'operator' : illegal mix of 'void' pointer with non-'void' pointer

The specified operator was called with incompatible pointer types.

This error can be caused by using an arithmetic operator on a void pointer. Pointer arithmetic can only be done with pointers to objects.

If the operator must be used with a void pointer, then the operator can be overloaded. Alternatively, cast the void pointer into a type that can be used with the specified operator.


illegal cast of overloaded function
Compiler Error C2547

illegal cast of overloaded function

A pointer to a function type was converted to an overloaded type.

Conversion of a pointer to a function into a pointer to an overloaded function is not allowed.

The following is an example of this error:

int func();
int func( int );
( int (*)() )func;      // error, func is overloaded
int func2();
( void (*)() )func2;    // OK, func2 is not overloaded


'identifier1::identifier2' : missing default parameter for parameter 'identifier3'
Compiler Error C2548

'identifier1::identifier2' : missing default parameter for parameter 'identifier3'

A parameter was missing in a default parameter list.

If a default parameter is supplied anywhere in a parameter list, then all subsequent parameters on the right side of the default parameter must also be defined.

The following is an example of this error:

void func( int = 1, int, int = 3);  // error
void func( int, int, int = 3);      // OK
void func( int, int = 2, int = 3);  // OK


user-defined conversion cannot specify return type
Compiler Error C2549

user-defined conversion cannot specify return type

A user-defined conversion cannot specify a return type.

The following is an example of this error:

class X
{
public:
   int operator int() { return value; }   // error
   operator int() { return value; }       // OK
private:
   int value;
};


'identifier' : constructor initializer lists are only allowed on constructor definitions
Compiler Error C2550

'identifier' : constructor initializer lists are only allowed on constructor definitions

A base class initializer list was used on a function definition that was not a constructor.

The following is an example of this error:

class C
{
public:
   C();
};

class D : public C
{
public:
   D();
   void func();
};

void D::func() : C() {}  // error
D::D() : C() {}          // OK


'void *' type needs explicit cast to non-'void' pointer type
Compiler Error C2551

'void *' type needs explicit cast to non-'void' pointer type

A void pointer was assigned to a nonvoid pointer by implicit conversion.

An explicit cast is necessary to convert a void pointer to a nonvoid pointer.


'identifier' : nonaggregates cannot be initialized with initializer list
Compiler Error C2552

'identifier' : nonaggregates cannot be initialized with initializer list

The specified identifier was incorrectly initialized.

An initializer list is needed to initialize the following types:

An array

A class, structure, or union that does not have constructors, private or protected members, base classes, or virtual functions

These types are known as "aggregates."


no legal conversion of return value to return type 'type'
Compiler Error C2553

no legal conversion of return value to return type 'type'

The return value could not be converted to the required type.

You may need to supply a user-defined conversion operator to cast the return value.


'class1::function1' : overriding virtual function differs from 'class2::function2' only by return type or calling convention
Compiler Error C2555

'class1::function1' : overriding virtual function differs from 'class2::function2' only by return type or calling convention

The specified virtual function and a derived overriding function had identical parameter lists but different return types.

An overriding function in a derived class cannot be redefined to differ only by its return type from a virtual function in a base class.

A function in a derived class or structure overrides a virtual function in a base class only if their names, parameters, and return values are all identical. (If the functions have different parameters, then the compiler treats them as different functions and does not override the virtual function.)

It may be necessary to cast the return value after the virtual function has been called.

The following is an example of this error:

struct X
{
   virtual void func();
};
struct Y : X
{
   char func();  // error
};


'identifier' : overloaded functions only differ by return type
Compiler Error C2556

'identifier' : overloaded functions only differ by return type

The indicated overloaded functions had different return types but the same parameter list.

Each overloaded function must have a distinctly different formal parameter list.


'identifier' : nonpublic members initialized without constructor
Compiler Error C2557

'identifier' : nonpublic members initialized without constructor

Private and protected members cannot be assigned a value except by the class's member or friend functions.  Nonpublic members should be initialized in the class constructor.


'identifier' : no copy constructor available
Compiler Error C2558

'identifier' : no copy constructor available

No copy constructor was defined to copy the specified class.

A copy constructor is used to initialize an object with the values of another object of the same type, that is, to make a copy of the object.

If no copy constructor is provided, the compiler will generate a default copy constructor. A default copy constructor is not generated by the compiler if any user-defined copy constructor has been defined.


'function' : overloaded function differs only by calling convention/memory model
Compiler Error C2560

'function' : overloaded function differs only by calling convention/memory model

The specified overloaded function declarations did not specify different formal parameter types. Overloaded functions cannot differ only by calling convention or memory model.

The following is an example of this error:

void _cdecl  func();
void _pascal func();       // error
void _pascal func( int );  // OK


'identifier' : function must return a value
Compiler Error C2561

'identifier' : function must return a value

The specified function was declared as returning a value, but the function definition did not contain a return statement.

This error can be caused by an incorrect function prototype. If the function does not return a value, the function should be declared with a void return type.


'identifier' : void function returning a value
Compiler Error C2562

'identifier' : void function returning a value

The indicated function was declared as a void function but returned a value.

This error can be caused by an incorrect function prototype. If the function returns a value, the return type must be specified in the function declaration.


mismatch in formal parameter list
Compiler Error C2563

mismatch in formal parameter list

The formal parameter list of a function or pointer to a function did not match those of another function or pointer to a member function, respectively.

The assignment of the functions or pointers could not be made because of incompatible declarations.

The following is an example of this error:

void func( int );
void func( int, int );
main()
{
   void *fp();
   fp = func;                // error
   fp = func( int, int );    // OK
}


formal/actual parameter mismatch in call through pointer to function
Compiler Error C2564

formal/actual parameter mismatch in call through pointer to function

The formal parameters in the function declaration did not match the actual parameters passed through the pointer to the function.


'::identifier' was previously declared as a global function
Compiler Error C2565

'::identifier' was previously declared as a global function

The indicated member function had the same name as a function declared earlier with global scope.


overloaded function in a conditional expression
Compiler Error C2566

overloaded function in a conditional expression

The overloaded function in a conditional expression could not be evaluated.

The following is an example of this error:

int f( int );
int f( double );
void main()
{
   if( f );      // error, which f?
   if( f(1) );   // OK
}


'identifier' : intrinsic function must have prototypes when using C++
Compiler Error C2567

'identifier' : intrinsic function must have prototypes when using C++

The specified intrinsic function was not prototyped.

The following is an example of this error:

#include <string.h>
#pragma intrinsic( abs )     // error, no prototype for abs()
#pragma intrinsic( strcpy )  // OK, prototyped in string.h


'identifier1' : unable to resolve function overload 'identifier2'
Compiler Error C2568

'identifier1' : unable to resolve function overload 'identifier2'

The compiler could not unambiguously determine which of the specified overloaded functions to call.

The actual parameters passed to the function should be cast to match the formal parameters listed in the declaration of one of the specified functions. One parameter match must be better than any of the other possible matches.


'identifier' : union cannot be used as a base class
Compiler Error C2569

'identifier' : union cannot be used as a base class

A class was derived from the specified union.

A union is not allowed to be a base class. If another user-defined type must be derived from the specified union, the union should be changed to a class or structure.


'identifier' : union cannot have base classes
Compiler Error C2570

'identifier' : union cannot have base classes

A union was derived from a class, structure, or union.

The derived user-defined type must be declared as a class or structure.


'identifier' : union cannot have virtual function 'identifier'
Compiler Error C2571

'identifier' : union cannot have virtual function 'identifier'

The specified union was declared to have a virtual function.

Virtual functions can only be used with a class or structure but not with a union. Change the specified union to a class or structure or make it a nonvirtual function.


'identifier1::identifier2' : redefinition of default parameter : parameter 'identifier3'
Compiler Error C2572

'identifier1::identifier2' : redefinition of default parameter : parameter 'identifier3'

The specified default parameter in a member function was redefined.

A default parameter cannot be redefined. If another value for the parameter is required, then the default parameter should be left undefined.


'identifier' : simple type cast must have exactly one expression
Compiler Error C2573

'identifier' : simple type cast must have exactly one expression

The specified conversion had a wrong number of actual parameters.

The following is an example of this error:

void func()
{
  int i = int();     // error, no actual parameters
  int j = int( 1.0 ) // OK
}


'identifier' : illegal static destructor declaration
Compiler Error C2574

'identifier' : illegal static destructor declaration

The specified destructor was declared as static.

Destructors cannot be declared as static.


'identifier' : only member functions and bases can be virtual
Compiler Error C2575

'identifier' : only member functions and bases can be virtual

The specified global function or class was declared as virtual.

The keyword virtual refers only to members of a class or structure. A global function or a class or structure that is not a base class cannot be declared as virtual.


'identifier' : virtual used for static member function
Compiler Error C2576

'identifier' : virtual used for static member function

A static member function was declared as virtual.

The virtual function mechanism relies on the specific object that calls the function to determine which virtual function is used. Since this is not possible for static functions, they cannot be declared as virtual.


'identifier' : destructor cannot return a value
Compiler Error C2577

'identifier' : destructor cannot return a value

The specified destructor returned a value.

A destructor cannot return a value of any type. This error is caused by defining a destructor that returns a value of any type, including a void return type.

This error can be eliminated by removing the return statement from the destructor definition.


'identifier1::identifier2(identifier3)' : parameter list not sufficiently different to 'identifier1::identifier2(identifier4)'
Compiler Error C2579

'identifier1::identifier2(identifier3)' : parameter list not sufficiently different to 'identifier1::identifier2(identifier4)'

The parameter lists for the specified functions were not sufficiently different.

The formal parameter lists of overloaded functions must all be different.


redefinition of class name 'identifier'
Compiler Error C2580

redefinition of class name 'identifier'

The specified class, structure, or union was already defined.

A class, structure, or union can be defined only once.


'identifier' : static 'operator=' function is illegal
Compiler Error C2581

'identifier' : static 'operator=' function is illegal

The assignment operator, operator=(), was declared as static.

The assignment operator cannot be declared as static.


'identifier' : 'operator=' function is unavailable
Compiler Error C2582

'identifier' : 'operator=' function is unavailable

No assignment operator, operator=(), was defined for the specified class.

If any assignment operator has been defined that takes the class as a parameter, then a default assignment operator will not be generated by the compiler. The assignment operator must be explicitly defined for each class and is not inherited by derived classes.


'identifier' : const/volatile 'this' pointer is illegal for constructors/destructors
Compiler Error C2583

'identifier' : const/volatile 'this' pointer is illegal for constructors/destructors

A constructor or destructor was declared with a const or volatile specifier.

The const and volatile declaration specifiers cannot be used for constructors or destructors.


'identifier1' : direct base 'identifier2' is inaccessible; already a base of 'identifier3'
Compiler Error C2584

'identifier1' : direct base 'identifier2' is inaccessible; already a base of 'identifier3'

The specified derived class (identifier1) was derived from a direct base class (identifier3) that was already a base class of the derived class (identifier2).

A class (or structure) cannot use the same class more than once as a direct base class (a class mentioned in the list of base classes for the derived class). A base class can be used more than once as an indirect base class (a class not in the list of base classes).


explicit conversion to 'type' is ambiguous
Compiler Error C2585

explicit conversion to 'type' is ambiguous

The type conversion could produce more than one result.

Ambiguous conversion can result when converting from a class (or structure) type based on multiple inheritance. If the same base class is inherited more than once, the conversion function or operator must specify which of the inherited classes to use in the conversion. The scope resolution operator (::) can be used to do this.

Ambiguous conversion can also be caused when a conversion operator and a constructor making the same conversion have been defined.


incorrect user-defined conversion syntax : illegal indirections
Compiler Error C2586

incorrect user-defined conversion syntax : illegal indirections

Indirection of a conversion operator is not allowed.

The following is an example of this error:

class C
{
   * operator int();   // error, indirection on the operator
};

typedef int * pINT_t;
class D
{
   operator pINT_t();  // OK
};


'identifier' : illegal use of local variable as default parameter
Compiler Error C2587

'identifier' : illegal use of local variable as default parameter

A local variable was illegally used as a default parameter.

The following is an example of this error:

int i;
void func();
{
   int j;
   extern void func2( int k = j );  // error, local variable
   extern void func2( int k = i );  // OK
}


'::~identifier' : illegal global destructor
Compiler Error C2588

'::~identifier' : illegal global destructor

The specified destructor was not defined for a class, structure, or union.

A destructor can be defined only for a class, structure, or union.

This error can be caused by omitting the name of a class, structure, or union on the left side of the scope resolution operator (::).

The following is an example of this error:

~F();  // error


'identifier' : illegal token on right side of '::'
Compiler Error C2589

'identifier' : illegal token on right side of '::'

The token on the right side of the scope resolution operator (::) was not legal.

Only a member of a class (or structure or union) can be on the right side of the scope resolution operator if a class name is on the left side. Otherwise, any global identifier can be on the right side.


'identifier' : ambiguous user-defined conversions in switch expression
Compiler Error C2590

'identifier' : ambiguous user-defined conversions in switch expression

The specified switch expression could not be converted to an integral type.

An expression in a switch expression must unambiguously convert to an integral type.

Ambiguous conversion can be caused when a conversion operator and a constructor making the same conversion have been defined.


'identifier' : ambiguous user-defined conversions in conditional expression
Compiler Error C2591

'identifier' : ambiguous user-defined conversions in conditional expression

The specified conditional expression could not be converted to an integral type.

An expression in a conditional expression must unambiguously convert to an integral type.

Ambiguous conversion can be caused when a conversion operator and a constructor making the same conversion have been defined.


no legal conversion of initialization expression to type 'type'
Compiler Error C2592

no legal conversion of initialization expression to type 'type'

The value of the initialization expression could not be converted to the specified type.

A conversion operator may need to be supplied to make the required cast.


operator 'identifier' is ambiguous
Compiler Error C2593

operator 'identifier' is ambiguous

More than one possible operator was defined for the specified overloaded operator.

An explicit cast of one or more of the actual parameters can resolve the ambiguity.

The following is an example of this error:

struct A {};
struct B : A {};
struct X {};
struct D : B, X {};
void operator+( X, X );
void operator+( A, B );
D d;
void main()
{
   d +  d;         // error, D has an A, B, and X
   (X)d + (X)d;    // OK, uses operator+( X, X )
}

This error can also be caused by serializing a floating point variable using a CArchive object. The error identifies the operator << as being ambiguous. The only primitive C++ types that CArchive can serialize are the fixed-size types BYTE, WORD, DWORD, and LONG. All integer types can be cast to one of these types for serialization. Floating point types must be handled differently. They can be archived using CArchive's member function CArchive::Write(). The following example shows how to archive a floating point variable 'f' to an archive 'ar':

ar.Write(&f, sizeof( float ));


Compiler Error C2595

'identifier' : qualified name already has a constructor

A constructor was already defined for the specified nested class, structure, or union.

Only one constructor can be defined for a class, structure, or union.


Compiler Error C2596

'identifier' : qualified name already has a destructor

A destructor was already defined for the specified nested class, structure, or union.

Only one destructor can be defined for a class, structure, or union.


Compiler Error C2597

'identifier' : does not specify an object

The specified identifier was not a member of a class, structure, or union.

A member access operator (. or ->) was used to refer to a function that was not defined as a member of the class, structure, or union.


Compiler Error C2598

linkage specification must be at global scope

The linkage specifier was declared in local scope.

The following is an example of this error:

void func()
{
   extern "C" int func2();   // error, linkage declared in
   .                         //     block with local scope
   .
   .
}
extern "C" int func( int i );  // OK


Compiler Error C2599

'function' : local functions are not supported

The specified function was defined inside the body of another function.

This error can be caused by omitting the closing curly brace (}) in a function definition.

The following is an example of this error:

void func1()
{
                  // Missing a closing curly brace here
void func2() {}   // Error detected on this line

void func3()
{
void func4() {}   // Error detected on this line
}                 // Local functions not allowed


functions cannot be defined in local classes
Compiler Error C2601

functions cannot be defined in local classes

A function definition was found in a class definition.

A function cannot be declared as local to a class, structure, or union.

The following is an example of this error:

void main()
{
   class C
   {
   int f() { return 0; }   // error, local function
   };
}


'class::identifier' is not a member of a base of 'class'
Compiler Error C2602

'class::identifier' is not a member of a base of 'class'

An access declaration was made for the specified identifier, but it is not a member of a base class.

A member of a class or structure cannot be accessed in another class that is not derived from the member's class.

The following is an example of this error:

struct X
{
   int x;
};
struct A
{
   int a;
};
struct B : public A
{
   X::x;       // error, B is not derived from X
   A::a;       // OK
};


illegal access declaration: 'class1' is not a direct base of 'class2'
Compiler Error C2603

illegal access declaration: 'class1' is not a direct base of 'class2'

The specified class or structure (class2) contained an access declaration for a member of a class or structure (class1) that was not a direct base.

To change the access to a member of an indirect base class, use its qualified name in the public or protected part of the derived class declaration. The qualified name must specify a direct base class.

The following is an example of this error:

struct A
{
   int a, a2;
};
struct B : A {};
struct C : B
{
   A::a2;  // error, A is not a direct base
   B::a;   // OK, qualified name specifies a direct base
};


cannot declare 'modifier' access to 'modifier' member 'class::identifier'
Compiler Error C2604

cannot declare 'modifier' access to 'modifier' member 'class::identifier'

The access declaration of the given identifier specified an access that was different from the access declared in the base class or structure.

An access declaration may not restrict access to a member that is accessible in a base class, nor may it grant more access to a member of the base class, beyond that which already it already has.

The following example shows illegal access declarations:

struct X
{
private:
    int priv;
protected:
    int prot;
public:
    int pub;
};
struct A : public X
{
protected:
   X::priv;    // error
   X::pub;     // error
public:
   X::priv;    // error
   X::prot;    // error
};
struct B : protected X
{
protected:
   X::priv;    // error
   X::pub;     // error
public:
   X::priv;    // error
   X::prot;    // error
};
struct C : private X
{
protected:
   X::priv;    // error
   X::pub;     // error
public:
   X::priv;    // error
   X::prot;    // error
};


overloaded functions 'class::function' do not have same access
Compiler Error C2605

overloaded functions 'class::function' do not have same access

The specified overloaded functions have different access but but were named in an access declaration.

Access cannot be adjusted for overloaded functions that do not have the same access.

The following are examples of this error:

struct X
{
private:
   int f();
protected:
   int f(int);
public:
   int f(int,int);
};
struct A : public X
{
protected:
   X::f;       // error
public:
   X::f;       // error
};
struct B : protected X
{
protected:
   X::f;       // error
public:
   X::f;       // error
};
struct C : private X
{
protected:
   X::f;       // error
public:
   X::f;       // error
};


'class::identifier': illegal private access declaration
Compiler Error C2606

'class::identifier': illegal private access declaration

The access of the specified identifier was adjusted in the private part of the derived class declaration.

The access to a member of a base class in a derived class can only be adjusted by mentioning its name in the public or protected part of the derived class declaration.

The following are examples of this error:

struct X
{
private:
   int priv;
protected:
   int prot;
public:
   int pub;
};
struct A : public X
{
private:
   X::priv;    // error
   X::prot;    // error
   X::pub;     // error
};
struct B : protected X
{
private:
   X::priv;    // error
   X::prot;    // error
   X::pub;     // error
};
struct C : private X
{
private:
   X::priv;    // error
   X::prot;    // error
   X::pub;     // error
};


'initializing' : cannot implicitly convert a 'type1' to a 'type2' that is not const
Compiler Error C2607

'initializing' : cannot implicitly convert a 'type1' to a 'type2' that is not const

The specified type was converted to a nonconst type type2.

The initializer for a reference to type2 must be one of the following:

An l-value of type type2

A type derived from type2 for which type2 is an accessible base

If the reference is to a const type, then an object of that type will be created and initialized with the initializer. A temporary object of type type2 was required but could not be initialized with a nonconst reference type2&.

The following is an example of this error:

float f;
int& ri2 = f; // error, f is not an int lvalue


illegal reference cast - operand not an l-value
# C2608 Compiler Error C2608

illegal reference cast - operand not an l-value

The reference could not be cast.

This error occurs when a temporary copy of the referenced value cannot be generated.

The following is an example of this error:

struct C
{
   int mem;
   operator int();
};
struct D
{
   operator C();
   void memfunc();
};
D aD[10];
void D::memfunc()
{
   C aC = ( C& )( aD + 1 );   // error
}


'identifier' : cannot implicitly convert a non-lvalue 'type1' function return to a 'type2' that is not const
Compiler Error C2609

'identifier' : cannot implicitly convert a non-lvalue 'type1' function return to a 'type2' that is not const

A reference cannot be initialized from a non-lvalue function return.

This is an error when the ANSI compatibility option is enabled (/Za) and a warning when the Microsoft extensions are enabled (/Ze).

The following is an example of this error:

struct X { };
X f();
X& r = f();   // error


identifier 'identifier' can never be instantiated; user defined constructor is required
Compiler Error C2610

identifier 'identifier' can never be instantiated; user defined constructor is required

The specified class cannot be properly initialzied.

This error occurs when a constructor cannot be created for the class. A user-defined constructor should be defined.


'token' : illegal following '~' (expected identifier)
Compiler Error C2611

'token' : illegal following '~' (expected identifier)

The specified token was not an identifier.

The following is an example of this error:

class C
{
   C::~operator int();    // error
   ~C();                  // OK, destructor declaration
};


trailing ',' illegal in base/member initializer list
Compiler Error C2612

trailing ',' illegal in base/member initializer list

A comma (,) was placed after the last base or member in an initializer list.

The following is an example of this error:

class A
{
public:
   int i;
   A( int ia ) : i( ia ), {}; // error, extra comma
};
class B
{
public:
   int i;
   B( int ib ) : i( ib ) {};  // OK
};


trailing ',' illegal in base class list
Compiler Error C2613

trailing ',' illegal in base class list

A comma (,) was placed after the last base in a base class list.

The following is an example of this error:

class A {};
class B : public A, {};  // error, extra comma
class C : public A {};   // OK


'class1' : illegal member initialization: 'class2' is not a base or member
Compiler Error C2614

'class1' : illegal member initialization: 'class2' is not a base or member

A class in an initialization list was not a base class or member.

Only a member or base class can be in the initialization list for a class or structure.

The following is an example of this error:

class A
{
public:
   int i;
   A( int ia ) : B( i ) {};  // error, B is not a member of A
};


'function' : inconsistent return statement
Compiler Error C2617

'function' : inconsistent return statement

The specified function did not have a return type declared, and a previous return statement did not supply a value.

The function's return type should be declared.

The following is an example of this error:

int i;
func()                   // no return type prototype
{
   if( i ) return;       // no return value
   else return( 1 );     // error detected on this line
}


'function' : inconsistent return statement
Compiler Error C2618

'function' : inconsistent return statement

The specified function did not have a return type declared, and a previous return statement had a different type.

The function's return type should be declared.

The following is an example of this error:

int i;
func()                   // no return type prototype
{
   if( i ) return( 1 );  // int return value
   else return;          // error detected on this line
}


union 'union' : can not have static member variable 'identifier'
Compiler Error C2619

union 'union' : can not have static member variable 'identifier'

The specified union member was declared as static.

A union cannot have a static data member.

The following is an example of this error:

void func()
{
   union
   {
   static int j; // error, j is static
   int i;        // OK
   };
}


union 'union' : member 'identifier' has default constructor
Compiler Error C2620

union 'union' : member 'identifier' has default constructor

The specified union member was declared with a default constructor.

A union member is not allowed to have a default constructor.

The following is an example of this error:

class A
{
   A();      // A has a default constructor
};
union U
{
   A a;      // error
};


union 'union' : member 'identifier' has a copy constructor
Compiler Error C2621

union 'union' : member 'identifier' has a copy constructor

The specified union member was declared with a copy constructor.

A union member is not allowed to have a copy constructor.

The following is an example of this error:

class A
{
   A( const A& );  // A has a copy constructor
};
union U
{
   A a;            // error
};


union 'union' : member 'identifier' has assignment operator
Compiler Error C2622

union 'union' : member 'identifier' has assignment operator

The specified union member was declared with an assignment operator, operator=().

A union member is not allowed to have an assignment operator.

The following is an example of this error:

class A
{
   A& operator= ( const A& );  // A's assignment operator
};
union U
{
   A a;                        // error
};


union 'union': member 'identifier' has destructor
Compiler Error C2623

union 'union': member 'identifier' has destructor

The specified union member was declared with a destructor.

A union member is not allowed to have a destructor.

The following is an example of this error:

class A
{
   ~A();    // A has a destructor
};
union U
{
   A a;     // error
};


'identifier' : references to void are illegal
Compiler Error C2624

'identifier' : references to void are illegal

The specified identifier was declared as a reference to void.

References to void are not allowed.


anonymous union did not declare any non-static data members
Compiler Error C2625

anonymous union did not declare any non-static data members

Unions cannot have static data members.

The following is an example of this error:

static union {};         // error
static union { int i; }; // OK


anonymous union defines protected/private member 'identifier'
Compiler Error C2626

anonymous union defines protected/private member 'identifier'

The specified member was declared with protected or private access.

A member of an anonymous union must have public access.

The following are an examples of this error:

void main()
{
   union
   {
   public:
      int i;     // OK, i is public
   protected:
      int j;     // error, j is protected
   private:
      int k;     // error, k is private
   };
}


anonymous union defines member function 'function'
Compiler Error C2627

anonymous union defines member function 'function'

The specified function was declared in an anonymous union.

An anonymous union cannot have member functions.

The following is an example of this error:

void main()
{
    union
       int i;
       void func( void );     // error, union is anonymous
    };
    union U
       void func2( void );    // OK
    };
}


'type1' followed by 'type2' is illegal. (did you forget a ';'?)
Compiler Error C2628

'type1' followed by 'type2' is illegal. (did you forget a ';'?)

A section of code between the two specified types was incorrect.

This error can be caused by a missing semicolon.

The following is an example of this error:

class C
{
public:
   void func( void ) {;}
}                         // semicolon is missing here
void main() {}            // error detected on this line


unexpected 'token ('
Compiler Error C2629

unexpected 'token ('

A syntax error made the statement ambiguous.

This error can be caused by mixing declaration and expression syntax.

The following is an example of this error:

class B
{
   B( &B );  // error, misplaced &
   B( B& );  // OK
};


'symbol' found in what should be a comma separated list
Compiler Error C2630

'symbol' found in what should be a comma separated list

The specified symbol was used in a context that requires a comma-separated list.

The following is an example of this error:

class D
{
   public:
   D(int);
};
class E
{
   public:
   E(int);
};
class C : public D, public E   // OK
{
   C();
};
C::C() : D(0) ; E(0) { }       // error


'class' : destructors not allowed a return type
Compiler Error C2631

'class' : destructors not allowed a return type

A destructor in the specified class, structure, or union was declared with a return type.

A destructor cannot be declared with a return type.

The following are examples of this error:

class C
{
   int ~C();   // error, returns int
   void ~C();  // error, returns void
   ~C();       // OK
};


'type1' followed by 'type2' is illegal
Compiler Error C2632

'type1' followed by 'type2' is illegal

Two type specifiers had missing code between them.

The following is an example of this error:

int float i;   // error


'identifier' : 'inline' is the only legal storage class for constructors
Compiler Error C2633

'identifier' : 'inline' is the only legal storage class for constructors

The constructor was declared as other than inline.

The following is an example of this error:

class C
{
   extern C();  // error, not inline
};


'&class::member' : pointer to reference member is illegal
Compiler Error C2634

'&class::member' : pointer to reference member is illegal

A pointer to a reference member was declared.

The following is an example of this error:

int mem;

struct S
{
   S() : rf(mem) { }
   int &rf;
};
int (S::*pdm) = &S::rf;  // error


cannot convert an 'identifier1*' to an 'identifier2*'; conversion from a virtual base class is implied
Compiler Error C2635

cannot convert an 'identifier1*' to an 'identifier2*'; conversion from a virtual base class is implied

The specified conversion required a cast from a virtual base class to a derived class.

Casting from a virtual base class to a derived class is not allowed.


pointer to reference member is illegal
Compiler Error C2636

pointer to reference member is illegal

A pointer to a reference member was declared.

The following is an example of this error:

struct S {};
int &S::*prs;       // error


'identifier' : cannot modify pointers to data members
Compiler Error C2637

'identifier' : cannot modify pointers to data members

The specified pointer to a data member was modified.

The following is an example of this error:

struct S {};
int __pascal S::*pms;     // error


'identifier' : memory-model modifier illegal on pointer to data member
Compiler Error C2638

'identifier' : memory-model modifier illegal on pointer to data member

A memory-model modifier was specifed for a pointer to a data member.

Memory-model modifiers can only be used for pointers to member functions.

The following is an example of this error:

class C
{
public:
   int i;
   int j;
   int func();
};
int __near C::* cpi = &C::i;  // error, __near modifier
int C::* cpj = &C::j;         //OK
int (__near C::* cpf)() = &C::func; // OK, not data member


compiler generated default constructor required by unnamed class
Compiler Error C2639

compiler generated default constructor required by unnamed class

A default constructor was required for an unnamed class, structure, or union. A name is required for a constructor to be generated.

The following is an example of this error:

class A
{
public:
   A();      // default constructor declaration
};

class C
{
public:
   struct    // unnamed struct
   {
      A a;
   } s1;     // error detected here
   struct S  // named struct
   {
      A a;
   } s2;     // OK
};


cannot convert a pointer to member across a virtual inheritance path
Compiler Error C2640

cannot convert a pointer to member across a virtual inheritance path

A pointer to a member was illegally cast to a pointer to a member of a base class that is declared as virtual.

The following is an example of this error:

class A
{
public:
   int a;
};
class B
{
public:
   int b;
};
class C : virtual public A, public B {};
int C::* cpa = &C::a;         // error, C's A is virtual
int C::* cpb = &C::b;         // OK


illegal pointer to member cast across virtual inheritance path
Compiler Error C2641

illegal pointer to member cast across virtual inheritance path

A pointer to a member was cast to a base class that was inherited using virtual inheritance.

The following is an example of this error:

struct V {};
struct A : virtual V {};
int A::*pma;
int V::*pmv = (int V::*)pma;      // error


cast to pointer to member must be from related pointer to member
Compiler Error C2642

cast to pointer to member must be from related pointer to member

A pointer to a member was cast to a pointer to a member of a class (or structure) that was not a derived or base class.

The following is an example of this error:

class B
{
public:
   int b:
};
class C {};
int C:: cpb = (int C::*)&B::b;  // error
class D : public B
{
public:
   int d;
};
int D:: dpb = (int D::*)&B::b;  // OK, B is a base class of D
int B:: bpd = (int B::*)&D::d;  // OK


illegal cast from pointer to member
Compiler Error C2643

illegal cast from pointer to member

A pointer to a member of a class, structure, or union was cast to a different type.

The following is an example of this error:

class C
{
public:
   int i;
   operator int*() { return &i; }
};
int C::* cpi = (int*)&C::i; // error
int C::* cpi2 = &C::i;      // OK


basis class 'class' for pointer to member has not been defined
Compiler Error C2644

basis class 'class' for pointer to member has not been defined

A pointer was declared that pointed to a class that was declared but not defined.

The following is an example of this error:

class C;
int C::* cp; // error, C has not been defined
class D {};
int D::*dp;  // OK


no qualified name for pointer to member (found ':: *')
Compiler Error C2645

no qualified name for pointer to member (found ':: *')

The pointer to member declaration did not specify a class.

The declaration of a pointer to a member of a class (or structure or union) must specify the name of the class.

The following is an example of this error:

class A {};

int ::* cp;    // error, class not specifed
int B::* bp    // error, B not defined
int A::* ap;   // OK


global anonymous unions must be declared static
Compiler Error C2646

global anonymous unions must be declared static

The anonymous union had global scope but was not declared as static.

The following is an example of this error:

union { int i; };         // error, not static
static union { int j; };  // OK
union U { int i; };       // OK, not anonymous


'identifier' : use of non-static member as default parameter
Compiler Error C2648

'identifier' : use of non-static member as default parameter

The specified nonstatic member was used as a default parameter.

The following is an example of this error:

class C
{
public:
   int i;
   static int j;
   void func1( int i = i );  // error, i is not static
   void func2( int i = j );  // OK, uses static j
};


'identifier' : is not a 'class-key'
Compiler Error C2649

'identifier' : is not a 'class-key'

The specified class, structure, or union declaration used an incorrect tag.

The following is an example of this error:

struct S
{
   int i;
};
class S::i c;   // error


'operator' : cannot be a virtual function
Compiler Error C2650

'operator' : cannot be a virtual function

The specified operator was declared as virtual.

The operators new and delete cannot be virtual because they are static member functions.

The following is an example of this error:

class A
{
   virtual void* operator new( unsigned int ); // error
};


'identifier' : illegal copy constructor : first parameter must not be an 'identifier'
Compiler Error C2652

'identifier' : illegal copy constructor : first parameter must not be an 'identifier'

The first parameter in the specified copy constructor was the same type as the class, structure, or union for which it was defined.

A copy constructor for a type can take a reference to the type as the first parameter but not the type itself.

The following is an example of this error:

class A
{
   A( A );     // error, takes an A
};
class B
{
   B( B& );    // OK, reference to B
};


'identifier' : is not a class name
Compiler Error C2653

'identifier' : is not a class name

The specified identifier was not a class, structure, or union.

An identifier that was not a class, structure, or union was accessed using incorrect syntax.

The following is an example of this error:

int x;
int main()
{
   return x::i; // error
}


'identifier' : attempt to access member outside a member function
Compiler Error C2654

'identifier' : attempt to access member outside a member function

The specifed identifier was accessed in a declaration.

Member data can only be accessed in member functions.

This error can be caused by trying to initialize variables in a declaration. A constructor should be used for this purpose.

The following is an example of this error:

class A
{
   int i;
   int j = i;  // error, access outside function
   void setj( void ) { j = i ; }  // OK, access in function
   A( int ai )
   {
      i = ai;  // OK, initializes i and j
      j = i;
   }
} a( 1 );


'identifier' : definition or redeclaration illegal in current scope
Compiler Error C2655

'identifier' : definition or redeclaration illegal in current scope

The specified identifier was redeclared or redefined in nonglobal scope.

An identifier can only be redeclared in global scope.

The following is an example of this error:

class A {};
class B
{
public:
   static int i;
};
void main()
{
   A B::i;  // error
}


'function' : function not allowed as a bit field
Compiler Error C2656

'function' : function not allowed as a bit field

The specified function was declared as a member of a bit field.

This error can be caused by a syntax error in a constructor initializer list.


'class::*' found at the start of a statement. (did you forget to specify a type?)
Compiler Error C2657

'class::*' found at the start of a statement. (did you forget to specify a type?)

The line began with the specified pointer to member identifier.

This error can be caused by omitting a type specifier in the declaration of a pointer to a member.

The following is an example of this error:

class C {};
void main() {
   C::* pmc1;        // error
   void C::* pmc2;   // OK
}


multiple conversions: 'type1(type2)' and 'type1::operator type2()'
Compiler Error C2658

multiple conversions: 'type1(type2)' and 'type1::operator type2()'

The conversion was ambiguous because it could be done with either the specified constuctor or the specifed conversion operator.

The following is an example of this error:

struct A;

struct B
{
   B(A);
   B();
};
struct A
{
   operator B();
};
A a;
B b = B(a);  // error


'operator' : overloaded function as left operand
Compiler Error C2659

'operator' : overloaded function as left operand

An overloaded function was on the left side of the specified operator.

The following is an example of this error:

int func( int );
int func( double );
void main()
{
   func = 10;  // error
}


'function' : function does not take 'number' parameters
Compiler Error C2660

'function' : function does not take 'number' parameters

The specified function was called with an incorrect number of actual parameters.

This error can be caused by calling the function with incorrect actual parameters or by omitting a function declaration.

The following is an example of this error:

void func( int, int );

void main()
{
   func( 1 );     // error, func( int ) not declared
   func( 1, 0 );  // OK, func( int, int ) was declared
}


'function' : no overloaded function takes 'number' parameters
Compiler Error C2661

'function' : no overloaded function takes 'number' parameters

The specified overloaded function was not declared for the given number of parameters.

This error can be caused by calling the function with incorrect actual parameters or by omitting a function declaration.

The following is an example of this error:

void func( int );
void func( int, int );
void main()
{
   func( );      // error, func( void ) was not declared
   func( 1 );    // OK, func( int ) was declared
}


'function' : cannot convert 'this' pointer from 'type1' to 'type2'
Compiler Error C2662

'function' : cannot convert 'this' pointer from 'type1' to 'type2'

The required conversion for the this pointer was not defined.

A user-defined conversion operator may be required.

The following is an example of this error:

class __far C
{
public:
   void func() __near;
} c;

void main()
{
   c.func();  // error
}


'function' : 'number' overloads have no legal conversion for 'this' pointer
Compiler Error C2663

'function' : 'number' overloads have no legal conversion for 'this' pointer

The required conversion was not defined for the this pointer to the specified overloaded functions.

A user-defined conversion operator may be required.

The following is an example of this error:

class __far C
{
public:
   void func() __near;
   void func( int ) __near;
} c;

void main()
{
   c.func();  // error
}


'function' : cannot convert parameter 'number' from 'type1' to 'type2'
Compiler Error C2664

'function' : cannot convert parameter 'number' from 'type1' to 'type2'

The specified parameter of the specified function could not be converted to the required type.

An explicit conversion may need to be supplied.

The following is an example of this error:

class A {} a;

func( int, A );

void main()
{
   func( 1, 1 );  // error, no conversion from A to int
}


'function' : none of the 'number1' overloads can convert parameter 'number2' from type 'type'
Compiler Error C2665

'function' : none of the 'number1' overloads can convert parameter 'number2' from type 'type'

The specified parameter of the overloaded function could not be converted to the required type.

A conversion operator or explicit conversion may need to be supplied.


'identifier' : 'number' overloads have similar conversions
Compiler Error C2666

'identifier' : 'number' overloads have similar conversions

The specified overloaded function or operator was ambiguous.

This error is caused by formal parameter lists that are too similar to resolve ambiguity.

An explicit cast of one or more of the actual parameters can resolve the ambiguity.

The following is an example of this error:

void func( int, float ) {};
void func( float, int ) {};
func( 1, 1 );        // error, same conversion for each func
func( 1, (float)1 )  // OK


'function' : none of 'number' overload have a best conversion
Compiler Error C2667

'function' : none of 'number' overload have a best conversion

The specified overloaded ambiguous function call could not be resolved.

The conversion required to match the actual parameters in the function call to one of the overloaded functions must be strictly better than the conversions required by all of the other overloaded functions.


'function' : ambiguous call to overloaded function
Compiler Error C2668

'function' : ambiguous call to overloaded function

The specified overloaded function call could not be resolved.

An explicit cast of one or more of the actual parameters can resolve the ambiguity.

The following is an example of this error:

struct A {};
struct B : A {};
struct X {};
struct D : B, X {};

void func( X, X );
void func( A, B );
D d;
void main()
{
   func( d, d );        // error, D has an A, B, and X
   func( (X)d, (X)d );  // OK, uses func( X, X )
}


illegal to overload member 'operator delete' with different number of formal arguments
Compiler Error C2669

illegal to overload member 'operator delete' with different number of formal arguments

under construction


'function' : static member functions do not have 'this' pointers
Compiler Error C2671

'function' : static member functions do not have 'this' pointers

The specified static member function could not access a this pointer.

The following is an example of this error:

struct S
{
   static S* const func() { return this; }  // error
};


'function' : new/delete member functions do not have 'this' pointers
Compiler Error C2672

'function' : new/delete member functions do not have 'this' pointers

The specified new or delete operator did not have a this pointer to access.

The following is an example of this error:

class C
{
   void* operator new( unsigned int )
   {
      this = 10;      // error  return 0;
   }
};


'function' : global functions do not have 'this' pointers
Compiler Error C2673

'function' : global functions do not have 'this' pointers

The specified global function did not have a this pointer to access.

The following is an example of this error:

void main()
{
   this = 0;  // error
}


'operator' : operands could not be converted from 'type1' to 'type2'
Compiler Error C2674

'operator' : operands could not be converted from 'type1' to 'type2'

A conversion was not defined to convert an operand to the required type.

Define a constructor or conversion operator to make the required conversion.

The following is an example of this error:

class C
{
   public:
   C();       // no constructor with an int argument
} c;
class D
{
   public:
   D( int );
   D();
} d;
void main()
{
   c = 10;    // error
   d = 10;    // OK
}


__except cannot appear in termination block
Compiler Error C2702

__except cannot appear in termination block

An exception handler (__try/__except) or termination handler (__try/__finally) cannot be nested inside a __finally block.

The following example causes this error:

int Counter;
void main ()
{
   __try {}
   __finally
   {
      __try {}
      __except( Counter ) {}    // error
   }
}


illegal __leave statement
Compiler Error C2703

 illegal __leave statement

A __leave statement must be within a __try block.

The following is an example of this error:

void main ()
{
   __leave;   //error
   __try
   {
      __leave;   //OK
   }
   __finally {}
}


'identifier' : illegal jump into __try scope
Compiler Error C2705

'identifier' : illegal jump into __try scope

Program control was transferred to the specified label within a __try block.

The following is an example of this error:

void main ()
{
goto trouble;
   __try {
   trouble: ;   //error
   }
   __finally {}
}


'identifier' : bad context for intrinsic function
Compiler Error C2707

'identifier' : bad context for intrinsic function

The structured exception handling intrinsic functions are only valid in certain contexts. This is caused by one of the following conditions:

_exception_code() was called outside of an exception filter or __except block

_exception_info() was called outside of an exception filter

_abnormal_termination() was called outside of a __finally block


'identifier' : actual parameters length in bytes differs from previous call or reference
Compiler Error C2708

'identifier' : actual parameters length in bytes differs from previous call or reference


'identifier' : formal parameters length in bytes differs from previous declaration
Compiler Error C2709

'identifier' : formal parameters length in bytes differs from previous declaration


cannot delete a pointer to a const object
Compiler Error C2710

cannot delete a pointer to a const object

A pointer to an object declared as const was illegally deleted using the delete operator.

The following is an example of this error:

const int* pci;
const int i = 0;
void main()
{
   pci = &i;
   delete pci;  // error, pci points to a const
}


cannot delete a pointer to a function
Compiler Error C2711

cannot delete a pointer to a function

A pointer to a function was illegally deleted using the delete operator.

The following is an example of this error:

void (*pf)();
void func();
void main()
{
   pf = func;
   delete pf;   // error, pf points to a function
}


'identifier' : 'specifier' storage class specifier illegal on members
Compiler Error C2720

'identifier' : 'specifier' storage class specifier illegal on members

A storage class was illegally specified for the given identifier.

The following is an example of this error:

struct S
{
   static int i;
};
static S::i;   // error


'specifier' : storage class specifier illegal between operator keyword and type
Compiler Error C2721

'specifier' : storage class specifier illegal between operator keyword and type

A type conversion cannot specify a storage class. User-defined type conversions apply to all storage classes.


'::operator' : illegal following operator command; use operator 'operator'
Compiler Error C2722

'::operator' : illegal following operator command; use operator 'operator'

Either ::new or ::delete was redefined using the operator statement. Since the new and delete operators are global, the scope resolution operator (::) is meaningless in this context.

Remove the scope resolution operator preceding the given operator.


'function' : 'specifier' storage class specifier illegal on function definition
Compiler Error C2723

'function' : 'specifier' storage class specifier illegal on function definition

The given specifier is not allowed on a function definition appearing outside of a class declaration. The virtual specifier can only be specified on a member function declaration appearing within the class declaration.

The following is an example of this error:

struct X
{
   virtual void f();
   virtual void g();
};
virtual void X::f() {} // error, virtual specifier
void X::g() {}         // OK


'identifier' : 'static' should not be used on member functions defined at file scope
Compiler Error C2724

'identifier' : 'static' should not be used on member functions defined at file scope

A static member function was defined at file scope. Static member functions should be declared with external linkage.

This is a warning when Microsoft extensions are used (/Ze) and is an error when Microsoft extensions are disabled (/Za).

The following is an example of this error:

class C
{
   static void func();
};

static void C::func(){};    // error


'class' : cannot be a base class of itself
Compiler Error C2730

'class' : cannot be a base class of itself

Recursive base classes are illegal.

Remove the base class specifier, or specify another class as a base class.


'identifier' : function cannot be overloaded
Compiler Error C2731

'identifier' : function cannot be overloaded

The functions main, WinMain, and LibMain cannot be overloaded.

The following is an example of this error:

extern "C" void WinMain(int, char *, char *);
void WinMain(int, short, char *, char*);          // error


linkage specification contradicts earlier specification for 'function'
Compiler Error C2732

linkage specification contradicts earlier specification for 'function'

The specified function was already declared with a different linkage specifier.

This error can be caused by different linkage specifiers found in include files.

Change the extern statements so that the linkages agree.

The following is an example of this error:

extern void func( void );      // implicit C++ linkage
extern "C" void func( void );  // error


second C linkage of overloaded function 'function' not allowed
Compiler Error C2733

second C linkage of overloaded function 'function' not allowed

More than one overloaded function was declared with C linkage.

When using C linkage, only one form of a given function can be made external.

Since overloaded functions have the same undecorated name, they cannot be used with C programs.


'identifier' : nonextern const object must be initialized
Compiler Error C2734

'identifier' : nonextern const object must be initialized

The specified identifier was declared as const but was not initialized.

An identifier must be initialized when declared as const unless it is declared as extern.

The following is an example of this error:

const int j;           // error
extern const int i;    // OK, declared as extern


'keyword' keyword is not permitted in formal parameter type specifier
Compiler Error C2735

'keyword' keyword is not permitted in formal parameter type specifier

The specified keyword was illegal in its context.

The following are examples of this error:

void main()
{
   int *myint;
   myint = new static int;     // error
   myint = new typedef int;    // error
   myint = new auto int;       // error
   myint = new register int;   // error
}


'keyword' keyword is not permitted in cast
Compiler Error C2736

'keyword' keyword is not permitted in cast

The specified keyword was illegally used in a cast.

The following is an example of this error:

int main()
{
   return (virtual) 0;   // error
}


'class1' : base class 'class2' must be exported
Compiler Error C2737

'class1' : base class 'class2' must be exported

A derived class class1 was exported, but its base class class2 was not.

If class1 is exported, class2 must also be exported.


'operator' : 'const T' to 'T'  : 'identifier1' to 'identifier2'
Compiler Error C2750

'operator' : 'const T' to 'T' : 'identifier1' to 'identifier2'

The specified conversion was illegal.


'operator' : 'volatile T' to 'T'  : 'identifier1' to 'identifier2'
Compiler Error C2751

'operator' : 'volatile T' to 'T' : 'identifier1' to 'identifier2'

The specified conversion is illegal.


'operator' : 'const T *' to 'T *'  : 'identifier1' to 'identifier2'
Compiler Error C2752

'operator' : 'const T *' to 'T *' : 'identifier1' to 'identifier2'

The specified conversion is illegal.


identifier2' : 'volatile T *' to 'T *'  : 'identifier1' to 'identifier2'
Compiler Error C2753

'operator' : 'volatile T *' to 'T *' : 'identifier1' to 'identifier2'

The specified conversion is illegal.


'operator' : 'const T **' to 'T **'  : 'identifier1' to 'identifier2'
Compiler Error C2754

'operator' : 'const T **' to 'T **' : 'identifier1' to 'identifier2'

The specified conversion is illegal.


'operator' : 'volatile T **' to 'T **'  : 'identifier1' to 'identifier2'
Compiler Error C2755

'operator' : 'volatile T **' to 'T **' : 'identifier1' to 'identifier2'

The specified conversion is illegal.


'operator' : 'memory model mismatch'  : 'identifier1' to 'identifier2'
Compiler Error C2756

'operator' : 'memory model mismatch' : 'identifier1' to 'identifier2'

The specified conversion is illegal.


'operator' : 'language modifier mismatch: 'identifier2' to 'identifier2'
Compiler Error C2757

'operator' : 'language modifier mismatch: 'identifier1' to 'identifier2'

The specified conversion is illegal.


'const' : must be initialized in constructor base/member initializer list
Compiler Error C2758

'const' : must be initialized in constructor base/member initializer list

The given constant was not initialized with an initializer list in the object constructor. The compiler left the constant undefined.

If a const or reference member variable is not given a value when it is initialized, it must be given a value in the object constructor.


operator 'operator' cannot be overloaded
Compiler Error C2800

operator 'operator' cannot be overloaded

The specified operator was overloaded.

The following operators cannot be overloaded: class member access operator (.), pointer to member operator (.*), scope resolution operator (::), conditional expression operator (? :), and sizeof operator.

The following is an example of this error:

 class C
 {
    operator:: ();  // error :: is overloaded
 };


operator 'symbol' must be a nonstatic member
Compiler Error C2801

operator 'symbol' must be a nonstatic member

The specified overloaded operator was not a member of a class, structure, or union, and/or was declared as static.

The following operators can only be overloaded in class scope as nonstatic members: assignment operator '=', class member access operator '->', subscripting operator '[]', and function call operator '()'.

The following are examples of this error:

operator[]();            // error, not a member

class A
{
   static operator->();  // error, static
   operator()();         // OK
};


static member operator 'symbol' has no formal parameters
Compiler Error C2802

static member operator 'symbol' has no formal parameters

The specified static member operator had a void formal parameter list.

An operator declared by a static member function must take at least one parameter.

The following is an example of this error:

class A
{
   static operator+ ();     // error, void parameter list
   static operator* ( A& ); // OK
};


operator 'symbol' must have at least one formal parameter of class type
Compiler Error C2803

operator 'symbol' must have at least one formal parameter of class type

The specified overloaded operator was declared without at least one class-type parameter.

The following is an example of this error:

int operator+( int, int );  // error


binary operator 'operator' has too many formal parameters
Compiler Error C2804

binary operator 'operator' has too many formal parameters

The specified overloaded binary operator was declared with more than one parameter.

The following is an example of this error:

class X
{
   X operator+ ( X , X );  // error, two parameters
   X operator+ ( X );      // OK, one parameter
};


binary operator 'operator' has too few formal parameters
Compiler Error C2805

binary operator 'operator' has too few formal parameters

The specified binary operator was called with a void parameter list.

The following is an example of this error:

class X
{
public:
   X operator< ( void );  // error, must take one parameter
   X operator< ( X );     // OK
};


operator 'symbol' has too many formal parameters
Compiler Error C2806

operator 'symbol' has too many formal parameters

The specified overloaded operator was declared with too many parameters.

The following is an example of this error:

class X
{
public:
   X operator++ ( int, int ); // error, more than 1 parameter
   X operator++ ( int );      // OK
} ;


second formal parameter to postfix 'operator symbol' must be 'int'
Compiler Error C2807

second formal parameter to postfix 'operator symbol' must be 'int'

The second parameter to the specified postfix operator must be declared to be of type int.

The following is an example of this error:

class X
{
public:
   X operator++ ( X );    // error, nonvoid parameter
   X operator++ ( int );  // OK, int parameter
};


unary 'operator symbol' has too many formal parameters
Compiler Error C2808

unary 'operator symbol' has too many formal parameters

The specified overloaded unary operator was incorrectly declared with a nonvoid parameter list.

The following is an example of this error:

class X
{
public:
   X operator! ( X );     // error, nonvoid parameter list
   X operator! ( void );  // OK
};


'operator symbol' has no formal parameters
Compiler Error C2809

'operator symbol' has no formal parameters

The specified operator was incorrectly declared with a void parameter list.

The following is an example of this error:

int operator+ ();  // error


second formal parameter for 'operator delete' must be 'unsigned int'
Compiler Error C2810

second formal parameter for 'operator delete' must be 'unsigned int'

An overloaded two-parameter operator delete must have its second formal parameter declared as an unsigned integer.

The second formal parameter in this form of the operator delete specifies the size of the object being deleted, and therefore it must be of type size_t, that is, an unsigned integer.


too many formal parameters for based form of 'operator delete'
Compiler Error C2811

too many formal parameters for based form of 'operator delete'

There were too many formal parameters for the operator delete for based pointers.

When used on based pointers, the operator delete takes either two or three actual parameters.

The following are the prototypes for the based form of the operator delete:

void operator delete( __segment, void __based( void ) * );
operator delete( __segment, void __based( void ) *, unsigned int );


second formal parameter required for based form of 'operator delete'
Compiler Error C2812

second formal parameter required for based form of 'operator delete'

There were too few formal parameters for the operator delete for based pointers.

The following are the prototypes for the based forms of the operator delete:

void operator delete( __segment, void __based( void ) * );
operator delete( __segment, void __based( void ) *, unsigned int );


too many formal parameters for non-based 'operator delete'
Compiler Error C2813

too many formal parameters for non-based 'operator delete'

Too many formal parameters were provided for the nonbased form of the operator delete. The operator delete can take one or two formal parameters.

The following are the prototypes for the nonbased forms of the operator delete:

void operator delete ( void __near * );
void operator delete ( void __near *, unsigned int );
void operator delete ( void __far * );
void operator delete ( void __far *, unsigned int );
void operator delete ( void __huge * );
void operator delete ( void __huge *, unsigned int );


second formal parameter for based form of 'operator delete' must be '__based(void) *'
Compiler Error C2814

second formal parameter for based form of 'operator delete' must be '__based(void) *'

The second formal parameter for an overridden based form of the operator delete must be of type __based(void) *.

The following are the prototypes for the based forms of the operator delete:

void operator delete( __segment, void __based( void ) * );
operator delete( __segment, void __based( void ) *,  unsigned int);


first actual parameter for based form of 'operator delete' must be '__segment'
Compiler Error C2815

first actual parameter for based form of 'operator delete' must be '__segment'

The first formal parameter for an overridden based operator delete must be of type __segment.

The following are the prototypes for the based forms of the operator delete:

void operator delete( __segment, void __based( void ) * );
operator delete( __segment, void __based( void ) *,  unsigned int);


alternative form of 'operator delete' must be a member
Compiler Error C2816

alternative form of 'operator delete' must be a member

The two-parameter form of the operator delete can be redefined only within a class, structure, or union. Global redefinitions of operator delete are allowed to have only one parameter.


return type for 'operator delete' must be 'void'
Compiler Error C2817

return type for 'operator delete' must be 'void'

A redefinition of the operator delete contained a return statement that returned a type other than void. The return value for the operator delete must be void.


incorrect return type for 'operator ->'
Compiler Error C2818

incorrect return type for 'operator ->'

A redefinition of the class member access operator (->) contained a return statement that did not return an appropriate type.

The class member access operator must return one of the following:

A pointer to a class, structure, or union

A reference to a class, structure, or union where the -> operator is defined

An instance of a class, structure, or union where the -> operator is defined


recursive return type for 'operator ->'
Compiler Error C2819

recursive return type for 'operator ->'

A redefinition of the class member access operator (->) contained a return statement that was recursive.

To use recursion in a redefinition of the class member access operator, move the recursive routine to a separate function that is called from the operator override function.


second formal parameter required for based form of 'operator new'
Compiler Error C2820

second formal parameter required for based form of 'operator new'

There were too few formal parameters for the operator new for based pointers.

This is the prototype for the based form of the operator new:

void __based( void ) * operator new( __segment, unsigned int );


first formal parameter for 'operator new' must be 'unsigned int'
Compiler Error C2821

first formal parameter for 'operator new' must be 'unsigned int'

The first formal parameter of the near or far forms of the operator new must be an unsigned int.

The following are the prototypes for the near and far forms of the operator new:

void __near * operator new( unsigned int );
void __far * operator new( unsigned int );


second formal parameter for __huge form of 'operator new' must be 'unsigned int'
Compiler Error C2822

second formal parameter for __huge form of 'operator new' must be 'unsigned int'

The second formal parameter of the huge form of the operator new must be an unsigned int.

This is the prototype for the huge form of the operator new:

void __huge * operator new( unsigned long, unsigned int );


return type for based form of 'operator new' must be 'void __based(void)*'
Compiler Error C2823

return type for based form of 'operator new' must be 'void __based(void)*'

A redefinition of the based form of the operator new contained a return statement that returned a type that was not a based pointer. The return value for the operator new must be void __based( void ) *.


return type for 'operator new' must be 'void *'
Compiler Error C2824

return type for 'operator new' must be 'void *'

A redefinition of the nonbased form of the operator new contained a return statement that returned a type that was not a void pointer. The return value for the operator new must be void *.


first formal parameter for huge form of 'operator new' must be 'unsigned long'
Compiler Error C2825

first formal parameter for huge form of 'operator new' must be 'unsigned long'

The first formal parameter of the huge form of the operator new must be an unsigned long.

This is the prototype for the huge form of the operator new:

void __huge * operator new( unsigned long, unsigned int );


second formal parameter required for __huge form of 'operator new'
Compiler Error C2826

second formal parameter required for __huge form of 'operator new'

There were too few formal parameters for the operator new for huge objects.

This is the prototype for the huge form of the operator new:

void __huge * operator new( unsigned long, unsigned int );


'operator symbol' cannot be globally overridden with unary form
Compiler Error C2827

'operator symbol' cannot be globally overridden with unary form

The given operator cannot have a unary form outside of an object.

Make sure that the overloaded operator is local to the object or choose an appropriate unary operator to overload.


'operator symbol' cannot be globally overridden with binary form
Compiler Error C2828

'operator symbol' cannot be globally overridden with binary form

The given operator cannot have a binary form outside of an object.

Make sure that the overloaded operator is local to the object or choose an appropriate binary operator to overload.


'operator symbol' cannot have a variable parameter list
Compiler Error C2829

'operator symbol' cannot have a variable parameter list

The given operator cannot have a variable parameter list.

The new and function call (parentheses) operators are the only operators that can take variable parameters.


only placement parameters to 'operator new' can have default values
Compiler Error C2830

only placement parameters to 'operator new' can have default values

The standard formal parameters for the operator new cannot be given default values. Only user-defined placement parameters can specify defaults.

Since the compiler automatically passes values to the standard formal parameters, a default value is meaningless.


'operator symbol' cannot have default parameters
Compiler Error C2831

'operator symbol' cannot have default parameters

Default parameters cannot be specified for the given operator.

Only the new, assignment (=), and left parenthesis operators can have default values.


'modifier' form of 'operator operator' cannot be a member
Compiler Error C2832

'modifier' form of 'operator operator' cannot be a member

The specified form of the operator new or delete was declared as a member of a class, structure, or union.

The huge and based forms of these operators are not supported as member functions.

The following are examples of this error:

class T
{
public:
   void __huge* operator new ( unsigned long, size_t );      // error
   void __based(void)* operator new ( __segment, size_t );   // error
   void operator delete ( void __huge* );                    // error
   void operator delete ( __segment, void __based(void)* );  // error
};


'operator symbol' is not a recognized operator or type
Compiler Error C2833

'operator symbol' is not a recognized operator or type

The operator command was not followed by either an operator (to override) or a type (to convert).

Make sure that the operator command is followed by an operator or a type.


'operator symbol' must be globally qualified
Compiler Error C2834

'operator symbol' must be globally qualified

The given operator cannot be local to a class. Since the new and delete operators are tied to the class in which they reside, the scope resolution operator (::) cannot be used to select a version of the operator from a different class.

To implement multiple forms of the new or delete operator, create a version of the operator that takes extra formal parameters.


user-defined conversion 'type' takes no formal parameters
Compiler Error C2835

user-defined conversion 'type' takes no formal parameters

A user-defined type conversion was declared as having one or more formal parameters. User-defined type conversions cannot take formal parameters.

Remove the formal parameters or choose an operator to overload.


cannot export 'identifier': a previous declaration did not export it
Compiler Error C2836

cannot export 'identifier': a previous declaration did not export it

The given identifier was declared to be exported, but a previous declaration did not export it.

All declarations of a given identifier must be either external or nonexternal.

The following is an example of this error:

extern int i;         // i not exported
int    __export i;    // error, i exported


'identifier' : illegal local static variable in exported inline function
Compiler Error C2837

'identifier' : illegal local static variable in exported inline function

There was an attempt to declare a local static variable inside an external inline function. External inline functions cannot declare local static variables.


#pragma hdrstop cannot be nested in a function or definition
Compiler Error C2850

#pragma hdrstop cannot be nested in a function or definition

The hdrstop pragma cannot be placed inside the body of a function or definition.

Move the #pragma hdrstop statement to an area that is not contained in curly braces or parentheses.


#pragma hdrstop required for /Yu command-line option without filename
Compiler Error C2851

#pragma hdrstop required for /Yu command-line option without filename

The /Yu (use precompiled headers) command-line option did not specify the name of a precompiled header file, and there was no #pragma hdrstop statement.

This error can be avoided by specifying a filename after the /Yu command-line option or by using #pragma hdrstop in the source file.


'file' is not a valid precompiled header file
Compiler Error C2852

'file' is not a valid precompiled header file

The specified file is not a precompiled header file. Check that the filename was spelled correctly.


'file' is not a precompiled header file created with this compiler
Compiler Error C2853

'file' is not a precompiled header file created with this compiler

The specified precompiled header file was created by a different version of the compiler or by a 32-bit compiler.


syntax error in #pragma hdrstop
Compiler Error C2854

syntax error in #pragma hdrstop

The #pragma hdrstop statement gave an invalid filename.

The hdrstop pragma is followed by an optional filename enclosed in parentheses and quotation marks, as in:

#pragma hdrstop( "source\\pchfiles\\myheader.pch" )

The precompiled header filename cannot be enclosed in angle brackets (<>).


command-line option 'option' inconsistent with precompiled header
Compiler Error C2855

command-line option 'option' inconsistent with precompiled header

The given command-line option differed from that given when the precompiled header (.PCH) was created.

This error can be avoided by regenerating the precompiled header with the given command-line option.


#pragma hdrstop cannot be inside an #if block
Compiler Error C2856

#pragma hdrstop cannot be inside an #if block

The hdrstop pragma cannot be placed inside the body of a conditional compilation block.

Move the #pragma hdrstop statement to an area that is not contained in an #if/#endif block.


'#include filename' statement specified with the /Yc'filename' command-line option was not found in the source file
Compiler Error C2857

'#include filename' statement specified with the /Yc'filename' command-line option was not found in the source file

The /Yc command-line option specified the name of an include file, but that file was not included in the source file being compiled.

Make sure that the filename specified in the /Yc command-line option corresponds to an include file specified in an #include statement in the current source file.

This error can be caused by having the #include statement in a conditional compilation block that is not compiled.


UNKNOWN WARNING Contact Microsoft Product Support Services
Compiler Warning (level 1) C4000

UNKNOWN WARNING Contact Microsoft Product Support Services

The compiler detected an unknown error condition.

Note the circumstances of the error, and notify Microsoft Corporation by following the instructions in the Technical Support help file or the Microsoft Product Assistance Request form at the back of one of your manuals.


nonstandard extension 'single line comment' was used
Compiler Warning (level 4) C4001

nonstandard extension 'single line comment' was used

A single line comment was used in a C source file.

If the /Za option has been specified, this condition generates a syntax error.

The following is an example of this warning:

int i;    // warning
int j;    /* no warning */


too many actual parameters for macro 'identifier'
Compiler Warning (level 1) C4002

too many actual parameters for macro 'identifier'

The number of actual parameters specified with the given identifier was greater than the number of formal parameters given in the macro definition of the identifier.

The additional actual parameters were collected but ignored during expansion of the macro.


not enough actual parameters for macro 'identifier'
Compiler Warning (level 1) C4003

not enough actual parameters for macro 'identifier'

The number of actual parameters specified with the given identifier was less than the number of formal parameters given in the macro definition of the identifier.

When a formal parameter is referenced in the definition and the corresponding actual parameter has not been provided, empty text is substituted in the macro expansion.


incorrect construction after 'defined'
Compiler Warning (level 1) C4004

incorrect construction after 'defined'

The defined operator was incorrectly terminated, causing a warning or error to appear when the remainder of the line following defined was compiled.

The following example generates this warning and a fatal error:

#if defined( ID1 ) || ( ID2 )

The compiler assumed that the identifier ID1 was the only operand for the defined operator. The rest of the line could not be parsed.

The following avoids this problem:

#if defined( ID1 ) || defined( ID2 )


'identifier' : macro redefinition
Compiler Warning (level 1) C4005

'identifier' : macro redefinition

The given identifier was defined twice. The compiler used the second macro definition.

This warning can be caused by defining a macro on the command line and in the code with a #define directive. It also can be caused by macros imported from include files.

To eliminate the warning, either remove one of the definitions or use an #undef directive before the second definition.


#undef expected an identifier
Compiler Warning (level 1) C4006

#undef expected an identifier

The name of the identifier whose definition was to be removed was not given with the #undef directive. The #undef directive was ignored.


'identifier' : must be 'attribute'
Compiler Warning (level 2) C4007

'identifier' : must be 'attribute'

The attribute of the given function was not explicitly stated. The compiler forced the attribute.

For example, the function main must have the __cdecl attribute.


'identifier' : 'attribute' attribute ignored
Compiler Warning (levels 2 and 3) C4008

'identifier' : 'attribute' attribute ignored

The __fastcall, static, or inline attribute for the given identifier was ignored.

Data cannot be defined with the __fastcall attribute, and the main function cannot be defined with the static or inline attribute.

This is a level 2 warning for data and a level 3 warning for functions.


string too big; trailing characters truncated
Compiler Warning (level 1) C4009

string too big; trailing characters truncated

A string exceeded the compiler limit of 2047 on string size. The excess characters at the end of the string were truncated.

To correct this problem, break the string into two or more strings.


single-line comment contains line-continuation character
Compiler Warning (level 3) C4010

single-line comment contains line-continuation character

A single-line comment (introduced by //) contains a line- continuation character (\). The next line after the line- continuation character is ignored; it is considered to be the continuation of the previous line and is treated as a comment.

For performance reasons, some syntax directed editors will not correctly indicate the physical line following the line- continuation character as a comment. You should ignore the syntax coloring on any lines that cause this warning.


'identifier' : identifier was truncated to 'number' characters
Compiler Warning (level 1) C4011

'identifier' : identifier was truncated to 'number' characters

The name of the specified identifier was too long.

The maximum length of a linkable external identifier is 247 characters, after name decoration.

The default maximum length of an undecorated name or user-entered fragment of a decorated name is 32 characters. The /H compiler switch can be used to set a different maximum length.


'function' undefined; assuming extern returning int
Compiler Warning (level 3) C4013

'function' undefined; assuming extern returning int

An undefined function was called. The compiler assumed an external function that returned an int type.

Make sure that the function name is spelled correctly. All external functions should be prototyped as extern.


concatenating mismatched wide strings
Compiler Warning (level 1) C4014

concatenating mismatched wide strings

A wide string literal was concatenated with a standard string literal.

Make sure that all wide string literals are prefixed with an "L" character, as in:

char   hello[] = L"Hello, " "world"   // Warning
char   hello[] = L"Hello, " L"world"  // OK


'identifier' : type of bit field must be integral
Compiler Warning (level 1) C4015

'identifier' : type of bit field must be integral

The given bit field was not declared as an integral type. The compiler assumed the base type of the bit field to be unsigned.

Bit fields must be declared as unsigned integral types.


'function' : no function return type; using int as default
Compiler Warning (level 3) C4016

'function' : no function return type; using int as default

Since the given function had not yet been declared or defined, the return type was unknown. A default return type of int was assumed.

This warning may be avoided by adding a prototype for the given function.


'expression' : signed/unsigned mismatch
Compiler Warning (level 3) C4018

'expression' : signed/unsigned mismatch

There was an attempt to compare a signed and unsigned number. The signed value was converted to an unsigned type for the comparison.

When performing an equal (==) or not equal (!=) comparison between signed and unsigned types, cast one type to the other to ensure proper comparison.


empty statement at global scope
Compiler Warning (level 4) C4019

empty statement at global scope

The compiler found a semicolon that was not preceded by a statement. This warning is generated only in global scope.

This warning can be avoided by removing the extra semicolon.

The following example demonstrates this warning:

#define declint( varname ) int #varname;
declint( a );         //Warning, int a;;
declint( b )          //OK, int b;


'function' : too many actual parameters
Compiler Warning (level 1) C4020

'function' : too many actual parameters

The number of actual parameters specified in a function call was greater than the number of formal parameters specified in the function prototype or function definition.

The extra actual parameters were passed according to the calling convention used on the function.


'function' : too few actual parameters
Compiler Warning (level 1) C4021

'function' : too few actual parameters

The number of actual parameters specified in a function call was less than the number of formal parameters specified in the function prototype or function definition.

Only the provided actual parameters were passed. If the called function references a variable that was not passed, the results are undefined.


'function' : pointer mismatch for actual parameter 'number'
Compiler Warning (level 1) C4022

'function' : pointer mismatch for actual parameter 'number'

The pointer type of the given actual parameter was different from the pointer type specified in the formal parameter list or function definition.

The actual parameter was passed without change. Its value will be interpreted as a pointer within the called function.


'function' : different types for formal and actual parameter 'number'
Compiler Warning (level 1) C4024

'function' : different types for formal and actual parameter 'number'

The type of the given actual parameter in a function call did not agree with the type given for the formal parameters in the function prototype or definition.

The actual parameter will be passed without change. The function will convert the parameter's type to the type expected by the function.


function declared with formal parameter list
Compiler Warning (level 1) C4026

function declared with formal parameter list

The function was declared to take formal parameters, but the function definition did not have formal parameters.

Subsequent calls to this function will assume that the function takes no actual parameters.


function declared without formal parameter list
Compiler Warning (level 1) C4027

function declared without formal parameter list

The function was declared to take no formal parameters (the formal parameter type list consisted of the keyword void), but either formal parameters were given in the function definition or actual parameters were given in a call to the function.

Subsequent calls to this function will assume that the function takes actual parameters of the types found in the function declaration or call.


formal parameter 'number' different from declaration
Compiler Warning (level 1) C4028

formal parameter 'number' different from declaration

The type of the given formal parameter did not agree with the corresponding parameter in the declaration or definition.

The type in the original declaration was used.


declared formal parameter list different from definition
Compiler Warning (level 1) C4029

declared formal parameter list different from definition

The types of formal parameters given in the function declaration did not agree with the types of the formal parameters given in the function definition.

The formal parameter list of the definition was used.


first formal parameter list longer than the second list
Compiler Warning (level 1) C4030

first formal parameter list longer than the second list

A function was declared more than once with different formal parameters.

The formal parameters given in the first declaration were used.


second formal parameter list longer than the first list
Compiler Warning (level 1) C4031

second formal parameter list longer than the first list

A function was declared more than once with different formal parameters.

The formal parameters given in the first declaration were used.


formal parameter 'number' has different type when promoted
Compiler Warning (level 4) C4032

formal parameter 'number' has different type when promoted

The type of the specified parameter is not compatible through default promotions with the type in a previous declaration.

For two function types to be compatible the type of each parameter must be compatible with the type that results from application of the default argument promotion.

This is an error in ANSI C (/Za) and a warning when the Microsoft extensions (/Ze) are used.

The following example causes this warning:

void func();
void func(char);     // warning, char promotes to int


'function' must return a value
Compiler Warning (level 1) C4033

'function' must return a value

The given function did not return a value.

Only functions with a return type of void can use the return command without an accompanying return value.

An undefined value will be returned when this function is called.


sizeof returns 0
Compiler Warning (level 1) C4034

sizeof returns 0

The sizeof operator was applied to an operand that yielded a size of zero.

This warning indicates that the operand of the sizeof operator was an empty structure, union, class, or enumerated type, or was of type void.


'function' : no return value
Compiler Warning (level 3) C4035

'function' : no return value

A function did not include a return statement.

This warning is generated for all functions (including main) that do not have return statements. Functions with a return type of void will not generate this warning.

An undefined value will be returned when this function is called.


unnamed 'type' as actual parameter
Compiler Warning (level 1) C4036

unnamed 'type' as actual parameter

The type of the structure, union, enumerated type, or class being passed as an actual parameter was not given.

The formal parameter in the generated function prototype will be commented out.

This warning occurs only when using the /Zg option for generating function prototypes and can be avoided by providing the appropriate type explicitly.


conflicting ambient class modifiers
Compiler Warning (level 1) C4037

conflicting ambient class modifiers

More than one ambient class modifier was specified for a class, structure, or union.

Only one ambient class modifier can be specified for a class, structure, or union.


memory attribute on 'identifier' ignored
Compiler Warning (level 1) C4040

memory attribute on 'identifier' ignored

The __near, __far, __huge, or __based keyword has no effect in the declaration of the given identifier and was ignored.


compiler limit : terminating browser output
Compiler Warning (level 1) C4041

compiler limit : terminating browser output

The limit to browser information has been exceeded. If you compiled using the /FR option (for source browser information including local variables), recompile using the /Fr option (for source browser information without local variables). Otherwise, disable the browser output option.


'identifier' : has bad storage class
Compiler Warning (level 1) C4042

'identifier' : has bad storage class

The storage class specified for the identifier could not be used in this context.

A default storage class for this context was used in place of the illegal storage class. Only the register storage class can be specified in a parameter declaration. The storage class was selected using the following rules.

If the identifier was a function, the compiler assumed extern class.

If the identifier was a formal parameter or local variable, the compiler assumed auto class.

If the identifier was a global variable, the compiler assumed the variable was declared with no storage class.


function specifier used more than once
Compiler Warning (level 1) C4043

function specifier used more than once

A function specifier was used more than once for a symbol.

The second function specifier was ignored.

The following example generates this warning:

inline inline void  no_op( void ) { };


specifier __huge on 'identifier' ignored; can only be applied to array
Compiler Warning (level 1) C4044

specifier __huge on 'identifier' ignored; can only be applied to array

The compiler ignored the __huge memory attribute for the given identifier. Only arrays can be declared with the __huge memory attribute. For pointers, __huge must be used as a modifier, not as a memory attribute.


'identifier' : array bounds overflow
Compiler Warning (level 1) C4045

'identifier' : array bounds overflow

Too many initializers were present for the given array. The excess initializers were ignored.

Make sure that the array elements and initializers match in size and quantity.


'identifier1' : 'operator' : different levels of indirection from 'identifier2'
Compiler Warning (level 1) C4047

'identifier1' : 'operator' : different levels of indirection from 'identifier2'

An expression involving the specified operator had inconsistent levels of indirection.

If both operands are of arithmetic type or if both are not (such as array or pointer), then they are used without change. If one operand is arithmetic, but the other is not, the arithmetic operator is converted to the type of the other operator.

For example, the following code generates this warning but is compiled without change:

char **p;
char *q;
p = q;   // warning


different declared array subscripts: 'identifier1' and 'identifier2'
Compiler Warning (level 1) C4048

different declared array subscripts : 'identifier1' and 'identifier2'

An expression involved pointers to arrays of different size. The pointers were used without conversion.

This warning can be avoided by explicitly casting the arrays to the same or equivalent type.


compiler limit : terminating line number emission
Compiler Warning (level 1) C4049

compiler limit : terminating line number emission

The file contained over 64K source lines. No line number support will be available beyond this limit.


'operator' : different code attributes
Compiler Warning (level 4) C4050

'placeholder' : 'operator' differs in code attributes from 'placeholder'

The function-pointer expressions used with the given operator had different code attributes, one of which is either __export or __loadds.

This is a warning and not an error because __export and __loadds affect only entry sequences and not calling conventions.


type conversion; possible loss of data
Compiler Warning (level 2) C4051

type conversion; possible loss of data

Two data items in an expression had different base types, causing the type of one item to be converted. During the conversion, a data item was truncated.

This warning can be avoided by casting the data items to the appropriate type.


function declarations different; one contains variable arguments
Compiler Warning (level 1) C4052

function declarations different; one contains variable arguments

One declaration of the function did not contain variable arguments, but another did.

The declaration containing the variable arguments was used.


one void operand for '?:'
Compiler Warning (level 1) C4053

one void operand for '?:'

An expression of type void was used as an operand.

The expression was evaluated using an undefined value for the void operand.


'conversion' : from function pointer 'type1' to data pointer 'type2'
Compiler Warning (level 1) C4054

'conversion' : from function pointer 'type1' to data pointer 'type2'

A function pointer was cast to a data pointer.

Make sure that the correct cast is being used.

This condition generates an error with the C compiler with the /Za ANSI-compatibility command-line option.


data pointer cast to a function pointer
Compiler Warning (level 1) C4055

'conversion' : from data pointer 'type1' to function pointer 'type2'

A data pointer was cast to a function pointer.

Make sure that the correct cast is being used.

This condition generates an error with the C compiler with the /Za ANSI-compatibility command-line option.


overflow in floating point constant arithmetic
Compiler Warning (level 2) C4056

overflow in floating point constant arithmetic

The compiler generated an exception while doing floating point constant arithmetic during compilation.

For example:

float fp_val = 1.0e400;

In this example, the floating-point constant 1.0e400 exceeds the maximum allowable value for a double-precision data item.


'operator' : 'identifier1' indirection to slightly different base types from 'identifier2'
Compiler Warning (level 4) C4057

'operator' : 'identifier1' indirection to slightly different base types from 'identifier2'

The pointer expressions used with the given operator had different base types.

The pointer expressions were used without conversion.

This warning can be caused by mixing signed and unsigned types, and short and long types.


unions are now aligned on alignment requirement, not size
Compiler Warning (level 1) C4058

unions are now aligned on alignment requirement, not size

Structures in a header file compiled with Microsoft Visual C++ may not be aligned exactly like structures in a library compiled with Microsoft C version 6 or earlier. This can happen only if /Zp4 or greater is selected to pack structures on 4 (or more) byte boundries.

Recompile the library with Visual C++ if the source is available. Alternatively, insert members into the structure that contains the union, placing them after the union, to make the structure the same size as it was when compiled with MS C version 6.

If you cannot able to recompile to meet the new alignment requirement, you can turn this warning off using #pragma warning(4058 : off).


pascal string too big, length byte is length % 256
Compiler Warning (level 1) C4059

pascal string too big, length byte is length % 256

A string followed by the pascal escape sequence (\p) can only be up to 255 characters in length. The string was truncated.


switch statement contains no 'case' or 'default' labels
Compiler Warning (level 3) C4060

switch statement contains no 'case' or 'default' labels

The following example causes this warning:

void func( int i )
{
   switch( i );   // warning
}


enumerate 'identifier' in switch of enum 'identifier' is not explicitly handled by a case label
Compiler Warning (level 4) C4061

enumerate 'identifier' in switch of enum 'identifier' is not explicitly handled by a case label

The specified enumerate did not have an associated handler in a switch statement.

The following example causes this warning

enum E { a, b, c };
void func ( E e )
{
   switch(e)
   {
   case a:
   case b:
   default:
      break;
   }        // warning, enumerate 'c' not handled by a case label
}


enumerate 'identifier' in switch of enum 'identifier' is not handled
Compiler Warning (level 3) C4062

enumerate 'identifier' in switch of enum 'identifier' is not handled

The specified enumerate did not have an associated handler in a switch statement and there was no default label.

The following example causes this warning

enum E { a, b, c };
void func ( E e )
{
   switch(e)
   {
   case a:
   case b:
      break;    // no default label
   }            // warning, enumerate 'c' not handled
}


case 'identifier' is not a valid value for switch of enum 'identifier'
Compiler Warning (level 3) C4063

case 'identifier' is not a valid value for switch of enum 'identifier'

The specified identifier was used as a case label in a switch statement.

The following example causes this warning

enum E { a, b };
void func ( E e )
{
   switch(e)
   {
   case a:
   case b:
   case 7:      // invalid switch value
      break;    // no default label
   }
}


switch of incomplete enum 'identifier'
Compiler Warning (level 3) C4064

switch of incomplete enum 'identifier'

A switch statement specified a selector of an enumerated type that was not defined.

The following example causes this warning

enum E;
void func ( E e )
{
   switch(e)
   {
   case 7:
      break;  // warning, E not defined
   }
}


switch statement contains 'default' but no 'case' labels
Compiler Warning (level 3) C4065

switch statement contains 'default' but no 'case' labels

The switch statement specified only a default case. It is functionally equivalent to a sequence of statements.

The following example causes this warning:

void func(int i)
{
   switch(i)
   {
   default:
      func(8);
   }                // warning detected on this line
}


unexpected characters following 'directive' directive - newline expected
Compiler Warning (level 1) C4067

unexpected characters following 'directive' directive - newline expected

Extra characters followed a preprocessor directive and were ignored. This warning appears only when compiling with the /Za ANSI-compatibility option.

For example, the following code generates this warning:

#endif    NO_EXT_KEYS

To remove the warning, compile with /Ze or use comment delimiters, as in:

#endif    /* NO_EXT_KEYS */


unknown pragma
Compiler Warning (level 1) C4068

unknown pragma

The compiler did not recognize a pragma and ignored it.

Make sure that the pragma is allowed by the type of compiler being used.


long double is the same precision as double
Compiler Warning (level 3) C4069

long double is the same precision as double

On some platforms, such as ones based on the R4000 processor, a long double has the same precision as a double.


return of a 'void' expression
Compiler Warning (level 1) C4070

return of a 'void' expression

This warning is given only when Microsoft extensions are enabled (/Ze) and the C language is used.


'function' : no function prototype given
Compiler Warning (level 2) C4071

'function' : no function prototype given

The given function was called before the compiler found the corresponding function prototype.

The function will be called using the default rules for calling a function without a prototype.


'function' : no function prototype on __fastcall function
Compiler Warning (level 1) C4072

'function' : no function prototype on __fastcall function

The given __fastcall function was called before the compiler found the corresponding function prototype.

The function will be called using the default rules for calling a function without a prototype.


initializers put in library initialization area
Compiler Warning (level 3) C4073

initializers put in library initialization area

The #pragma init_seg( lib ) statement was used. The library initialization area should be used only by third-party library developers.

This warning is informational.


initializers put in compiler reserved initialization area
Compiler Warning (level 1) C4074

initializers put in compiler reserved initialization area

The #pragma init_seg( compiler ) statement was used. The compiler initialization area is reserved by Microsoft.

Code in this area may be executed before C run-time library initialization.


'type' : may be used on integral types only
Compiler Warning (level 1) C4076

'type' : may be used on integral types only

The signed or unsigned type modifier was used with a nonintegral type.

The given qualifier was ignored.

The following example generates this warning:

unsigned double x;


unknown check_stack option
Compiler Warning (level 1) C4077

unknown check_stack option

An unknown option was given with the old form of the check_stack pragma. With the old form, the argument to the pragma must be empty, +, or -.

The current state of stack checking was left unchanged.

For example, the following generates this warning:

#pragma check_stack yes

The following code corrects this situation:

#pragma check_stack +    // Old form

or

#pragma check_stack (on) // New form


case constant 'value' too big for the type of the switch expression
Compiler Warning (level 1) C4078

case constant 'value' too big for the type of the switch expression

A value appearing in a case statement was larger than the size of the type used in the switch expression. The compiler cast the type of the case constant to that of the switch expression.

A problem can occur when two case constants have different values before being cast but the same value afterward.


unexpected token 'token'
Compiler Warning (level 1) C4079

unexpected token 'token'

An unexpected separator token was found in the argument list of a pragma.

The remainder of the pragma was ignored.

The following example generates this warning:

#pragma comment( "Kilroy was here", )


expected a comma; found 'token'
Compiler Warning (level 1) C4081

expected a comma; found 'token'

A comma (,) was missing between two arguments of a pragma.

The pragma was ignored.

The following example generates this warning:

#pragma optimize( "l" on )


expected an identifier; found 'token'
Compiler Warning (level 1) C4082

expected an identifier; found 'token'

An identifier was missing from the argument list.

The remainder of the pragma was ignored.


expected '('; found 'token'
Compiler Warning (level 1) C4083

expected '('; found 'token'

A left parenthesis was missing from a pragma's argument list.

The pragma was ignored.

The following example generates this warning:

#pragma check_pointer on )


expected a pragma keyword; found 'token'
Compiler Warning (level 1) C4084

expected a pragma keyword; found 'token'

The token following #pragma was not recognized as a directive.

The pragma was ignored.

The following example generates this warning:

#pragma (on)


expected 'on' or 'off'
Compiler Warning (level 1) C4085

expected 'on' or 'off'

The pragma expected an on or off parameter, but the specified parameter was unrecognized or missing.

The pragma was ignored.

The following example generates this warning:

#pragma optimize( "t", maybe )


expected '1', '2', '4', or '8'
Compiler Warning (level 1) C4086

expected '1', '2', '4', or '8'

The pragma expected a parameter of either 1, 2, 4, or 8, but the specifed parameter was not recognized or was missing.

The pack pragma will not accept an 8 when generating 16-bit code.

The following example generates this warning:

#pragma pack( 3 )


'function' : declared with 'void' parameter list
Compiler Warning (level 1) C4087

'function' : declared with 'void' parameter list

The given function was declared with no formal parameters, but a call to the function specified actual parameters.

The extra parameters were passed according to the calling convention used on the function.

The following example generates this warning:

int f1( void );
f1( 10 );


'function' : pointer mismatch in actual parameter 'number', formal parameter 'number'
Compiler Warning (level 1) C4088

'function' : pointer mismatch in actual parameter 'number', formal parameter 'number'

The actual parameter passed to the given function had a different level of indirection than the corresponding formal parameter.

The actual parameter will be passed without change. Its value will be interpreted as a pointer by the called function.


'function' : different types in actual parameter 'number', formal parameter 'number'
Compiler Warning (level 1) C4089

'function' : different types in actual parameter 'number', formal parameter 'number'

The actual parameter passed to the given function had a different type than the corresponding formal parameter.

The actual parameter will be passed without change. The function will cast the actual parameter to the type specified in the function definition.


'operation' : different 'modifier' qualifiers
Compiler Warning (level 1) C4090

'operation' : different 'modifier' qualifiers

The given operation was performed on a variable that was defined with the specified modifier. As a result, the variable could be modified without being detected by the compiler.

This warning often occurs when a pointer to an item declared as const or volatile is assigned to a pointer that was not declared as pointing to either of these type modifiers.

The expression was compiled without modification.

The following example generates this warning:

const  char *p = "abcde";
int    str( char *s );
str( p );


no symbols were declared
Compiler Warning (level 2) C4091

no symbols were declared

The compiler detected an empty declaration, as in the following example:

int ;

The declaration was ignored.


sizeof returns 'unsigned long'
Compiler Warning (level 4) C4092

sizeof returns 'unsigned long'

The operand of the sizeof operator was very large, so the sizeof operator returned an unsigned long.

This warning occurs only under the default /Ze Microsoft extensions. Under the /Za ANSI-compatibility option, this condition truncates the result of the sizeof operator.


unescaped newline in character constant in inactive code
Compiler Warning (level 3) C4093

unescaped newline in character constant in inactive code

The constant expression of an #if, #elif, #ifdef, or #ifndef preprocessor directive evaluated to zero, making the code that follows inactive. Within that inactive code, a newline character appeared within a set of single or double quotation marks.

All text until the next double quotation mark was considered to be within a character constant.


untagged 'token' declared no symbols
Compiler Warning (level 2) C4094

untagged 'token' declared no symbols

The compiler detected an empty declaration using an untagged structure, union, or class.

The declaration was ignored.

The following example generates this warning:

struct  { };

This condition generates an error with the /Za ANSI-compatibility command-line option.


expected ')'; found 'token'
Compiler Warning (level 1) C4095

expected ')'; found 'token'

More than one argument was given for a pragma that can take only one argument.

The compiler assumed the expected right parenthesis and ignored the remainder of the line.

The following example generates this warning:

#pragma skip( 10, 18, 67 )


'attribute1' must be used with 'attribute2'
Compiler Warning (level 2) C4096

'attribute1' must be used with 'attribute2'

Attribute2 requires the use of attribute1.

For example, using a variable number of arguments (...) requires that __cdecl be used. Also, __interrupt functions must be __far and __cdecl.

The compiler assumed the attribute1 attribute for the function.


nonstandard extension : typedef-name 'identifier1' used as synonym for class-name 'identifier2'
Compiler Warning (level 3) C4097

nonstandard extension : typedef-name 'identifier1' used as synonym for class-name 'identifier2'

typedef struct _T  {
    int i;
} T;
struct U : T  {        // warning
    int j;
};
struct V : T  {       // OK
    int j;
};


'function' : void function returning a value
Compiler Warning (level 1) C4098

'function' : void function returning a value

A function that was declared with a return type of void contained a return statement that returned a value.

The compiler assumed the function returned a value of type int.


'identifier' : type name first seen using 'objecttype1' now seen using 'objecttype2'
Compiler Warning (level 2) C4099

'identifier' : type name first seen using 'objecttype1' now seen using 'objecttype2'

The specified object was declared as either a structure or a class but was defined as a class or a structure, respectively.

The object type given in the definition was used.


'identifier' : unreferenced formal parameter
Compiler Warning (level 4) C4100

'identifier' : unreferenced formal parameter

The given formal parameter was never referenced in the body of the function for which it was declared.

This warning is for informational purposes only.


'identifier' : unreferenced local variable
Compiler Warning (level 3) C4101

'identifier' : unreferenced local variable

The given local variable was never used.

This warning is informational.


'label' : unreferenced label
Compiler Warning (level 3) C4102

'label' : unreferenced label

The given label was defined but never referenced.

This warning is informational.


'filename' : used #pragma pack to change alignment
Compiler Warning (level 1) C4103

'filename' : used #pragma pack to change alignment

The given include file used the pack pragma to change the default structure alignment.

This warning is informational.


'identifier' : near data in same_seg pragma; ignored
Compiler Warning (level 1) C4104

'identifier' : near data in same_seg pragma; ignored

The given near variable was specified in a same_seg pragma.

The same_seg pragma applies only to external far variables.

The identifier was ignored.


'identifier' : code modifiers only on function or pointer to function
Compiler Warning (level 1) C4105

'identifier' : code modifiers only on function or pointer to function

The given identifier was declared with a code modifier that can be used only with a function or function pointer.

The code modifier was ignored.


pragma requires an integer between 1 and 127
Compiler Warning (level 1) C4106

pragma requires an integer between 1 and 127

An integer constant between 1 and 127 must be specified with the page and skip pragmas.

The compiler assumed a value of 1.

The following example generates this warning:

#pragma skip( 0 )


pragma requires an integer between 15 and 255
Compiler Warning (level 1) C4107

pragma requires an integer between 15 and 255

An integer constant between 15 and 255 must be specified with the pagesize pragma.

The compiler assumed a value of 63.

The following example generates this warning:

#pragma pagesize( 10 )


pragma requires an integer between 79 and 132
Compiler Warning (level 1) C4108

pragma requires an integer between 79 and 132

An integer constant between 79 and 132 must be specified with the linesize pragma.

The compiler assumed a value of 79.

The following example generates this warning:

#pragma linesize( 42 )


unexpected identifier 'identifier'
Compiler Warning (level 1) C4109

unexpected identifier 'identifier'

The pragma contained an unexpected token.

The pragma was ignored.

The following example generates this warning:

#pragma optimize( on, off )


unexpected token 'number'
Compiler Warning (level 1) C4110

unexpected token 'number'

The pragma contained an unexpected integer constant.

The pragma was ignored.

The following example generates this warning:

#pragma title( 1984 )


unexpected token 'string'
Compiler Warning (level 1) C4111

unexpected token 'string'

The pragma contained an unexpected string.

The pragma was ignored.

The following example generates this warning:

#pragma linesize( "92" )


#line requires an integer between 1 and 32767
Compiler Warning (levels 1 and 4) C4112

#line requires an integer between 1 and 32767

The #line directive specified an integer outside the permitted range.

If the given line number is less than 1, the line counter is reset to 1. If the given line number is greater than 32767, it is used as is.

This is a level 1 warning under the /Za ANSI-compatibility command- line option and a level 4 warning with the default /Ze Microsoft extensions.


'identifier1' differs in parameter lists from 'identifier2'
Compiler Warning (level 1) C4113

'identifier1' differs in parameter lists from 'identifier2'

A function pointer was assigned to another function pointer, but the formal parameter lists of the functions do not agree.

The assignment was compiled without modification.


same type qualifier used more than once
Compiler Warning (level 1) C4114

same type qualifier used more than once

A type qualifier (const, volatile, signed, or unsigned) was used more than once in the same type declaration or definition.

The second occurrence of the qualifier was ignored. This is a warning when Microsoft extensions are enabled (/Ze) and an error when extensions are disabled (/Za).

The following is an example of this warning:

volatile volatile int i;   // warning


'type' : named type definition in parentheses
Compiler Warning (levels 1 and 3) C4115

'type' : named type definition in parentheses

The given symbol was used to define a structure, union, or enumerated type inside a parenthetical expression. The scope of this definition may be unexpected.

In a C function call, the definition has global scope. In a C++ function call, the definition has the same scope as the function being called.

This warning can also be caused by declarators within parentheses (such as prototypes) that are not parenthetical expressions.

This is a level 1 warning with C++ programs or under the /Za ANSI- compatibility command-line option.  It is level 3 otherwise.

The following example causes this warning:

void func(struct S *);  /* warning */

This warning can be avoided by declaring or defining the structure outside of the parentheses before the line that caused this warning, as in:

struct S;
void func(struct S *);

or:

struct S
{
   int mem;
};
void func(struct S *);


unnamed type definition in parentheses
Compiler Warning (level 1) C4116

unnamed type definition in parentheses

A structure, union, or enumerated type with no name was defined in a parenthetical expression. The type definition is meaningless.

In a C function call, the definition has global scope. In a C++ function call, the definition has the same scope as the function being called.


macro name 'name' is reserved; 'command' ignored
Compiler Warning (level 1) C4117

macro name 'name' is reserved; 'command' ignored

The given command attempted to define or undefine the predefined macro name or the preprocessor operator defined.

The given command is displayed in the warning message as either #define or #undef, even if the attempt was made using command-line options.

The command was ignored.


pragma not supported during fast compile
Compiler Warning (levels 1 and 3) C4118

pragma not supported during fast compile

The pragma is not supported by the fast compiler. The pragma was ignored.

To avoid this warning when using the fast compiler, disable the pragma using #ifdef _FAST.

This is a level 1 warning, except with #pragma comment(), which causes a level 3 warning.


'symbol' : alignment of a member was sensitive to packing
Compiler Warning (level 4) C4121

'symbol' : alignment of a member was sensitive to packing

The given symbol was aligned to the current packing alignment.

The default alignment of structures can be specified with the pack pragma or the /Zp command-line option.


'function' : alloc_text applicable only to functions with C linkage
Compiler Warning (level 1) C4122

'function' : alloc_text applicable only to functions with C linkage

The alloc_text pragma can be applied only to functions declared with extern c. This pragma cannot be used with external C++ functions.

The alloc_text pragma was ignored.


__fastcall with stack checking is inefficient
Compiler Warning (level 1) C4124

__fastcall with stack checking is inefficient

The __fastcall keyword was used when stack checking was enabled.

The __fastcall calling convention is used for generating faster code, but stack checking causes slower code to be generated. Use the /Gs option or the check_stack pragma to turn off stack checking when using __fastcall.

This warning is informational and is issued only for the first function declared under these conditions.


decimal digit terminates octal escape sequence
Compiler Warning (level 4) C4125

decimal digit terminates octal escape sequence

An octal escape sequence in a character or string constant was terminated by a decimal digit.

The compiler evaluated the octal number without the decimal digit and assumed the decimal digit was a character.

The following example generates this warning:

char array1[] = "\\709";

If the digit 9 was intended as a character and was not a typing error, correct the example as follows:

char array[] = "\\0709";  /* String containing "89" */


'option' : unknown memory-model command-line option
Compiler Warning (level 1) C4126

'option' : unknown memory-model command-line option

The character or characters used with the /A option was not recognized as a valid memory-model specifier.

The option was ignored.


conditional expression is constant
Compiler Warning (level 4) C4127

conditional expression is constant

The controlling expression of an if statement or while loop evaluated to a constant.

As a result, the code in the body of the if statement or while loop either always executes or never executes.

This warning is informational.


storage-class specifier after type
Compiler Warning (level 4) C4128

storage-class specifier after type

A storage-class specifier (auto, extern, register, or static) appears after a type specifier in a declaration. The compiler assumed the storage-class specifier occurred before the type specifier.

New-style code places the storage-class specifier first.


'character' : unrecognized character escape sequence
Compiler Warning (level 1) C4129

'character' : unrecognized character escape sequence

The character following a backslash (\) in a character or string constant was not recognized as a valid escape sequence.

As a result, the backslash is ignored and not printed, and the character following the backslash is printed.

To print a single backslash, specify a double backslash (\\).


'operator ' : logical operation on address of string constant
Compiler Warning (level 4) C4130

'operator ' : logical operation on address of string constant

The operator was used with the address of a string literal. Unexpected code was generated.

For example, the following code generates this warning:

char *pc;
pc = "Hello";
if (pc == "Hello")
   { }

The if statement compares the value stored in the pointer pc to the address of the string "Hello", which is allocated separately each time the string occurs in the code. The if statement does not compare the string pointed to by pc with the string "Hello".

To compare strings, use the strcmp function.


'function' : uses old-style declarator
Compiler Warning (level 4) C4131

'function' : uses old-style declarator

The specified function declaration is not in prototype form.

Old-style function declarations should be converted to prototype form.

An example of an old-style declaration is:

 int addrec( name, id )
 char *name;
 int id;
 { }

The new-style prototype form is:

 int addrec( char *name, int id )
 { }


'object' : const object should be initialized
Compiler Warning (level 4) C4132

'object' : const object should be initialized

The constant was not initialized.

Since the value of a symbol with the const attribute cannot be changed after its definition, it should be given an initialization value.

It will not be possible to assign a value to object.


'type' : incompatible types - from 'type1' to 'type2'
Compiler Warning (level 3) C4133

'type' : incompatible types - from 'type1' to 'type2'

An attempt was made to subtract two pointers of different types.

This warning can be avoided by providing the appropriate type cast.


conversion between pointers to members of same class
Compiler Warning (level 4) C4134

conversion between pointers to members of same class

A pointer to one member of a class was converted to a pointer to another member of the class. This is necessary because void pointers to members are not allowed.

This warning is informational.


conversion between different integral types
Compiler Warning (level 3) C4135

conversion between different integral types

Information was lost between two integral types.

This warning can be avoided by providing the appropriate type cast.

For example, the following code generates this warning:

int intvar;
long longvar;
intvar = longvar;  // warning

This warning can be caused by implicit conversion. In the following example a and b are promoted to type int on the third line, and then the sum (also of type int) is assigned to a short.

short a = 1;
short b = 2;
short c = a + b;   // warning


conversion between different floating-point types
Compiler Warning (level 3) C4136

conversion between different floating-point types

Information was lost or truncated in the conversion between two floating-point types.

For example, the following code generates this warning:

double doublevar;
float floatvar;
floatvar = doublevar;

Note that unsuffixed floating-point constants have type double, so the following code generates this warning:

floatvar = 1.0;

If the floating-point constant should be treated as type float, use the F (or f) suffix on the constant to prevent the warning:

floatvar = 1.0F;


'function' : no return value from floating-point function
Compiler Warning (level 1) C4137

'function' : no return value from floating-point function

The given function had no return statement.

A long double function returns its value on the floating-point stack or the emulation stack. If the function does not return a value, a run-time floating-point stack underflow error may occur.

Make sure that all floating-point functions return a floating-point value.


'*/' found outside of comment
Compiler Warning (level 1) C4138

'*/' found outside of comment

The compiler found a closing comment delimiter (*/) without a preceding opening delimiter. The compiler assumed a space between the asterisk (*) and the forward slash (/).

The following example generates this warning:

int */*comment*/ptr;

In this example, the first comment delimiter is ambiguous.

Usually, the cause of this warning is an attempt to nest comments.

To comment out sections of code that may contain comments, enclose the code in an #if/#endif block and set the controlling expression to zero, as in:

#if 0
int my_variable;   /* Declaration currently not needed */
#endif


'hexnumber' : hex escape sequence is out of range
Compiler Warning (level 1) C4139

'hexnumber' : hex escape sequence is out of range

A hexadecimal escape sequence appearing in a character or string constant was too large to be converted to a character.

If the hexadecimal escape sequence is in a string constant, the compiler casts the low byte of the hexadecimal number to a char. If in a char constant, the compiler made the cast and then sign extended the result. If in a char constant and the program was compiled with the /J command-line option, the compiler cast the value to an unsigned char.

Note that the following code generates this warning:

printf("\x7Bell\n");

The compiler reads the characters "7Be" as a legal hexadecimal number, but it is too large to fit in a character. To correct this example, use three hexadecimal digits:

printf("\007Bell\n");


'modifier' : used more than once
Compiler Warning (level 1) C4141

'modifier' : used more than once

The specified modifier was repeated in statement.

The following example causes this warning:

inline inline void func ();   // warning


benign redefinition of type
Compiler Warning (level 1) C4142

benign redefinition of type

A type was redefined, but the redefinition had no effect on the code generated.

This warning commonly occurs in these cases:

The return type of a member function of a derived class differed from the return type of the corresponding overridden member function.

A type defined with the typedef command is redefined using different syntax.  For example, the following code causes this warning when generating 16-bit code:

  typedef   unsigned int WORD;
  typedef   unsigned short WORD;

This warning is informational.


'expression' : relational expression as switch expression
Compiler Warning (level 1) C4144

'expression' : relational expression as switch expression

The given relational expression was used as the control expression of a switch statement. The associated case statements will be offered boolean values.

This warning is informational.


'expression1' : relational expression as switch expression; possible confusion with 'expression2'
Compiler Warning (level 1) C4145

'expression1' : relational expression as switch expression; possible confusion with 'expression2'

The given relational expression expression1 was used as the control expression of a switch statement. The associated case statements will be offered boolean values.

The given expression expression2 is a suggested case expression.

This warning is informational.


unary minus operator applied to unsigned type, result still unsigned
Compiler Warning (level 3) C4146

unary minus operator applied to unsigned type, result still unsigned

The variable should be cast to a signed type if it must contain a signed value. Its type is still unsigned.

The following example causes this warning:

void func()
{
   unsigned int ui;
   -ui;              // warning
}


'identifier' : 'modifier' ignored on pointer and reference declarations
Compiler Warning (level 1) C4147

'identifier' : 'modifier' ignored on pointer and reference declarations

The given pointer or reference declaration specified a modifier that has no effect. The modifier was ignored.

The __loadds, __saveregs, and __export modifiers affect the code generated within a function but do not affect the code generated to call a function.


deletion of pointer to incomplete type 'type'; no destructor called
Compiler Warning (level 2) C4150

deletion of pointer to incomplete type 'type'; no destructor called

The delete operator was called to delete the given type, which was declared but not defined. The compiler was unable to find any destructors for the given type.

Make sure that the class, structure, or union is defined before using the delete operator.

The following example generates this warning:

class  IncClass;
void   NoDestruct( IncClass* pIncClass )
  {   delete pIncClass;   }


non standard extension, function/data ptr conversion in expression
Compiler Warning (level 4) C4152

non standard extension, function/data ptr conversion in expression

A pointer to a function was converted to a pointer to data, or visa versa.

This conversion is allowed when the Microsoft extensions (/Ze) are enabled. However, ANSI C does not allow this conversion.


function/data pointer conversion in expression
Compiler Warning (level 1) C4153

function/data pointer conversion in expression

A pointer to a function was converted to a pointer to data, or visa versa.

This conversion is not legal in ANSI C.

This conversion is allowed when the Microsoft extensions (/Ze) are enabled, and causes a level 4 warning.


deletion of an array expression; conversion to pointer supplied
Compiler Warning (level 1) C4154

deletion of an array expression; conversion to pointer supplied

Use of 'delete' on an array is undefined.

The array was converted to a pointer, as in:

char A[]

would be converted to:

char A*

The following example causes this warning:

void func()
{
   int array[ 10 ];
   delete array;       // warning
}


deletion of an array expression without using the array form of 'delete'
Compiler Warning (level 1) C4155

deletion of an array expression without using the array form of 'delete'

Deletion of an array by the non-array form of 'delete' is undefined.

This warning is generated only when the /Za ANSI-compatibility switch is enabled.

The following example causes this warning:

T (*array)[ 10 ] = new T[ 5 ][ 10 ];
delete array;                         // warning


deletion of an array expression without using the array form of 'delete'; array form substituted
Compiler Warning (level 2) C4156

deletion of an array expression without using the array form of 'delete'; array form substituted

Deletion of an array by the non-array form of 'delete' is undefined. The compiler used translated the expression to use the array form of 'delete'.

This warning is generated only when the Microsoft extensions (/Ze) are enabled.

T (*array)[ 10 ] = new T[ 5 ][ 10 ];
delete array;     // warning, changed by compiler to "delete [] array;"


pragma was ignored by C compiler
Compiler Warning (level 1) C4157

pragma was ignored by C compiler

The init_seg() pragma is used by the C++ compiler only.


assuming #pragma pointers_to_members(full_generality, inheritance_inheritance)
Compiler Warning (level 1) C4158

assuming #pragma pointers_to_members(full_generality, inheritance_inheritance)

A #pragma pointers_to_members(single|multiple|virtual) was issued without an accompanying #pragma pointers_to_members(full_generality).


no function with C linkage found
Compiler Warning (level 1) C4162

'identifier' : no function with C linkage found

The specified function with C linkage was declared but could not be found.


'identifier' : not available as an intrinsic function
Compiler Warning (level 1) C4163

'identifier' : not available as an intrinsic function

The specified function cannot be used as an instrinsic function.


'identifier' : intrinsic function not declared
Compiler Warning (level 1) C4164

'identifier' : intrinsic function not declared

The specified intrinsic function was not declared.


convention function cannot take a variable number of arguments
Compiler Warning (level 1) C4165

convention function cannot take a variable number of arguments

A function with the specifed calling convention cannot be used with a variable number of arguments.


function : available only as an intrinsic function
Compiler Warning (level 1) C4167

function : available only as an intrinsic function

The specified function can only used in its intrinsic form. The directive to create a function call was ignored.

The following example causes this warning:

#include <malloc.h>
#pragma function(_alloca )   // warning: _alloca() is instrinsic only
void main(){}


nonstandard extension used : zero-sized array in struct/union
Compiler Warning (levels 2 and 4) C4200

nonstandard extension used : zero-sized array in struct/union

A structure or union contained an array with zero size.

This is a level 4 warning when Microsoft extensions are enabled (/Ze) and a level 2 warning when Microsoft extensions are disabled (/Za).

The following is an example of this error:

struct S { int a[0]; };  // warning


nonstandard extension used : nameless struct/union
Compiler Warning (level 4) C4201

nonstandard extension used : nameless struct/union

Microsoft C/C++ allows structure declarations to be specified without a declarator when they are members of another structure or union.

The following is an example of this error:

struct S
{
   float y;
   struct
   {
      int a, b, c;  // warning
   };
} *p_s;

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : '...': prototype parameter in name list illegal
Compiler Warning (level 4) C4202

nonstandard extension used : '...': prototype parameter in name list illegal

The function definition contains variable arguments, but used old-style function definiton format.

The following is an example of this error:

void func( a, b, ...)
int	a, b;  // warning
{}

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : union with static member variable
Compiler Warning (level 1) C4203

nonstandard extension used : union with static member variable

Microsoft C++ allows C++ programs to contain static member variables in a union. This condition will not generate a warning in C programs.

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : non-constant aggregate initializer
Compiler Warning (level 1) C4204

nonstandard extension used : non-constant aggregate initializer

Microsoft C++ allows you to initialize aggregate types (arrays, structures, unions, and classes) with values that are not constants.

The following is an example of this error:

int func1();
struct S1{ int i; };
S1 struct1 = { func1() };  // warning

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : static function declaration in function scope
Compiler Warning (level 1) C4205

nonstandard extension used : static function declaration in function scope

Microsoft C/C++ allows static functions to be declared inside another function. the function is given global scope.

The following is an example of this error:

void func1()
{
   static int func2();  // warning
};

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : translation unit is empty
Compiler Warning (level 4) C4206

nonstandard extension used : translation unit is empty

The file was empty after preprocessing.

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : extended initializer form
Compiler Warning (level 4) C4207

nonstandard extension used : extended initializer form

Microsoft C/C++ allows you to initialize an unsized array of char using a string within braces.

The following is an example of this error:

char c[] = { 'a', 'b', "cdefg" };

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : delete [exp] - exp evaluated but ignored
Compiler Warning (level 4) C4208

nonstandard extension used : delete [exp] - exp evaluated but ignored

Microsoft C++ allows you to give a value within brackets when deleting an array with the delete operator. The value in brackets is ignored.

delete [18] MyArray;  // warning
delete [] MyArray;    // OK

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : benign typedef redefinition
Compiler Warning (level 4) C4209

nonstandard extension used : benign typedef redefinition

A type was redefined to be the same type as in the first definition.

The following is an example of this error:

typedef long lPulseWidth;
typedef long lPulseWidth;  // warning

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : function given file scope
Compiler Warning (level 4) C4210

nonstandard extension used : function given file scope

Under the default /Ze command-line option, Microsoft C/C++ gives function declarations file scope.

void func1()
{
    extern int func2( double );
}

void main( void )
{
    func2( 4 );    //  /Ze passes 4 as type double
}                  //  /Za passes 4 as type int

This extension can prevent your code from being portable to other compilers.


nonstandard extension used : redefined extern to static
Compiler Warning (level 4) C4211

nonstandard extension used : redefined extern to static

Microsoft C/C++ allows redefinition of an extern identifier as static.

The following is an example of this error:

extern int i;
static int i;  // warning

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : function declaration used ellipsis
Compiler Warning (level 4) C4212

nonstandard extension used : function declaration used ellipsis

The function prototype had variable arguments, but the function definition did not.

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : cast on l-value
Compiler Warning (level 4) C4213

nonstandard extension used : cast on l-value

Microsoft C/C++ allows casts to be used on the left-hand side of an assignment statement.

The following is an example of this error:

void *a;
void f()
{
   int	i[3];
   a = &i;
   *(( int * )a )++ = 3;  // warning
}

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : bit field types other than int
Compiler Warning (level 4) C4214

nonstandard extension used : bit field types other than int

Microsoft C/C++ allows bitfield structure members to be of any integral type.

The following is an example of this error:

struct bitfields
{
   unsigned short j:4;  // warning
};

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : long float
Compiler Warning (level 1) C4215

nonstandard extension used : long float

Microsoft C/C++ treats long float as double. Use double to maintain compatibility.

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : float long
Compiler Warning (level 1) C4216

nonstandard extension used : float long

Microsoft C/C++ treats float long as double. Use double to maintain compatibility.

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : function declaration from a previous block
Compiler Warning (level 1) C4217

nonstandard extension used : function declaration from a previous block

If a function is not visible in the current scope, Microsoft C/C++ will find function declarations that would not otherwise be available.

The following example causes this warning:

void func1()
{
   void func2();
}
void func3()
{
   func2();   // warning
}

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : must specify at least a storage class or a type
Compiler Warning (level 1) C4218

nonstandard extension used : must specify at least a storage class or a type

Microsoft C/C++ allows you to declare a variable without specifying a type or storage class. the default type is int.

The following example causes this warning:

i;  // warning

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : trailing ',' used for variable argument list
Compiler Warning (level 1) C4219

nonstandard extension used : trailing ',' used for variable argument list

A variable argument list ended with a comma but no ellipsis.

The following example causes this warning:

int func1( int first, );       // warning
int func2( int first, ... );   // OK


varargs matches remaining parameters
Compiler Warning (level 4) C4220

varargs matches remaining parameters

There was an attempt to compare pointers to functions that had similar parameters, but with one having variable arguments.

The following example causes this warning:

int ( *pFunc1) ( int a, ... );
int ( *pFunc2) ( int a, int b);
if ( pFunc1 != pFunc2 ) {};  // warning

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : 'identifier' : cannot be initialized using address of automatic variable
Compiler Warning (level 4) C4221

nonstandard extension used : 'identifier' : cannot be initialized using address of automatic variable

4221    "nonstandard extension used : '%Fs' : cannot be initialized using address of automatic variable '%Fs'"

4222    "nonstandard extension used : '%Fs' : 'static' should not be used on member functions defined at file scope"

Microsoft C/C++ allows you to initialize an aggregate type (array, struct, or union) with the address of a local (automatic) variable.

The following example causes this warning:

struct S
{
   int *i;
};
void func()
{
   int j;
   struct S s1 = { &j };  // warning
}

This extension can prevent your code from being portable to other compilers and will generate an error under the /Za command-line option.


nonstandard extension used : 'identifier' : cannot be initialized used on member functions defined at file scope
Compiler Warning (level 4) C4222

nonstandard extension used : 'identifier' : cannot be initialized used on member functions defined at file scope

A static member function was defined at file scope. Static member functions should be declared with external linkage.

This is a warning when Microsoft extensions are used (/Ze) and is an error when Microsoft extensions are disabled (/Za).

The following is an example of this error:

class C
{
   static void func();
};

static void C::func(){};    // warning


nonstandard extension used : formal parameter 'identifier' was previously defined as a type
Compiler Warning (level 1) C4224

nonstandard extension used : formal parameter 'identifier' was previously defined as a type


nonstandard extension used : left of '.identifier' must be an lvalue
Compiler Warning (level 1) C4225

nonstandard extension used : left of '.identifier' must be an lvalue


nonstandard extension used : 'keyword' is an obsolete keyword
Compiler Warning (level 1) C4226

nonstandard extension used : 'keyword' is an obsolete keyword

The specified keyword is used in this version of C++.


nonstandard extension used : 'identifier' : 'static' should not be used on member function defined at file scope
Compiler Warning (level 3) C4241

'member' : member access is restricted

There was an attempt to access a private or protected member function or data.

If the program needs to access this member, change the object access level or make the member a friend of the function that needs to be accessed.


'placeholder' cast conversion exists from 'type1' to 'type2', but is inaccessible
Compiler Warning (level 1) C4243

'conversion type' conversion exists from 'type1' to 'type2', but is inaccessible

A pointer to a derived class was converted to a pointer to a base class, but the derived class inherited the base class with private or protected access.

The following is an example of this warning:

class B {};
class D : private B {};

D d;
B *q = (B*)&d;;      // warning


'friend' specified for nonexistent function 'function'
Compiler Warning (level 1) C4245

'friend' specified for nonexistent function 'function'

A nonfunction was declared to be a friend. The compiler ignored the statement.

Make sure that the friend function is accessible within the current scope.


'member' not accessible because 'class1' uses 'access' to inherit from 'class2'
Compiler Warning (level 3) C4247

'member' not accessible because 'class1' uses 'access' to inherit from 'class2'

There was an attempt to access a member of a class that was inherited from another class with the private or protected attribute.

This is a warning instead of an error, because the access violation occurred due to a type cast.


'class1' : cannot access 'access' 'member' declared in class 'class2'
Compiler Warning (level 3) C4248

'class1' : cannot access 'access' 'member' declared in class 'class2'

The given member cannot be accessed from this class because it did not have access rights. The member was not accessed.

This warning can be avoided by giving class1 access to members of class2 by changing the class access specifier or using the friend specifier.


'class1' : no path to 'access' 'member' declared in virtual base 'class2'
Compiler Warning (level 3) C4249

'class1' : no path to 'access' 'member' declared in virtual base 'class2'

The given member of the virtual base class cannot be accessed from the derived class because it did not have access rights. The member was not accessed.

This warning can be avoided by giving class1 access to members of class2 by changing the class access specifier or using the friend specifier.


'class1' : inherits 'class2::member' via dominance
Compiler Warning (level 2) C4250

'class1' : inherits 'class2::member' via dominance

There were two or more members with the same name. The one in class2 was inherited since it was a base class for the other classes that contained this member.

This warning is for informational purposes only.


'identifier' : class 'type' needs to have dll-interface to export class 'type2'
Compiler Warning (level 1) C4251

'identifier' : class 'type' needs to have dll-interface to export class 'type2'

The specified base class was not declared with the __ export keyword.

A base class or structure must be declared with the __export keyword if a function in a derived class is to be exported.


no override, 'class1::function1' has 'model' 'this' memory model whereas 'class2::function2' has 'model 'this' memory model
Compiler Warning (level 1) C4260

no override, 'class1::function1' has 'model' 'this' memory model whereas 'class2::function2' has 'model 'this' memory model

The specified functions had different ambient memory models.

The Microsoft memory-model specifiers for function arguments and for the this pointer are used for disambiguation between overloaded functions.

The virtual mechanism will not be invoked for functions with differing ambient memory models.

The following example causes this warning:

struct X
{
   virtual void func() __near;
};
struct Y : X
{
   void func() __far;   // warning
};


no override, 'class1::function1' has 'model' calling convention whereas 'class2::function2' has 'model' calling convention
Compiler Warning (level 1) C4261

no override, 'class1::function1' has 'model' calling convention whereas 'class2::function2' has 'model' calling convention

The specified functions had different calling conventions.

The Microsoft calling convention specifiers are used for disambiguation between overloaded functions.

The virtual mechanism will not be invoked for functions with differing calling conventions.

The following example causes this warning:

struct X
{
   virtual void __near func();
};
struct Y : X
{
   void __far func();  // warning
};


nonstandard extension used: 'initializing: a non-const 'type1' must be initialized with an lvalue, not a function returning 'typ
Compiler Warning (level 1) C4270

nonstandard extension used: 'initializing': a non-const 'type1' must be initialized with an lvalue, not a function returning 'type2'

A non-const reference must be initialized with an lvalue, which makes the reference a name for that lvalue. A function call is only an lvalue if the return type of the function is a reference. A Microsoft extension to the C++ language allows any function call to be treated as an lvalue for the purpose of initializing references. If Microsoft extensions are disabled (/Za) then this an error.

This warning can be avoided by ensuring the reference is a const reference. However, if the reference is const and the function return type is not compatible with the type of the reference, the compiler will silently generate and initialize a temporary. Although this is not incorrect, it is inefficient and probably undesired.

The following example causes this warning:

struct X
{
   X(int);
   X(X&);
};
X f(X);
X b = f(X(2));   // warning

If you do not have access to source code to fix this problem you can disable this warning using the following pragma:

#pragma warning(4270:disable)


'identifier' : 'naked' functions cannot be 'inline'; inline expansion not performed
Compiler Warning (level 1) C4271

'identifier' : 'naked' functions cannot be 'inline'; inline expansion not performed

The specified function was declared with both the naked and inline attributes.

The following example causes this warning.

inline __declspec( naked )  int func() {}   // warning


'identifier' : inconsistent dll linkage.  dllexport assumed
Compiler Warning (level 1) C4273

'identifier' : inconsistent dll linkage.  dllexport assumed

The specified member function was declared in a class with dllexport linkage, and then was imported. This warning can also be caused by declaring a member function in a class with dllimport linkage as neither imported nor static nor inline.

The function was compiled as dllexport.


non dll-interface classkey 'identifier' used as base for dll-interface classkey 'identifier'
Compiler Warning (level 2) C4275

non dll-interface classkey 'identifier' used as base for dll-interface classkey 'identifier'

An exported class was derived from a class that was not exported.


conversion of pointer to nonintegral type
Compiler Warning (level 1) C4300

conversion of pointer to nonintegral type

A pointer was cast to a nonintegral type (such as float).

The cast pointer address may no longer be valid.

This warning is generated by the following example:

   int     i = 24;
   printf( "Address: %f\\n", ( float ) &i );


'identifier' : simple type cast conversion of no expression
Compiler Warning (level 3) C4304

'identifier' : simple type cast conversion of no expression

An empty expression was cast to the specified type.

The following example causes this warning:

void func()
{
   int ();   // warning
}


'identifier' : truncation from 'type1' to 'type2'
Compiler Warning (level 1) C4305

'identifier' : truncation from 'type1' to 'type2'

The specified identifier type was converted to a smaller pointer type. Information was lost in the casting.


'identifier' : conversion from 'type1' to 'type2' of greater size
Compiler Warning (level 3) C4306

'identifier' : conversion from 'type1' to 'type2' of greater size

The specified identifier type was cast to a larger pointer. The unfilled high bits of the new type will be zero-filled.

This warning may indicate an unwanted conversion. The resulting pointer may not be valid.


'operator' : integral constant overflow; result truncated
Compiler Warning (level 2) C4307

'operator' : integral constant overflow

An expression using the specified operator resulted in an integral constant that overflowed the space allocated for it.

The value of the constant was truncated.

It may be necessary to use a larger type to hold the constant.

The following example causes this warning:

int i = 20000 + 20000;            // warning
int j = (unsigned)20000 + 20000;  // OK


negative integral constant converted to unsigned type
Compiler Warning (level 2) C4308

negative integral constant converted to unsigned type

An expression required that a negative integral constant be converted to an unsigned type.

The result of the expression is probably meaningless.

The following example causes this warning:

unsigned int i = 20000 + (-5);   // warning


'conversion' : truncation of constant value
Compiler Warning (level 2) C4309

'conversion' : truncation of constant value

The specified type conversion operation caused a constant to exceeded the space allocated for it.

It may be necessary to use a larger type to contain the constant.

The following example causes this warning:

char c = 128;                  // warning
char x = (char) 128;           // warning


cast truncates constant value
Compiler Warning (level 3) C4310

cast truncates constant value

A constant value was cast to a smaller type so that some information was lost.


'identifier' : signed value is out of range for enum constant
Compiler Warning (level 3) C4341

'identifier' : signed value is out of range for enum constant

A given enumerated constant exceeded the limit for an int. The value of the illegal constant is undefined.

Make sure that the given constants resolve to integers between -32,768 and +32,767 (signed) or 0 and +65,535 (unsigned).

The following example generates this warning:

enum ELEMENTS
{
   Hydrogen = 1,
   Helium,
   Lithium,
   Beryllium,
   Impossibillium = 500000
} ;


'reference' : initialization of reference member requires a temporary variable
Compiler Warning (level 1) C4354

'reference' : initialization of reference member requires a temporary variable

There was an attempt to initialize a member that was a reference. This condition causes an error under the default /Ze command-line option.

The compiler created a temporary stack variable to perform the initialization. Since the stack variable will be eliminated after the termination of the constructor, the pointer will be invalid.

This warning may be avoided by initializing the member instead of its reference.


'this' : used in base member initializer list
Compiler Warning (level 1) C4355

'this' : used in base member initializer list


'text' the 'identifier1' in base 'identifier2'
Compiler Warning (level 1) C4385

'text' the 'identifier1' in base 'identifier2'

An identifier on the line where this warning was caused cannot be distinguished from the identifier listed in this warning.

You only receive this warning when you have already received error C2385 about an ambiguity in your class hierarchy. This warning is used to provide additional information about why hierarchy is ambiguous.


'text' to the 'identifier1' in base 'identifier2'
Compiler Warning (level 1) C4386

'text' to the 'identifier1' in base 'identifier2'

An identifier on the line where this warning was caused cannot be unambiguously converted to the identifier listed in this warning.

You only receive this warning when you have already received error C2386 about an ambiguity in your class hierarchy. This warning is used to provide additional information about why hierarchy is ambiguous.


'%Fs' : was considered
Compiler Warning (level 1) C4387

'%Fs' : was considered

stub message.  for more info contact redwards (x66389)


'identifier' : member is bit field
Compiler Warning (level 1) C4401

'identifier' : member is bit field

An attempt was made to access the given bit-field member within inline assembler code.

The identifier is a bit field. A bit-field member cannot be accessed within inline assembler code. The last packing boundary before the bit-field member was used.

To avoid this warning, cast the bit field to an appropriate type before making the reference in inline assembler code.


must use PTR operator
Compiler Warning (level 1) C4402

must use PTR operator

A type was used on an operand without a PTR operator.

The compiler assumed the PTR operator.

The PTR operator is required when referring to or casting to a type in inline assembler code.


illegal PTR operator
Compiler Warning (level 1) C4403

illegal PTR operator

A PTR operator was used inappropriately in inline assembler code.

The compiler ignored the PTR operator.


period on directive ignored
Compiler Warning (level 3) C4404

period on directive ignored

The optional period preceding the directive was ignored.

This warning is informational.


'identifier' : identifier is reserved word
Compiler Warning (level 1) C4405

'identifier' : identifier is reserved word

A reserved word was used as the name of the identifier.

Use of the identifier in this way may cause unpredictable results.

This warning can be avoided by not using reserved words as idenitifiers.


operand on directive ignored
Compiler Warning (level 1) C4406

operand on directive ignored

The directive does not take any operands, but an operand was specified.

The compiler ignored the given operand or operands.


illegal instruction size
Compiler Warning (level 1) C4409

illegal instruction size

The instruction did not have a form with the specified size. The smallest legal size was used.

Make sure that the proper form of the instruction is being used.


illegal size for operand
Compiler Warning (level 1) C4410

illegal size for operand

One of the operands on the instruction had an incorrect size. The smallest legal size for the operand was used.

Make sure that an operand of the proper size is being used.


'identifier' : symbol resolves to displacement register
Compiler Warning (level 1) C4411

'identifier' : symbol resolves to displacement register

The identifier is a local symbol that resolves to a displacement register and therefore may be used on an operand with another symbol.

This warning is informational.


'function' : short jump to function converted to near
Compiler Warning (level 3) C4414

'function' : short jump to function converted to near

Short jumps generate a 1-byte instruction. The instruction includes a short offset that represents the distance between the jump and the function definition. The compiler must generate a special record for the jump, which requires the jmp instruction to be either NEAR or FAR, but not SHORT. The compiler made the conversion.

For example, the following code generates this warning:

main()
{
    _asm jmp SHORT main
}


'class' : class has private/protected data members; user-defined constructor advised
Compiler Warning (level 2) C4500

'class' : class has private/protected data members; user-defined constructor advised

The given class, structure, or union contains private or protected data. As this data is unavailable to many parts of the program, a user-defined constructor should be used.


'identifier' : use of '::' unnecessary here
Compiler Warning (level 1) C4501

'identifier' : use of '::' unnecessary here

The given identifier was local in scope, so the scope resolution operator (::) was not required.

The compiler ignored the optional scope resolution operator.


'linkage' requires use of keyword 'extern'
Compiler Warning (level 1) C4502

'linkage' requires use of keyword 'extern'

A linkage was specified without the extern keyword. Linkage is not relevant to non-extern types.

The compiler assumed the extern keyword.


type still ambiguous after parsing number tokens, assuming declaration
Compiler Warning (level 4) C4504

type still ambiguous after parsing 'number' tokens, assuming declaration

The compiler could not resolve the type after looking ahead in the code.

Simplify the code to make the statement clearer. This warning can often be eliminated by using an explicit type cast to an ambiguous expression.


'function' : unreferenced local function has been removed
Compiler Warning (level 4) C4505

'function' : unreferenced local function has been removed

The given function is local and not referenced in the body of the module; therefore, the function is dead code.

The compiler did not generate code for this dead function.


no definition for inline function 'function'
Compiler Warning (level 1) C4506

no definition for inline function 'function'

The given function was declared and marked for inlining but was not defined.

The compiler did not inline the function.

Make sure that external functions to be inlined are declared with the extern keyword.


explicit linkage specified after default linkage was used
Compiler Warning (level 4) C4507

explicit linkage specified after default linkage was used

After an identifier was declared with the default C++ linkage, it was explicitly declared as having C++ linkage.

The following code generates this warning:

void   WhereProhibited( void );
extern "C++" { void   WhereProhibited( void ); };  //warning


'function' : function should return a value; void return type assumed
Compiler Warning (level 1) C4508

'function' : function should return a value; void return type assumed

The given function did not specify a return type; the compiler assumed that the return type was void.

This warning can be avoided by declaring functions as void that do not return a value.


'class' : default constructor could not be generated
Compiler Warning (level 3) C4510

'class' : default constructor could not be generated

The compiler was unable to generate a default constructor for the given class. No constructor was created.

This warning can be caused by having a default constructor for the base class that is not accessible by the derived class. An inherited constructor from a base class with a different ambient memory model can also cause this warning.

This warning can be avoided by specifying a user-defined default constructor for the class.


'class' : copy constructor could not be generated
Compiler Warning (level 3) C4511

'class' : copy constructor could not be generated

The compiler was unable to generate a copy constructor for the given class. No constructor was created.

This warning can be caused by having a copy constructor for the base class that is not accessible by the derived class. An inherited copy constructor from a base class with a different ambient memory model can also cause this warning.

This warning can be avoided by specifying a user-defined copy constructor for the class.


'class' : assignment operator could not be generated
Compiler Warning (level 3) C4512

'class' : assignment operator could not be generated

The compiler was unable to generate a default constructor for the given class. No constructor was created.

This warning can be caused by having an assignment operator for the base class that is not accessible by the derived class. An inherited assignment operator from a base class with a different ambient memory model can also cause this warning.

This warning can be avoided by specifying a user-defined assignment operator for the class.


'class' : destructor could not be generated
Compiler Warning (level 3) C4513

'class' : destructor could not be generated

The compiler was unable to generate a default constructor for the given class. No constructor was created.

This warning can be caused by having an assignment operator for the base class that is not accessible by the derived class. An inherited assignment operator from a base class with a different ambient memory model can also cause this warning.

This warning can be avoided by specifying a user-defined destructor for the class.


'class' : multiple default constructors specified
Compiler Warning (level 3) C4520

'class' : multiple default constructors specified

There were multiple default constructors specified for the given class. The first constructor was used.

Make sure that there is only one default constructor defined for a distance.


'class' : multiple copy constructors specified
Compiler Warning (level 3) C4521

'class' : multiple copy constructors specified

There were multiple copy constructors of a single type specified for the given class. The first constructor was used.

Make sure that there is only one copy constructor defined for a type and distance.


'class' : multiple assignment operators specified
Compiler Warning (level 3) C4522

'class' : multiple assignment operators specified

There were multiple assignment operators of a single type specified for the given class. The first constructor was used.

Make sure that there is only one assignment operator defined for a type and distance.


'class' : multiple destructors specified
Compiler Warning (level 3) C4523

'class' : multiple destructors specified

There were multiple destructors specified for the given class. The first destructor was used.

Make sure that there is only one destructor defined for a distance.


'class' : redundant use of 'friend' on destructor
Compiler Warning (level 3) C4524

'class' : redundant use of 'friend' on destructor

The friend access specifier was given for a destructor. Since the destructor is automatically a member function of the given class, this specification is irrelevant.

The extraneous friend specifier was ignored.


'class' : redundant use of 'friend' on constructor
Compiler Warning (level 3) C4525

'class' : redundant use of 'friend' on constructor

The friend access specifier was given for a constructor. Since the constructor is automatically a member function of the given class, this specification is irrelevant.

The extraneous friend specifier was ignored.


instances of type 'class' can never be destroyed - user-defined destructor required
Compiler Warning (level 3) C4527

instances of type 'class' can never be destroyed - user-defined destructor required

The given derived class did not include a destructor, and the compiler could not generate one. The class cannot be destroyed.

This warning can be avoided by including a user-defined destructor for the given class.


object 'class' can never be instantiated - user-defined constructor required
Compiler Warning (level 1) C4610

object 'class' can never be instantiated - user-defined constructor required

The given class had neither user-defined nor default constructors; it cannot be instantiated. No instantiation was performed.

Make sure that all classes have valid user-defined or default constructors.


'_setjmp' does not support C++ object semantics
Compiler Warning (level 4) C4611

'_setjmp' does not support C++ object semantics

Destructors will not be invoked for local objects in frames jumped over due to a longjmp.


bad #pragma syntax, pragma ignored
Compiler Warning (level 1) C4612

bad #pragma syntax, pragma ignored

There was a syntax error in the warning pragma.

Make sure that all values and parentheses for this pragma are correct.


'segment' : class of segment cannot be changed
Compiler Warning (level 1) C4613

'segment' : class of segment cannot be changed

There was an attempt to create a segment with the same class name as a segment used by the compiler.

No new segment class was created.

This warning is generated only when compiling 32-bit programs.


#pragma warning : unknown user warning type
Compiler Warning (level 1) C4615

#pragma warning : unknown user warning type

An illegal warning type was used with the warning pragma.

Valid warning types are "1", "2", "3", "4", "default", "off", and "error".


#pragma warning : warning number 'number1' out of range, must be between 'number2' and 'number3'
Compiler Warning (level 1) C4616

#pragma warning : warning number 'number1' out of range, must be between 'number2' and 'number3'

The warning number that was specified in the warning pragma was not in the range of assignable warnings. Only warnings between number2 and number3 can be reassigned.

The pragma was ignored.


#pragma warning : invalid warning number
Compiler Warning (level 1) C4617

#pragma warning : invalid warning number

An illegal warning number was used with the warning pragma.

Make sure that the warning number that is supplied to the warning pragma corresponds to a valid warning.


no postfix form of 'operator ++' found for type 'type', using prefix form
Compiler Warning (level 1) C4620

no postfix form of 'operator ++' found for type 'type', using prefix form

There was no postfix incrememnt operator defined for the given type. The compiler used the overloaded prefix operator.

This warning can be avoided by defining a postfix ++ operator. This is done by creating a two-argument version of the ++ operator as shown below:

class prepost
{
public:
   prepost operator++ ()
   {
 // inline prefix routine
   };
   prepost operator++ ( int )
   {
 // inline postfix routine
   };
}


no postfix form of 'operator --' found for type 'type', using prefix form
Compiler Warning (level 1) C4621

no postfix form of 'operator --' found for type 'type', using prefix form

There was no postfix decrement operator defined for the given type. The compiler used the overloaded prefix operator.

This warning can be avoided by defining a postfix -- operator. This is done by creating a two-argument version of the -- operator as shown below:

class prepost
{
public:
   prepost operator-- ()
   {
 // inline prefix routine
   };
   prepost operator-- ( int )
   {
 // inline postfix routine
   };
}


Overwriting debug information formed during creation of the precompiled header in object file: 'file'
Compiler Warning (level 3) C4622

Overwriting debug information formed during creation of the precompiled header in object file: 'file'

CodeView information in the specified file was lost when it was compiled with the /Yu (use precompiled headers) option selected.

Rename the object file (using the /Fo switch) when creating or using the precompiled header file, and link using the new object file.


'symbol' : 'extern' storage class specifier illegal on member definition
Compiler Warning (level 1) C4630

'symbol' : 'extern' storage class specifier illegal on member definition

The given data member or member function was defined as external. Members cannot be declared as extern.

The compiler ignored the 'extern' keyword.

Only entire objects can be made external.


debugging information not in precompiled header; only global symbols from the header will be available
Compiler Warning (level 1) C4650

debugging information not in precompiled header; only global symbols from the header will be available

The precompiled header file was not compiled with Microsoft symbolic debugging information.

When linked, the resulting executable or dynamic-link library file will not include debugging information for local symbols contained in the precompiled header.

This warning can be avoided by recompiling the precompiled header file with the /Zi command-line option.


'definition' specified for precompiled header but not for current compile
Compiler Warning (level 1) C4651

'definition' specified for precompiled header but not for current compile

The given definition was specified when the precompiled header was generated, but not in this compilation.

The definition will be in effect inside the precompiled header, but not in the rest of the code.


command-line option 'option' inconsistent with precompiled header; PCH option ignored
Compiler Warning (level 1) C4652

command-line option 'option' inconsistent with precompiled header; PCH option ignored

The given command-line option differed from that given when the precompiled header (.PCH) was created. The option specified in the current command line was used.

This warning can be avoided by regenerating the precompiled header with the given command-line option.


Note: pre-compiled header usage information message
Compiler Warning (level 4) C4699

Note: pre-compiled header usage information message

This warning provides informational messages about the status of pre-compiled headers.


local variable 'identifier' used without having been initialized
Compiler Warning (level 1) C4700

local variable 'identifier' used without having been initialized

A reference was made to a local variable that had not been assigned a value. As a result, the value of the variable is undefined.

This warning is given when compiling with the /Og global optimization option.


local variable 'identifier' may be used without having been initialized
Compiler Warning (level 3) C4701

local variable 'identifier' may be used without having been initialized

A reference was made to a local variable that may not have been assigned a value. As a result, the value of the variable may be unpredictable.

This warning is given when compiling with the /Og global optimization option.


unreachable code
Compiler Warning (level 4) C4702

unreachable code

The flow of control can never reach the indicated line.

This warning is given only when compiling with one of the global optimization options (/Oe, /Og, or /Ol).


'function' : function too large for global optimizations
Compiler Warning (level 1) C4703

'function' : function too large for global optimizations

The named function was too large to fit in memory and be compiled with the selected optimization option. The compiler did not perform any global optimizations (/Oe, /Og, or /Ol). Other /Ox optimization options, such as /Oa and /Oi, are still performed.

One of the following may remove this warning:

Divide the function into two or more smaller functions.

Recompile with fewer optimizations.


'function' : inline assembler precludes global optimizations
Compiler Warning (level 3) C4704

'function' : inline assembler precludes global optimizations

The use of inline assembler in the named function prevented the specified global optimizations (/Oe, /Og, or /Ol) from being performed.


statement has no effect
Compiler Warning (level 4) C4705

statement has no effect

The indicated statement will have no effect on the program execution.

Each of these statements will generate this warning:

1;
a + 1;
b == c;


assignment within conditional expression
Compiler Warning (level 4) C4706

assignment within conditional expression

The test value in a conditional expression was the result of an assignment.

This warning is informational.

An assignment has a value (the value on the left side of the assignment) that can be used legally in another expression, including a test expression. However, the intention may have been to test a relation, not to make an assignment.

For example, the following line, which generates this warning, assigns b to a and compares the value of a with 0:

if ( a = b ) ...

However, the following line tests whether a and b are equal:

if ( a == b ) ...


comma operator within array index expression
Compiler Warning (level 4) C4709

comma operator within array index expression

The value used as an index into an array was the last one of multiple expressions separated by the comma operator.

An array index legally may be the value of the last expression in a series of expressions separated by the comma operator. However, the intent may have been to use the expressions to specify multiple indexes into a multidimensional array.

For example, the following line, which generates this warning, is legal in C and specifies the index c into array a:

a[b,c]

However, the following line uses both b and c as indexes into a two-dimensional array:

a[b][c]


'function' : function not expanded
Compiler Warning (level 4) C4710

'function' : function not expanded

The given function was selected for inline expansion, but the compiler did not perform the inlining.

Inlining is performed at the compiler's discretion. The inline keyword, like the register keyword, is used as a hint for the compiler.


function 'function' selected for inline expansion
Compiler Warning (level 1) C4711

function 'function' selected for inline expansion

The compiler performed inlining on the given function, although it was not marked for inlining by the user.

Inlining is performed at the compiler's discretion. This warning is informational.


'symbol' : used as register - loss of debugging information
Compiler Warning (level 2) C4712

'symbol' : used as register - loss of debugging information

The given symbol was based on another symbol that was converted to a register, thereby losing debugging information.

This warning can be avoided by not using the /Oe register- allocation command-line option.


internal compiler error: restartable
Compiler Warning (level 1) C4713

internal compiler error: restartable

This error is only emitted by the optimizing compiler when it detects a problem when generating code in Pass 2. In these cases the problem has been detected at a point which allows the compiler to restart the code generation process for the function where the error was detected. The compiler turns off optimizations for this function and regenerates the code. Note that optimizations are turned off only for the particular function, not for the entire module. The resulting code should be perfectly correct and safe, but is not optimized.

If you wish to maximize the optimization used in that function, you can determine which option is at fault by removing them one at a time and recompiling until the message goes away. Generally the last one removed is the problem and all other optimizations can be used safely. The most common culprits are /Oe, /Oi, /Ol, and /Oa. Once the offending optimization is discovered, it need not be turned off for the entire compilation. The offending optimization can be disabled with the optimize pragma while compiling the function where the error occurred, but enabled for the rest of the module.

More rarely, such errors occur at very low optimization levels or even when optimization is disabled. In such cases rewriting the line where the error is reported (or possibly several lines including the one causing the error) may be a solution. If all these fail, use the other code generator for this module (e.g., switch from using the optimizing code generator to using the fast code generator for this module). It is extremely rare that both code generators will fail in the same way. If none of these options works, contact Microsoft Product Support Services for help.

In all cases of internal compiler errors, restartable or not, we ask that you report the problem to Product Support, providing a test case and the options used. Also, please include the full text of the error message, including the module and line number of the compiler file which is given in the second line of the error message. This will allow us to find and fix the underlying problem for future versions of the compiler.


'initializing' : do not initialize a non-const 'type1' with a non-lvalue 'type2' function return
Compiler Warning (level 2) C4720

'initializing' : do not initialize a non-const 'type1' with a non-lvalue 'type2' function return

A non-const T& was initialized with the value of a function call which returns T. This is an error, because a function call is not an l-value (unless it returns a reference) and a non-const T& must be initialized with a T l-value. However when Microsoft extensions have been enabled (/Ze) Visual C++ renders this as a warning because the construction is harmless and because the construction occurs fairly frequently in existing code.

The can be eliminated by changing the reference being initialized to a const T&.

The following example causes this warning:

struct X {};
X f();
X&r = f();  // warning


potential divide by 0
Compiler Warning (level 3) C4723

potential divide by 0

The second operand in a divide operation evaluated to zero at compile time, giving undefined results.

The zero operand may have been generated by the compiler, as in the following example:

int    i, j, k = 42;
i /= ( j && k );


potential mod by 0
Compiler Warning (level 3) C4724

potential mod by 0

The second operand in a remainder operation evaluated to zero at compile time, giving undefined results.


'option' : unknown memory-model command-line option
Compiler Warning (level 1) C4726

'option' : unknown memory-model command-line option

The character (or characters) used with the /A option was not recognized as a valid memory-model specifier.

The option was ignored.


conditional expression is constant
Compiler Warning (level 4) C4727

conditional expression is constant

The controlling expression of an if statement or while loop evaluated to a constant.

As a result, the code in the body of the if statement or while loop either always executes or never executes.

This warning is informational.


/Oq option ignored for __fastcall function 'function'
Compiler Warning (level 1) C4741

/Oq option ignored for __fastcall function 'function'

The fastcall and saveregs calling conventions are not allowed for p-code functions. The function was compiled into native code.

This warning can be avoided by using a different calling convention or by turning p-code generation off during the definition of fastcall and saveregs functions, as in:

#pragma optimize( "q", off )    //Turn p-code on
int __fastcall FastFunc( void )
  {...};
#pragma optimize( "q" )       //Return to default p-code mode


overflow in constant arithmetic
Compiler Warning (level 2) C4756

overflow in constant arithmetic

The compiler generated an exception while doing constant arithmetic during compilation.

For example:

float fp_val = 1.0e100;

In this example, the floating-point constant 1.0e100 exceeds the maximum allowable value for a double-precision data item.


integral size mismatch in argument : conversion supplied
Compiler Warning (level 1) C4761

integral size mismatch in argument : conversion supplied

The base types of the actual and formal parameters of a function were different.

The compiler converted the actual parameter to the type of the formal parameter.


'function' : function too large for postoptimizer
Compiler Warning (level 2) C4763

'function' : function too large for postoptimizer

Not enough space was available to optimize the given function.

One of the following may be a solution:

Divide the function into two or more smaller functions.

Recompile with fewer optimizations.


recoverable heap overflow in postoptimizer
Compiler Warning (level 2) C4765

recoverable heap overflow in postoptimizer

The postoptimizing pass ran out of memory but was able to recover. Some optimization options may have been ignored.

One of the following may be a solution:

Divide the function into two or more smaller functions.

Recompile with fewer optimizations.


local symbol-table overflow
Compiler Warning (level 2) C4766

local symbol-table overflow

Since the listing generator ran out of heap space for local variables, the source listing may not contain symbol-table information for all local variables.

One of the following may be a solution:

Divide the function into two or more smaller functions.

Recompile with fewer optimizations.


scoping too deep; deepest scoping merged when debugging
Compiler Warning (level 1) C4773

scoping too deep; deepest scoping merged when debugging

Declarations appeared at a static nesting level greater than 16. As a result, all declarations beyond this level will seem to appear at the same level when being viewed by the debugger.


string too long - truncated to 255 characters
Compiler Warning (level 1) C4786

string too long - truncated to 255 characters

The string for a title or subtitle pragma exceeded the maximum allowable length and was truncated.


'identifier' identifier was truncated to 'number' characters
Compiler Warning (level 1) C4788

'identifier' identifier was truncated to 'number' characters

Only the first 31 characters of an identifier are significant in C. In C++, the first 247 characters (after name decoration) are significant. The characters after the limit were truncated.

This may mean that two identifiers that are different before truncation may have the same identifier name after truncation.


insufficient memory to process debugging information
Compiler Warning (level 2) C4790

insufficient memory to process debugging information

The program was compiled with the /Zi option, but not enough memory was available to create the required debugging information.

One of the following may be a solution:

Split the current file into two or more files and compile them separately.

Remove other programs or drivers running in the system that could be consuming significant amounts of memory.


loss of debugging information caused by optimization
Compiler Warning (level 2) C4791

loss of debugging information caused by optimization

Some optimizations, such as code motion, cause references to nested variables to be moved. The information about the level at which the variables are declared may be lost. As a result, all declarations will seem to be at nesting level 1.

This warning can be eliminated by turning off the optimization options for debugging purposes.


long double type not supported by alternate math library
Compiler Warning (level 1) C4792

long double type not supported by alternate math library

The long double numeric type is not supported by the /FPa alternate math emulation library. This can cause unresolved external errors from the linker.

This warning can be avoided by using another emulation library (such as /FPi) or by avoiding the long double type.

Ignore this warning if a special handler for the long double type is included in the link process.


C Run-Time Errors

Run-Time Errors

R6002	R6009	R6021
R6005	R6016	R6024
R6006	R6017	R6025
R6007	R6018
R6008	R6019


floating-point support not loaded
C Run-Time Error R6002

floating-point support not loaded

The program needs the floating-point library, but the library was not linked to the program.

One of the following may have occurred:

The program was compiled or linked with an option (such as /FPi87) that required a coprocessor, but the program was run on a machine that did not have a coprocessor installed.

A format string for a printf or scanf function contained a floating-point format specification, and the program did not contain any floating-point values or variables.

The compiler minimizes a program's size by loading floating-point support only when necessary. The compiler cannot detect floating-point format specifications in format strings, so it does not load the necessary floating-point routines.

Use a floating-point argument to correspond to the floating-point format specification, or perform a floating-point assignment elsewhere in the program. This causes floating-point support to be loaded.

In a mixed-language program, a C library was specified before a FORTRAN library when the program was linked. Relink and specify the C library last.


not enough memory on exec
C Run-Time Error R6005

not enough memory on exec

Not enough memory was available to load the process being spawned.

This error occurs when a child process that was spawned by one of the exec library routines fails and the operating system cannot return control to the parent process.


invalid format on exec
C Run-Time Error R6006

invalid format on exec

The file to be executed by one of the exec functions was not in the correct format for an executable file.

This error occurs when a child process that was spawned by one of the exec library routines fails and the operating system cannot return control to the parent process.


invalid environment on exec
C Run-Time Error R6007

invalid environment on exec

During a call to an exec function, the operating system found that the child process was given an invalid environment block.

This error occurs when a child process that was spawned by one of the exec library routines fails and the operating system cannot return control to the parent process.


not enough space for arguments
C Run-Time Error R6008

not enough space for arguments

There was enough memory to load the program but not enough memory to create the argv array.

One of the following may be a solution:

Increase the amount of memory available to the program.

Reduce the number and size of command-line arguments.

Reduce the environment size by removing unnecessary variables.


not enough space for environment
C Run-Time Error R6009

not enough space for environment

There was enough memory to load the program but not enough memory to create the envp array.

One of the following may be a solution:

Increase the amount of memory available to the program.

Reduce the number and size of command-line arguments.

Reduce the environment size by removing unnecessary variables.

If your program uses the compact, large, or huge memory model, this error may be avoided by using LINK's /CPARM:1 command-line option. This option causes unused near heap space to be allocated to the far heap.


not enough space for thread data
C Run-Time Error R6016

not enough space for thread data

The program did not receive enough memory from the operating system to complete a _beginthread call.

When a new thread is started, the library must create an internal database for the thread. If the database cannot be expanded with memory provided by the operating system, the thread will not begin and the calling process will stop.


unexpected multithread lock error
C Run-Time Error R6017

unexpected multithread lock error

The process received an unexpected error while trying to access a C run-time multithread lock on a system resource.

This error usually occurs if the process inadvertently alters the run-time heap data. However, it can also be caused by an internal error in the run-time or operating-system code.


unexpected heap error
C Run-Time Error R6018

unexpected heap error

The program encountered an unexpected error while performing a memory-management operation.

This error usually occurs if the program inadvertently alters the run-time heap data. However, it can also be caused by an internal error in the run-time or operating-system code.

If your compiler provides a library containing _heapchk and _heapwalk, you can use these functions to diagnose this error.


unable to open console device
C Run-Time Error R6019

unable to open console device

The program called a console function declared in CONIO.H, but the operating system did not grant access to the console.


no main procedure
C Run-Time Error R6021

no main procedure

The program does not have a procedure called main.

Make sure that all object and library modules have been linked into the executable.


not enough space for _onexit/atexit table
C Run-Time Error R6024

not enough space for _onexit/atexit table

There was no memory available for the _onexit or atexit function. This error is caused by a low memory condition.


pure virtual function call
C Run-Time Error R6025

pure virtual function call

No object has been instantiated to handle the pure virtual function call.


Command Line Errors

Errors

D2000	D2028	D4014
D2003	D2030	D4015
D2004	D2034	D4020
D2016	D2035	D4021
D2018	D2036	D4024
D2021	D4000	D4025
D2022	D4002	D4026
D2027	D4007


UNKNOWN COMMAND-LINE ERROR Contact Microsoft Product Support Services
Command-line error D2000

UNKNOWN COMMAND-LINE ERROR Contact Microsoft Product Support Services

Note the circumstances of the error, and notify Microsoft Corporation by following the instructions in the Technical Support help file or the Microsoft Product Assistance Request form at the back of one of your manuals.


missing source filename
Command-line error D2003

missing source filename

The command line did not specify a source file to compile.


'option1' and 'option2' command-line options are incompatible
Command-line error D2016

'option1' and 'option2' command-line options are incompatible

The given command-line options cannot be specified together.

For example, the following command line generates this error:

cl /Gw /NDxx program.c

In this example, the /Gw and /NDxx options are incompatible because each has a different special-entry sequence.

Check the CL or FL environment variable for option specifications.


cannot create linker response file
Command-line error D2018

cannot create linker response file

The compiler could not create a response file for passing arguments to the linker.

This error can occur when an existing read-only file has the same name as the filename the compiler gives to the response file.


invalid numeric argument 'number'
Command-line error D2021

invalid numeric argument 'number'

A number greater than 65,534 was specified as a numeric argument.


cannot open 'messagefile'
Command-line error D2022

cannot open 'messagefile'

The given file was not in the current directory or a directory specified in the PATH environment variable. The file contains a brief summary of compiler command-line syntax and options.

Move this file to the current directory or a directory in the current path. If this file cannot be found, run the SETUP program to copy it from the distribution disks.


cannot execute 'component'
Command-line error D2027

cannot execute 'component'

The compiler could not run the given compiler component or linker.

One of the following may have occurred:

Not enough memory was available to load the component. If this error occurred when NMAKE invoked the compiler, run the compiler outside of the makefile.

The current operating system could not run the component. Make sure that the path points to the executable files appropriate to your operating system.

The component was corrupted. Recopy the component from the distribution disks using the SETUP program.

An option was specified incorrectly. For example, the following CL command generates this error:

cl /B1 file1.c


too many open files; cannot redirect 'filename'
Command-line error D2028

too many open files; cannot redirect 'filename'

Redirection of one of the standard stream files was not possible because too many files were already open and a duplicate handle could not be created.


INTERNAL COMPILER ERROR in 'component' Contact Microsoft Product Support Services
Command-line error D2030

INTERNAL COMPILER ERROR in 'component' Contact Microsoft Product Support Services

Note the circumstances of the error, and notify Microsoft Corporation by following the instructions in the Technical Support help file.


error reading 'filename'
Command line error D2034

error reading 'filename'

The specified file was opened but could not be read.

This error may be caused by a hardware failure.


response files nested too deeply
Command line error D2035

response files nested too deeply

Move the directives in a nested response file into the calling response file.

This error can be caused by a recursively nested response file.


'/option' not allowed with multiple source files
Command line error D2036

'/option' not allowed with multiple source files

The following compiler options cannot be used with multiple source files:

Name assembly file listing (/Fa)

Rename object file (/Fo)

Create source browser information without local variables (/Fr)

Create source borwser information that includes local variables (/FR)


UNKNOWN COMMAND-LINE WARNING Contact Microsoft Product Support Services
Command-line warning D4000

UNKNOWN COMMAND-LINE WARNING Contact Microsoft Product Support Services

Note the circumstances of the warning and notify Microsoft Corporation by following the instructions in the Microsoft Product Assistance Request form at the back of one of your manuals.


ignoring unknown option 'option'
Command-line warning D4002

ignoring unknown option 'option'

The compiler did not recognize the given command-line option; the option was ignored.

Check the CL or FL environment variable for option specifications.


'option1' requires 'option2'; option ignored
Command-line warning D4007

'option1' requires 'option2'; option ignored

An option was specified without a required related option. The compiler ignored option1.

For example, the following command line generates this warning:

cl /C program.c

In this example, the /C option was given instead of /c. The /C option must be used with /E, /P, or /EP.

Check the CL or FL environment variable for option specifications.


nonstandard model; assuming large model
Command-line warning D4008

nonstandard model; assuming large model

A character other than M, L, or H was specified with FL's /A option. FL assumed /AL.


invalid value 'number1' for 'option'; assuming 'number2'
Command-line warning D4014

invalid value 'number1' for 'option'; assuming 'number2'

The given option was specified with an invalid numeric argument. The compiler assumed the value number2.

For example, the following command line generates this warning:

cl /Zp3 program.c

In this example, 3 is an invalid value. Valid arguments for the /Zp option are 1, 2, and 4.


invalid assembly listing configuration 'option'
Command-line warning D4015

invalid assembly listing configuration 'option'

The List Assembly option (/FA) can specify combined source and assembly code (/FAs) or combined source and machine code (/FAc). Other specifiers for the List Assembly option are invalid.


'option' : missing argument; option ignored
Command-line warning D4020

'option' : missing argument; option ignored

A command-line option required an argument, but nothing was specified. CL ignored the option.


no action performed
Command-line warning D4021

no action performed

A contradictory set of filenames and switches caused the compiler to perform no operation.

This warning can be generated by giving the /c compile-only command-line option and specifying no .C, .CPP, or .CXX files to compile.


unrecognized source file type 'filename', object file assumed
Command-line warning D4024

unrecognized source file type 'filename', object file assumed

The extension of the specified file was not recognized. The file was assumed to be an object file and was passed to the linker.

The following extensions are recognized:

.c	C source file

.cxx	C++ source file

.cpp	C++ source file

.obj	Object file

.lib	Library file

.def	Module definition file

.exp	Linker exports file (created by LINK -LIB).


overriding 'option1' with 'option2'
Command-line warning D4025

overriding 'option1' with 'option2'

The option2 was specified but was then overriden by option1. The option1 option was used.

If two options specify contradictory or incompatible directives, the directive specified or implied in the option farthest to the right on the command line is used.


options apply to entire command line
Command-line warning D4026

options apply to entire command line

An option was specified on a command after a filename was specified. The option was applied to the file that preceeded it.

For example, in the command

CL verdi.c /G5 puccini.c

the file verdi.c will be compiled using the /G5 option, not the /G4 default.

This behavior is different than for some previous versions that applied only the options specified before the filename, resulting in verdi.c being compiled using /G4 and puccini.c being compiled using /G5.


Run-Time Math Errors

Run-Time Errors

M6101	M6106	M6201
M6102	M6107	M6202
M6103	M6108	M6203
M6104	M6110	M6205
M6105	M6111


invalid
Math Error M6101

invalid

An invalid operation occurred. This error usually occurs when the operand is NAN (not a number) or infinity.

This error terminates the program with exit code 129.


denormal
Math Error M6102

denormal

A very small floating-point number was generated, which may no longer be valid because of a loss of significance. Denormal floating-point exceptions are usually masked, causing them to be trapped and operated upon.

This error terminates the program with exit code 130.


divide by 0
Math Error M6103

divide by 0

A floating-point operation attempted to divide by zero.

This error terminates the program with exit code 131.


overflow
Math Error M6104

overflow

An overflow occurred in a floating-point operation.

This error terminates the program with exit code 132.


underflow
Math Error M6105

underflow

An underflow occurred in a floating-point operation. Underflow floating-point exceptions are usually masked, causing the underflowing value to be replaced by 0.0.

This error terminates the program with exit code 133.


inexact
Math Error M6106

inexact

Loss of precision occurred in a floating-point operation. This exception is usually masked. Many floating-point operations cause a loss of precision.

This error terminates the program with exit code 134.


unemulated
Math Error M6107

unemulated

An attempt was made to execute a coprocessor instruction that is invalid or is not supported by the emulator.

This error terminates the program with exit code 135.


square root
Math Error M6108

square root

The operand in a square-root operation was negative.

This error terminates the program with exit code 136.

Note  The sqrt function in the C run-time library and the FORTRAN intrinsic function SQRT do not generate this error. The C sqrt function checks the argument before performing the operation and returns an error value if the operand is negative. The FORTRAN SQRT function generates the DOMAIN error M6201 instead of this error.


stack overflow
Math Error M6110

stack overflow

A floating-point expression caused a stack overflow on the 8087/287/387 coprocessor or the emulator.

Stack-overflow floating-point exceptions are trapped up to a limit of seven levels in addition to the eight levels usually supported by the 8087/287/387 coprocessor.

This error terminates the program with exit code 138.


stack underflow
Math Error M6111

stack underflow

A floating-point operation resulted in a stack underflow on the 8087/287/387 coprocessor or the emulator.

This error is often caused by a call to a long double function that does not return a value. For example, the following generates this error when compiled and run:

long double ld() {};
main ()
{
  ld();
}

This error terminates the program with exit code 139.


'function' : _DOMAIN error
Math Error M6201

'function' : _DOMAIN error

An argument to the given function was outside the domain of legal input values for that function.

For example, the following statements generate this error:

result = sqrt(-1.0)   // C statement
result = SQRT(-1.0)   !  FORTRAN statement

This error calls the _matherr function with the function name, its arguments, and the error type. You can rewrite the _matherr function to customize the handling of certain run-time floating- point math errors.


'function' : _SING error
Math Error M6202

'function' : _SING error

An argument to the given function was a singularity value for this function. The function is not defined for that argument.

For example, in FORTRAN the following statement generates this error:

result = LOG10(0.0)

This error calls the _matherr function with the function name, its arguments, and the error type. You can rewrite the _matherr function to customize the handling of certain run-time floating- point math errors.


'function' : _OVERFLOW error
Math Error M6203

'function' : _OVERFLOW error

The given function result was too large to be represented.

This error calls the _matherr function with the function name, its arguments, and the error type. You can rewrite the _matherr function to customize the handling of certain run-time floating- point math errors.


'function' : _TLOSS error
Math Error M6205

'function' : _TLOSS error

A total loss of significance (precision) occurred.

This error may be caused by giving a very large number as the operand of sin, cos, or tan because the operand must be reduced to a number between 0 and 2*pi.


Profiler Errors
32-Bit Source Profiler Errors

PRF1005		PRF1307		PRF1523		PRF4421
PRF1011		PRF1401		PRF1542		PRF4422
PRF1012		PRF1421		PRF1543		PRF4481
PRF1013		PRF1422		PRF1544		PRF4521
PRF1101		PRF1423		PRF1545		PRF4522
PRF1102		PRF1441		PRF1621		PRF4523
PRF1103		PRF1442		PRF1622		PRF4524
PRF1104		PRF1443		PRF1641		PRF4525
PRF1105		PRF1461		PRF1642		PRF4526
PRF1201		PRF1462		PRF1643		PRF4527
PRF1202		PRF1463		PRF2541		PRF4528
PRF1301		PRF1465		PRF2542		PRF4541
PRF1302		PRF1481		PRF4101		PRF4621
PRF1303		PRF1504		PRF4106		PRF4641
PRF1304		PRF1521		PRF4107		PRF4642
PRF1306		PRF1522		PRF4111


operating system ran out of memory
Profiler Error PRF1005

fatal error -- common -- operating system ran out of memory

There is not enough memory to run this profiler module.


cannot open file filename
Profiler Error PRF1011

fatal error -- common -- cannot open file filename

The profiler module could not find the specified file.


cannot read expected number of bytes from file filename
Profiler Error PRF1012

fatal error -- common -- cannot read expected number of bytes from file filename

The profiler module could not read the expected number of bytes.  Perhaps the file is corrupted.


cannot write expected number of bytes to file %s
Profiler Error PRF1013

fatal error -- common -- cannot write expected number of bytes to file filename

The profiler module could not write the expected number of bytes.  Perhaps the disk is full or the file is read-only.


missing option specifier
Profiler Error PRF1101

fatal error -- common -- missing option specifier

A / or - character was not followed by a command line option specifier sequence.  Check the command line.


option: invalid option
Profiler Error PRF1102

fatal error -- common -- option: invalid option

An invalid option was found on the command line.  Check the command line.


option option requires an additional parameter.
Profiler Error PRF1103

fatal error -- common -- option option requires an additional parameter.

This option was not followed by the correct number of parameters.  Check the command line.


option option requires a numeric parameter
Profiler Error PRF1104

fatal error -- common -- option  option requires a numeric parameter

A numeric parameter was expected for this option but was not found.  Check the command line.


option option specified more than number times
Profiler Error PRF1105

fatal error -- common -- option option specified more than number times

An option was specified too many times.  Check the command line.


missing filename after @
Profiler Error PRF1201

fatal error -- common -- missing filename after @

The @ character is supposed to be followed by a response filename.  Check the command line.


response files nested too deeply
Profiler Error PRF1202

fatal error -- common -- response files nested too deeply

Response files can be nested 8 deep.  Perhaps a response file calls itself recursively.


file filename has an incorrect (old) signature
Profiler Error PRF1301

fatal error -- common -- file filename has an incorrect (old) signature

A PBI, PBO, PBT, _XE, or _LL file does not contain the correct header bytes.  Perhaps the file is corrupted or was created by an old version of the profiler.


PBI file filename has an incorrect (old) version number
Profiler Error PRF1302

fatal error -- common -- PBI file filename  has an incorrect (old) version number

A PBI file does not contain the correct version number.  Perhaps the file is corrupted or was created by an old version of the profiler.


PBT file filename has an incorrect (old) version number
Profiler Error PRF1303

fatal error -- common -- PBT file filename  has an incorrect (old) version number

A PBT file does not contain the correct version number.  Perhaps the file is corrupted or was created by an old version of the profiler.


PBT or PBO file filename  conflicts with current profiling state
Profiler Error PRF1304

fatal error -- common -- PBT or PBO file filename  conflicts with current profiling state

There was an attempt to merge a PBT or a PBO file into another PBT file with a different profiling mode selected.


PBT or PBO file filename is not derived from same PBI file
Profiler Error PRF1306

fatal error -- common -- PBT or PBO file filename is not derived from same PBI file

The PBT, PBO, and PBI files are not properly synchronized.  Run Prep Phase I again.


CPU type of module module is different from initial one
Profiler Error PRF1307

fatal error -- common -- CPU type of module module is different from initial one

CPU types for different modules don't match.  All modules must be compiled for the same CPU type.


fillename: not a portable executable file
Profiler Error PRF1401

fatal error -- common -- filename: not a portable executable file

Function profiling only: the specified executable file is not a standard executable file for Windows NT.  Perhaps it is a 16-bit executable for Windows 3.x.


no input specified
Profiler Error PRF1421

fatal error -- PREP I -- no input specified

There were no input modules specified for PREP Phase I.  Check the command line.


syntax error in /EXC or /INC specification: specification
Profiler Error PRF1422

fatal error -- PREP I -- syntax error in /EXC or /INC specification: specification

The /EXC and /INC options require function names or file names.  This specification could not be decoded as either.  Check the command line.


number of modules exceeds number
Profiler Error PRF1423

fatal error -- PREP I -- number of modules exceeds number

The maximum number of modules has been exceeded.  Restructure the merge procedure to include more stages.


filename: not a valid Win32s executable file
Profiler Error PRF1441

fatal error -- PROFILE -- filename: not a valid Win32s executable file

Win32s only.  The Win32s extension could not load this file.  Perhaps the file is corrupted, has not been prepared for profiling, or is not a graphical user interface application.  If the file were a 16-bit executable, error message 1401 would be issued.


timestamp of executable has changed since PREP was run
Profiler Error PRF1442

fatal error -- PROFILE -- timestamp of executable has changed since PREP was run

The PBI file was created from an older EXE file.  This means that the processed executable file has changed since it was originally created by PREP Phase I.  Run PREP Phase I again.


cannot run program filename
Profiler Error PRF1443

fatal error -- PROFILE -- cannot run program filename

The profiler could not load the EXE file. Check that the original EXE file does run under Windows NT.


no PBT output file specified
Profiler Error PRF1461

fatal error -- PREP II -- no PBT output file specified

Neither the /OT nor /M options were specified.  Check the command line.


no PBT input file specified
Profiler Error PRF1462

fatal error -- PREP II -- no PBT input file specified

Neither the /IT  nor /M options were specified.  Check the command line.


module: different clock/sampling frequency
Profiler Error PRF1463

fatal error -- PREP II  -- module: different clock/sampling frequency

The sampling frequence for this module is different from that of other modules that were profiled.  Rerun PROFILE again for all modules, using the same sampling frequency.


CPU type in PBT or PBO file filename conflicts with current one
Profiler Error PRF1465

fatal error -- PREP II -- CPU type in PBT or PBO file filename conflicts with current one

Occurs only during PREP merging.  The CPU type does not match the CPU type used to generate the incoming PBT or PBO files.  All profiler steps must be run on the same type of computer.


option inconsistent with the sorting type
Profiler Error PRF1481

fatal error -- PLIST  -- option inconsistent with sorting type

The options for PLIST depend on the kind of profiling being done.  This error occurs if, for example, when the sort by name option is specified for a line profiling run.


illegal fixup address in mapfile filename
Profiler Error PRF1504

fatal error -- common -- illegal fixup address in mapfile filename

The mapfile lists all link-time fixups (including all the function call sites).  This error indicates that one of the fixups was illegal, perhaps because the mapfile was not generated by the same link as the corresponding EXE (or DLL).  This error is often preceded by the warning (PRF4528) about the EXE and mapfile timestamps being out of sync.


no functions were marked for profiling in module module
Profiler Error PRF1521

fatal error -- PREP I -- no functions were marked for profiling in module module

Function profiling only: at least one function must be included for profiling in each module.  Check the /INC, /EXC, and /EXCALL options on the command line.


more than one function matched entry specification: funcname1 and funcname2
Profiler Error PRF1522

fatal error -- PREP I -- more than one function matched entry specification: funcname1 and funcname2

Function profiling only: there were two or more functions with matching names.  Perhaps these are C++ overloaded functions.  Use decorated names to specify the functions.


filename is not profiled, and can not import modified version version
Profiler Error PRF1523

fatal error -- PREP I -- filename is not profiled, and can not import modified version version

For function level profiles, PREP uses modified EXEs and DLLs, with modified names with extensions _XE and _LL.  If any modules listed in the import table of a profiled module refer to another profiled module, but the imported module is itself not being profiled, then the import table of that imported module cannot be changed, and this error occurs. The solution is to include the offending module in the profile.


cannot set or delete environment variable var
Profiler Error PRF1542

fatal error -- PROFILE -- cannot set or delete environment variable var

Function profiling only: the specified environment variable was unavailable.


NtQueryIntervalProfile: NT internal error number occurred
Profiler Error PRF1543

fatal error -- PROFILE -- NtQueryIntervalProfile: NT internal error number occurred

A Windows NT error was detected.


NtSetIntervalProfile: NT internal error number occurred
Profiler Error PRF1544

fatal error -- PROFILE -- NtSetIntervalProfile: NT internal error number occurred

A Windows NT error was detected.


function sampling not supported under Win32S
Profiler Error PRF1545

fatal error -- PROFILE -- function sampling not supported under Win32S

Function sampling is supported under Windows NT only; it is not supported under Win32s.


no debugging information in file filename
Profiler Error PRF1621

fatal error -- PREP I -- no debugging information in file filename

Line profiling only: debugging information must be included in the executable file.  Run the compiler and linker again with the debugging options set.


no source lines marked for profiling in module module
Profiler Error PRF1622

fatal error -- PREP I -- no source lines marked for profiling in module module

Line profiling only: at least one line must be included for profiling in each module.  Check the /INC, /EXC, and /EXCALL options on the command line.


user-defined breakpoint found at address
Profiler Error PRF1641

fatal error -- PROFILE -- user-defined breakpoint found at address

Line profiling only: no breakpoints may be set in the executable modules being profiled.  These are not breakpoints set by the debugger but rather embedded INT 3 instructions.  This error is only fatal if the INT 3 instruction is encountered during the execution your program.


unexpected single-step exception occurred at address
Profiler Error PRF1642

fatal error -- PROFILE -- unexpected single-step exception occurred at address

Line profiling only: there was a problem with the executable file.  Try relinking and rerunning PREP Phase I.


an access violation occurred at address
Profiler Error PRF1643

fatal error -- PROFILE -- an access violation occurred at address

Line profiling only: there was a problem with the executable file.  Try relinking and rerunning PREP Phase I.  Check the EXE file with the debugger.


cannot start sampler
Profiler Error PRF2541

error -- PROFILE -- cannot start sampler

Function sampling is not possible.  Perhaps the executable program is larger than 640K.


cannot stop sampler
Profiler Error PRF2542

error -- PROFILE -- cannot stop sampler

Function sampling is not possible.  Perhaps the executable program is larger than 640K.


option option overrides an earlier option
Profiler Error PRF4101

warning -- common -- option option overrides an earlier option

Two or more mutually exclusive switches were specified, or the same switch was specified more than once.  The last switch takes precedence.


function/source/object/lib name was never matched
Profiler Error PRF4106

warning -- common -- function/source/object/lib name was never matched

The program element was not found.  Check to see if the name was spelled or decorated correctly.


/SF option not valid for line-level or sample profiles
Profiler Error PRF4107

warning -- common -- /SF option not valid for line-level or sample profiles

The start function option should be used only with function timing, function counting, or function coverage profiling.


no error file (/E) specified for /A option
Profiler Error PRF4111

warning -- common -- no error file (/E) specified for /A option

The /A option cannot be used without the /E option.  The /A option is ignored and the error output sent to stdout.


an offset duplication was detected
Profiler Error PRF4421

warning -- PREP I -- an offset duplication was detected

There appears to be a problem with the (codeview) line number debug information.  Perhaps there is an aliasing problem.


filename imports unknown module module
Profiler Error PRF4422

warning -- PREP I -- filename imports unknown module module

PREP searches for imported modules (mostly DLLs) in the following sequence:

- the directory PREP itself lives in

- the current directory

- the windows directories (I believe \nt\system32)

- directories on the path

Because the current directory depends on the profiler rather than the profiled program, all modules might not be found. In most cases, this warning is not serious.  However, if profiling leads to a GP-fault (or incorrect behavior), it might be necessary to include the "unknown module" in the profile.


clock frequency is zero
Profiler Error PRF4481

warning -- PLIST -- clock frequency is zero

Function sampling only: the clock frequency field in the PBT file has not been filled in yet, perhaps because the user has not done a profile yet, or has not merged his PBO file into his PBT file.  Running PREP /M should fix the problem.


INIT environment variable not defined
Profiler Error PRF4521

warning -- PREP I -- INIT environment variable not defined

PREP cannot find TOOLS.INI, which normally contains a list of standard excluded elements.


'publics' section not found in map file filename
Profiler Error PRF4522

warning -- PREP I -- 'publics' section not found in map file filename

The mapfile is corrupt.


'static symbols' section not found in mapfile filename
Profiler Error PRF4523

warning -- PREP I -- 'static symbols' section not found in mapfile filename

The mapfile is corrupt.


entry function function not found
Profiler Error PRF4524

warning -- PREP I -- entry function function not found

PREP could not find the specified start function (entry function) in the map file (see /SF switch).  Perhaps the function name is misspelled.


cannot profile function function in file filename
Profiler Error PRF4525

warning -- PREP I -- cannot profile function function in file filename

A special function such as _setjmp was specified.


module module already includes profiler DLL filename
Profiler Error PRF4526

warning -- PREP I -- module module already includes profiler DLL filename

The specified EXE or DLL already imports from PROFILER.dll.  Perhaps the EXE (or DLL) was PREPped with the /OM switch and then renamed the app._XE to app.EXE, then PREP was run again.  Make sure that the module (EXE or DLL) specified is the original module and a module modified by PREP.


preferred load address not found in mapfile filename, assumed address
Profiler Error PRF4527

warning -- PREP I -- preferred load address not found in mapfile filename; assumed address

Current versions of the linker list the preferred load address (that is, when the EXE gets loaded at this address none of the runtime relocation addresses need to be fixed up).  PREP needs this information.  Somehow this information was missing from the map file.  Assuming the latest linker was used, the map file was probably edited.  Regenerate the map file, retaining the line that states the preferred load address.


timestamps of mapfile filename and executable file do not match (warning)
Profiler Error PRF4528

warning -- PREP I -- timestamps of mapfile filename and executable file do not match

The mapfile is not properly synchroized with the executable file.  Relink and run PREP again.


module not found in PBI file filename
Profiler Error PRF4541

warning -- PROFILE -- module not found in PBI file filename

An attempt was made to profile a program, but the EXE was not PREPped.  This warning occurs while selectively profiling a DLL that is called by the EXE.


line number duplicated in file filename
Profiler Error PRF4621

warning -- PREP I -- line number duplicated in file filename

There is a problem with the line number debug information.  The same line number was identified with two different addresses.  This is generally not serious.


ReadProcessMemory: internal NT error number occurred
Profiler Error PRF4641

warning -- PROFILE -- ReadProcessMemory: internal NT error number occurred

An internal error occurred.  The profiler results are not to be trusted.


WriteProcessMemory: internal NT error number occurred
Profiler Error PRF4642

warning -- PROFILE -- WriteProcessMemory: internal NT error number occurred

An internal error occurred.  The profiler results are not to be trusted.


Resource Compiler Errors

Errors

RW1009	RW1023	RW2003
RW1016	RW1025	RW4001
RW1021	RW1030	RW4003
RW1022	RW2002	RW4004


Parsing Error
Resource Compiler Error RW2002

Parsing Error

The parsing error can be caused by any of following conditions:

Accelerator Type required (ASCII or VIRTKEY)

BEGIN expected in Accelerator Table

BEGIN expected in Dialog

BEGIN expected in menu

BEGIN expected in RCData

BEGIN keyword expected in String Table

Cannot Re-use String Constants

Control Character out of range [^A - ^Z]

Empty menus not allowed

END expected in Dialog

END expected in menu

Expected Comma in Accelerator Table

Expected control class name

Expected font face name

Expected ID value for Menuitem

Expected Menu String

Expected numeric command value

Expected numeric constant in string table

Expected numeric point size

Expected Numerical Dialog constant

Expected String in STRINGTABLE

Expected String or Constant Accelerator command

Expecting number for ID

Expecting quoted string in dialog class

Expecting quoted string in dialog title

File not found: filename

Font names must be ordinals

Invalid Accelerator

Invalid Accelerator Type (ASCII or VIRTKEY)

Invalid control character

Invalid Control type

Invalid Type

Text string or ordinal expected in Control

Mismatched Parentheses

Unexpected value in RCData

Unknown Menu SubType


Generation Error
Resource Compiler Error RW2003

Generation Error

General errors can be caused by any of following conditions:

Error: Bitmap file resource-file is not in 3.00 format

Error: Old DIB in resource-name. Pass it through SDKPAINT

Error: Resource file resouce-name is not in 3.00 format

Unknown DIB header format

Unable to initialize symbol information

Unable to save symbol information

Bitmap file resource file is not in 2.03 format

Resource too large

Resource file is not in 3.00 format

Unable to open temporary file


Output Error
Resource Compiler Fatal Error RW1030

Output Error

The output error can be caused by any of following conditions:

Errors occurred when linking file

.EXE file too large; relink with higher /ALIGN value

File not created by LINK

Invalid .EXE file

Not a Microsoft Windows format .EXE file

The EXETYPE of this program is not Windows

Unable to create destination

Unable to open


Error Creating resource-name
Resource Compiler Fatal Error RW1009

Error Creating resource-name

Could not create specified .RES file. Make sure it is not being created on a read-only drive. Use the -V option to find out whether the file is being created.


RC terminating after preprocessor errors
Resource Compiler Fatal Error RW1016

RC terminating after preprocessor errors

The Resource Compiler halted due to other errors. Fix the other errors and recompile.


Out of far heap memory
Resource Compiler Fatal Error RW1021

I/O error reading file

The Resource Compiler was not able to read a file. Check that the drive containing the file is available and that the file is valid.


I/O error reading file
Resource Compiler Fatal Error RW1022

I/O error writing file

The Resource Compiler could not write to a file.

This error may be caused by insufficient disk space. You must have free space equivalent to about twice the size of the executable file you are creating.

Other possible reasons for this error are:

writing to a read-only volume

writing to a bad sector

a sharing violation


I/O error writing file
Resource Compiler Fatal Error RW1023

I/O error writing file, drive full

The Resource Compiler could not write a file to a drive because the drive was full.

You must have free space equivalent to about twice the size of the executable file you are creating.


I/O error writing file, drive full
Resource Compiler Fatal Error RW1025

Out of far heap memory

There wasn't enough memory. Try not running any memory-resident software that might be taking up too much space. Use the CHKDSK program to find out how much memory you have.

If you are creating a large resource file then you can split the resource script into two files. After creating two .RES files, use the MS-DOS command to join them together. For example:

copy first.res /b + second.res /b full.res


Accelerator Type required (ASCII or VIRTKEY)

The type field in the ACCELERATORS statement must contain either the ASCII or VIRTKEY value.


BEGIN expected in Accelerator Table

The BEGIN key word must immediately follow the ACCELERATORS key word.


BEGIN expected in Dialog

The BEGIN key word must immediately follow the DIALOG key word.


BEGIN expected in menu

The BEGIN key word must immediately follow the MENU key word.


BEGIN expected in RCData

The BEGIN key word must immediately follow the RCDATA key word.


BEGIN expected in String Table

The BEGIN key word must immediately follow the STRINGTABLE key word.


Cannot Re-use String Constants

You are using the same value twice in a STRINGTABLE statement. Make sure you are not mixing overlapping decimal and hexadecimal values.

Each ID in a STRINGTABLE must be unique. For maximum efficiency use contiguous constants that start on a multiple of 16.


Control Character out of range [^A - ^Z]

A control character in the ACCELERATORS statement is invalid. The character following the caret (^) must be between A and Z, inclusive.


Empty menus not allowed

An END key word appears before any menu items are defined in the MENU statement. Empty menus are not permitted by the Resource Compiler. Make sure you do not have any open quotation marks within the MENU statement.


END expected in Dialog

The END key word must occur at the end of a DIALOG statement. Make sure there are no open quotes left from the preceding statement.


END expected in menu

The END key word must come at the end of a MENU statement. Make sure you do not have any open quotation marks or a mismatched pair of BEGIN and END statements.


Expected Comma in Accelerator Table

RC requires a comma between the event and idvalue fields in the ACCELERATORS statement.


Expected control class name

The class field of a CONTROL statement in the DIALOG statement must be one of the following types: BUTTON, COMBOBOX, EDIT, LISTBOX, SCROLLBAR, STATIC, or user-defined. Make sure the class is spelled correctly.


Expected font face name

The typeface field of the FONT option in the DIALOG statement must be an ASCII character string enclosed in double quotation marks. This field specifies the name of a font.


Expected ID value for Menu Item

The MENU statement must contain a menuID field, which specifies the name or number that identifies the menu resource.


Expected Menu String

Each MENUITEM and POPUP statement must contain a text field, which is a string enclosed in double quotation marks that specifies the name of the menu item or pop-up menu. A MENUITEM SEPARATOR statement requires no quoted string.


Expected numeric command value

RC was expecting a numeric idvalue field in the ACCELERATORS statement. Make sure you have used a #define constant to specify the value and that the constant is spelled correctly.


Expected numeric constant in string table

A numeric constant, defined in a #define statement, must immediately follow the BEGIN key word in a STRINGTABLE statement.


Expected numeric point size

The pointsize field of the FONT option in the DIALOG statement must be an integer point size value.


Expected Numerical Dialog constant

A DIALOG statement requires integer values for the x, y, width, and height fields. Make sure these values are included after the DIALOG key word and that they are not negative.


Expected String in STRINGTABLE

A string is expected after each stringid value in a STRINGTABLE statement.


Expected String or Constant Accelerator command

RC was not able to determine what kind of key is being set up for the accelerator. The event field in the ACCELERATORS statement might be invalid.


Expecting number for ID

Expecting a number for the id field of a control statement in the DIALOG statement. Make sure you have a number or #define statement for the control ID.


Expecting quoted string in dialog class

The class field of the CLASS option in the DIALOG statement must be an integer or a string, enclosed in double quotation marks.


Expecting quoted string in dialog title

The captiontext field of the CAPTION option in the DIALOG statement must be an ASCII character string enclosed in double quotation marks.


File not found: filename

The file specified in the RC command line was not found. Check to see whether the file has been moved to another directory and whether the filename or pathname is typed correctly.

Files are searched for using the INCLUDE environment variable or the Visual Workbench setting, if available.


Font names must be ordinals

The pointsize field in the FONT statement must be an integer, not a string.


Invalid Accelerator

An event field in the ACCELERATORS statement was not recognized or was more than two characters in length.


Invalid Accelerator Type (ASCII or VIRTKEY)

The type field in the ACCELERATORS statement must contain either the ASCII or VIRTKEY value.


Invalid control character

A control character in the ACCELERATORS statement is invalid. A valid control character consists of one letter (only) following a caret (^).


Invalid Control type

Each control statement in a DIALOG statement must be one of the following: CHECKBOX, COMBOBOX, CONTROL, CTEXT, DEFPUSHBUTTON, EDITTEXT, GROUPBOX, ICON, LISTBOX, LTEXT, PUSHBUTTON, RADIOBUTTON, RTEXT, SCROLLBAR.

Make sure these control statements are spelled correctly.


Invalid Type

The resource type was not among the types defined in the WINDOWS.H file.


Text string or ordinal expected in Control

The text field of a CONTROL statement in the DIALOG statement must be either a text string or an ordinal reference to the type of control is expected. If using an ordinal, make sure that you have a #define statement for the control.


Mismatched Parentheses

Make sure you have closed every open parenthesis in the DIALOG statement.


Unexpected value in value data

The raw-data values in the RCDATA statement must be integers or strings, each separated by a comma. Make sure you did not leave out a comma or leave out a quotation mark around a string.


Unknown Menu SubType

The item-definition field of the MENU statement can contain only MENUITEM and POPUP statements.


Error: Bitmap file resource-file is not in 3.00 format.

Bitmaps using the Windows version 2.x format cannot be used in version 3.x resource files. The bitmap must be redrawn or converted to 3.x format


Error: Old DIB in resource-name.

A Device Independent Bitmap (DIB) in the specified resource is not compatible with the Windows 3.0 format. The bitmap must be redrawn or converted to the 3.x format.


Error: Resource file resource-name is not in 3.00 format.

An icon or cursor in the specified resource used a format from a previous version of Windows. The icon or cursor must be redrawn or converted to the 3.x format.


Unknown DIB header format

The bitmap header is not a BITMAPCOREHEADER or BITMAPINFOHEADER structure.


Unable to initialize symbol information

This error occurs only in App Studio. The probable cause is that you have too many open files or you cannot open or write to the data files needed for App Studio to import the symbols in your script. App Studio attempts to create these files in the directory specified by the TMP environment variable or the current directory if none is specified.


Unable to save symbol information

This error occurs only in App Studio.  The probable cause is that you have too many open files or you cannot close or write to the data files needed for App Studio to import the symbols in your script. App Studio attempts to use these files in the directory specified by the TMP environment variable or the current directory if none is specified.


Bitmap file resource file is not in 2.03 format

A bitmap used a format earlier than version 2.03. The bitmap must be converted or redrawn using the format for version 3.00 or later.


Resource too large

For Windows 3.1 a resource cannot exceed approximately 65000 bytes.  If your resource does, then you will not be able to compile it with App Studio or the command line resource compiler.  This limit does not apply to cursors, icons, bitmaps, or other file based resources.


Resource file is not in 3.00 format

A cursor or icon used a format earlier than version 3.00. The resource must be converted or redrawn using the format for version 3.00 or later.


Unable to open temporary file

The Resource Compiler/App Studio was unable to open a temporary file.  The probable cause is that you do not have write permissions for the directory, or the directory does not exist. The Resource Compiler/App Studio attempts to use these files in the directory specified by the TMP environment variable or the current directory if none is specified.


Errors in .EXE file

LINK failed. See the documentation for more information about linking an executable.


.EXE file too large; relink with higher /ALIGN value

The EXE file is too large. Relink the .EXE file with a larger /ALIGN value. If the .EXE file is larger than 800K, you should use the /ALIGN:32 value on your LINK line.


.EXE not created by LINK

You must create the .EXE file with a version of Microsoft LINK later than 5.0 or with LINKW.


Invalid .EXE file

The .EXE file is invalid. Make sure that the linker created it correctly and that the file exists. You can check the .EXE file with the Microsoft EXEHDR utility.


Not a Microsoft Windows format .EXE file

Make sure that the linker created the .EXE file correctly and that the file exists. You can check the .EXE file with the Microsoft EXEHDR utility.


The EXETYPE of this program is not Windows

The EXETYPE WINDOWS statement did not appear in the .DEF file.


Unable to create destination

RC was not able to create the destination file. Make sure there is enough disk space and that you have write permission on the volume.


Unable to open exe-file

RC could not open this .EXE file. Make sure that the linker created it correctly and that the file exists.


.EXE processing options (-L -M -P -T or -K)
Resource Compiler Warning RW4001

.EXE processing options (-L -M -P -T -K -E -31 or -30)

.EXE processing options (-L -M -P -T -K -E -31 or -30) were specified when no executable file would  be processed. These options can only be used when the result is an .EXE file (not a .RES file).


SHIFT or CONTROL used without VIRTKEY
Resource Compiler Warning RW4003

SHIFT or CONTROL used without VIRTKEY

In an accelerator table resource, SHIFT or CONTROL require VIRTKEY. Because SHIFT and CONTROL are indicated as flag bits in a VIRTKEY type accelerator, they cannot exist independent from a VIRTKEY.


ASCII character not equivalent to virtual key code
Resource Compiler Warning RW4004

ASCII character not equivalent to virtual key code

A string literal was used for the virtual key code in a VIRTKEY type accelerator.

This warning lets you continue, but be aware that the accelerator keys generated may not match the string you indicated. (VIRTKEYs use different key codes than ASCII accelerators.)

While string literals are syntactically valid, you can only ensure that you get the accelerator you want by using the VK_* #define values in WINDOWS.H.


BSCMAKE Errors
BSCMAKE 2.51 Errors

Errors	Warnings
BK1500	BK4500
BK1501	BK4501
BK1502	BK4502
BK1503	BK4503
BK1504
BK1505
BK1506
BK1507
BK1508
BK1509
BK1510
BK1511
BK1512
BK1513
BK1514
BK1515
BK1516


UNKNOWN ERROR Contact Microsoft Product Support Services
BSCMAKE Error BK1500

UNKNOWN ERROR
Contact Microsoft Product Support Services

BSCMAKE detected an unknown error condition.

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


unknown character 'character' in option 'option'
BSCMAKE Error BK1501

unknown character 'character' in option 'option'

BSCMAKE did not recognize the given character specified for the given option.


incomplete specification for option 'option'
BSCMAKE Error BK1502

incomplete specification for option 'option'

The given option did not contain the correct syntax.


cannot write to file 'filename'
BSCMAKE Error BK1503

cannot write to file 'filename' [: reason]

BSCMAKE could not write to the given file. This message may be followed by a reason from the operating system giving additional information.

One of the following may have occurred:

The disk was full.

A hardware error occurred.


cannot position in file 'filename'
BSCMAKE Error BK1504

cannot position in file 'filename' [: reason]

BSCMAKE could not move to a location in the given file. This message may be followed by a reason from the operating system giving additional information.

One of the following may have occurred:

The disk was full.

A hardware error occurred.

The file was truncated. Truncation can occur if the compiler runs out of disk space or is interrupted when it is creating the .SBR file.


cannot read from file 'filename'
BSCMAKE Error BK1505

cannot read from file 'filename' [: reason]

BSCMAKE could not read from the given file. This message may be followed by a reason from the operating system giving additional information.

One of the following may have occurred:

The file was corrupt.

The file was truncated. Truncation can occur if the compiler runs out of disk space or is interrupted when it is creating the .SBR file.


cannot open file 'filename'
BSCMAKE Error BK1506

cannot open file 'filename' [: reason]

BSCMAKE could not open the given file. This message may be followed by a message from the operating system giving additional information.

One of the following may have occurred:

The file was locked by another process. If the reason was Permission denied, the browser in the development environment might be using the file. Close the Browse window and repeat the build.

No more file handles were available. Increase the number of file handles by changing the FILES setting in CONFIG.SYS to allow a larger number of open files. FILES=50 is the recommended setting.

The disk was full.

A hardware error occurred.

The specified output file had the same name as an existing subdirectory.


cannot open temporary file 'filename'
BSCMAKE Error BK1507

cannot open temporary file 'filename' [: reason]

BSCMAKE could not open one of its temporary files. This message may be followed by a reason from the operating system giving additional information.

One of the following may have occurred:

No more file handles were available. Increase the number of file handles by changing the FILES setting in CONFIG.SYS to allow a larger number of open files. FILES=50 is the recommended setting.

The TMP environment variable was not set to a valid drive and directory.

The disk was full.


cannot delete temporary file 'filename'
BSCMAKE Error BK1508

cannot delete temporary file 'filename' [: reason]

BSCMAKE could not delete one of its temporary files. This message may be followed by a reason from the operating system giving additional information.

One of the following may have occurred:

Another process had the file open.

A hardware error occurred.


out of heap space
BSCMAKE Error BK1509

out of heap space

BSCMAKE ran out of memory, including virtual memory.

One of the following may be a solution:

Free some space on disk.

Increase the size of the Windows swap file.

Reduce the memory that BSCMAKE will require by using one or more options. Use /Ei or /Es to eliminate some input files. Use /Em to eliminate macro bodies.

Additional ways to make more memory available to BSCMAKE include the following:

Free some memory by removing terminate-and-stay-resident (TSR) software.

Reconfigure the EMM driver.

Change CONFIG.SYS to specify fewer buffers (the BUFFERS command) and fewer drives (the LASTDRIVE command).


corrupt .SBR file 'filename'
BSCMAKE Error BK1510

corrupt .SBR file 'filename'

The given .SBR file is corrupt or does not have the expected format.

Recompile to regenerate the .SBR file.


invalid response file specification
BSCMAKE Error BK1511

invalid response file specification

BSCMAKE did not understand the command-line specification for the response file. The specification was probably wrong or incomplete.

For example, the following specification causes this error:

bscmake @


database capacity exceeded
BSCMAKE Error BK1512

database capacity exceeded

BSCMAKE could not build a database because the number of definitions, references, modules, or other information exceeded the limit for a database.

One of the following may be a solution:

Exclude some information using the /Em, /Es, or /Ei option.

Omit the /Iu option if it was used.

Divide the list of .SBR files and build multiple databases.


nonincremental update requires all .SBR files
BSCMAKE Error BK1513

nonincremental update requires all .SBR files

An attempt was made to build a new database, but one or more of the specified .SBR files was truncated. This message is always preceded by warning BK4502, which will give the name of the .SBR file that caused the error.

BSCMAKE can process a truncated, or zero-length, .SBR file only when a database already exists and is being incrementally updated.

One of the following may be a cause:

The database file was missing.

The wrong database name was specified.

The database was corrupted, and a full build was required.


all .SBR files truncated and not in database
BSCMAKE Error BK1514

all .SBR files truncated and not in database

None of the .SBR files specified for an update was a part of the original database. This message is always preceded by warning BK4502, which will give the name of the .SBR file that caused the error.

One of the following may be a cause:

The wrong database name was specified.

The database was corrupted, and a full build was required.


'bscfile' : incompatible version; cannot incrementally update
BSCMAKE Error BK1515

'bscfile' : incompatible version; cannot incrementally update

The given database (.BSC file) was not created with this version of BSCMAKE. A database can be incrementally built only by the same version of BSCMAKE as the one used to fully build the database.


'bscfile' : database corrupt; cannot incrementally update
BSCMAKE Error BK1516

'bscfile' : database corrupt; cannot incrementally update

The given database (.BSC file) was corrupted, possibly due to a system failure during the build. Delete the database, rebuild all .SBR files, then rebuild the .BSC file.


UNKNOWN WARNING Contact Microsoft Product Support Services
BSCMAKE Warning BK4500

UNKNOWN WARNING
Contact Microsoft Product Support Services

An unknown error condition was detected by BSCMAKE.

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


ignoring unknown option 'option'
BSCMAKE Warning BK4501

ignoring unknown option 'option'

BSCMAKE did not recognize the given option and ignored it.


truncated .SBR file 'filename' not in database
BSCMAKE Warning BK4502

truncated .SBR file 'filename' not in database

The given zero-length .SBR file, specified during a database update, was not originally part of the database.

If a zero-length file that is not part of the original build of the database is specified during a rebuild of that database, BSCMAKE issues this warning. One of the following may be a cause:

The wrong database name was specified.

The database was deleted. (Error BK1513 will result.)

The database file was corrupted, requiring a full build.


minor error in .SBR file 'filename' ignored
BSCMAKE Warning BK4503

minor error in .SBR file 'filename' ignored

The given .SBR file contained an error that did not halt the build. However, the resulting .BSC file may not be correct.

Recompile to regenerate the .SBR file.


CVPACK Errors
CVPACK 4.25 Errors

Note  CKnnnn errors can also be generated by LINK version 1.00.

Fatal Errors	Warnings
CK1001	CK4001
CK1002	CK4003
CK1003	CK4004
CK1004	CK4005
CK1005	CK4006
CK1006	CK4007
CK1007	CK4008
CK1008	CK4009
CK1011	CK4010
CK1012
CK1013
CK1017
CK1018
CK1021
CK1022
CK1023
CK1024
CK1025


out of memory
CVPACK Fatal Error CK1001

out of memory

CVPACK ran out of memory.

One of the following may be a solution:

Free some space on disk.

Increase the size of the Windows NT paging file or the Windows swap file.

Recompile one or more of the object files without debugging information. If the file was compiled using /Zi or /Z7, either use /Zd or do not use a debugging option.


out of memory
CVPACK Fatal Error CK1002

out of memory

CVPACK ran out of memory.

One of the following may be a solution:

Free some space on disk.

Increase the size of the Windows NT paging file or the Windows swap file.

Recompile one or more of the object files without debugging information. If the file was compiled using /Zi or /Z7, either use /Zd or do not use a debugging option.


cannot open file : filename
CVPACK Fatal Error CK1003

cannot open file : filename

CVPACK could not open the given file.

One of the following may be a cause:

The file does not exist. Check the spelling of the filename and path.

The file was opened or deleted by another process.

There was not enough space on disk.


filename is read-only
CVPACK Fatal Error CK1004

filename is read-only

The given file is a read-only file or the path is on a read-only drive.


invalid executable file
CVPACK Fatal Error CK1005

invalid executable file

CVPACK could not process the executable file.

One of the following may be a cause:

The debugging information in the executable file is corrupt.

The executable file is a zero-length file.


invalid module module
CVPACK Fatal Error CK1006

invalid module module

The module does not have a valid format or is corrupt. Recompile and relink.


invalid table table in module module
CVPACK Fatal Error CK1007

invalid table table in module module

The given table in the given object file is not valid or the module is corrupt. Recompile and relink. If the error recurs, try using different options.


cannot write output file
CVPACK Fatal Error CK1008

cannot write output file

The disk is probably full.

This error leaves a corrupt file on disk.


type information corrupt, recompile module modulename
CVPACK Fatal Error CK1011

type information corrupt, recompile module modulename

The given object file contains corrupted information.

Recompile. If compiling with /Zi, try /Z7. If compiling with /Z7, try /Zi.


no debugging information
CVPACK Fatal Error CK1012

no debugging information

The executable file does not contain debugging information.

Do one of the following:

To put at least minimal debugging information into the executable file, link using the /DEBUG option.

To include full debugging information in an object file, compile or assemble using the /Zi or /Z7 option.

To include minimal information and line numbers in an object file, compile or assemble using the /Zd option.


incompatible version of debugging information
CVPACK Fatal Error CK1013

incompatible version of debugging information

One of the following has occurred:

The executable file was linked using an obsolete or unsupported linker.

The executable file was already packed using a previous version of CVPACK.

The executable file is corrupt. Recompile and relink.


cannot find precompiled types file; relink with filename
CVPACK Fatal Error CK1017

cannot find precompiled types file; relink with filename

The program used a precompiled header, but the program was linked without filename. This file is the object file that was created when the header was precompiled. If the program uses a library that was created using precompiled headers, then filename was not linked from the library.

One of the following may be a solution:

Extract the object from the library and link it to the program explicitly.

Force LINK to include the object in the program by specifying the /INCLUDE option with a symbol from the object.

Change the source code so that code or data in filename is referenced from either an object file that uses the library or another module that is being linked from the library.


userfile cannot use precompiled types file pctfile : type counts do not match
CVPACK Fatal Error CK1018

userfile cannot use precompiled types file pctfile : type counts do not match

The userfile uses the precompiled types file pctfile, but pctfile does not contain the correct number of types for userfile.

Recompile userfile and relink. If a makefile is used, check the makefile dependencies.

@ MSINTERNAL : CK1019 ERR_NEWMOD "...incremental link" not used


userfile cannot use precompiled types file pctfile : signatures do not match
CVPACK Fatal Error CK1021

userfile cannot use precompiled types file pctfile : signatures do not match

The userfile uses the precompiled types file pctfile, but the internal signature in pctfile does not match the internal signature in userfile. Probably pctfile was rebuilt but userfile was not rebuilt.

Recompile userfile and relink. If a makefile is used, check the makefile dependencies.


cannot open program database pdbfile
CVPACK Fatal Error CK1022

cannot open program database pdbfile

CVPACK could not open the given program database (.PDB file).

One of the following may be a cause:

The .PDB file does not exist. Check the spelling of the filename and path.

The .PDB file was opened or deleted by another process.

CVPACK and LINK look for .PDB files in the following locations in this order:

1.	The absolute path written in the .OBJ file.

2.	The current directory that CVPACK or LINK is running from.

3.	Any directories specified in the LIB environment variable.

CVPACK and LINK do not look in the directory that contains the object file or library, nor do they look in a directory specified in the libraries field on the LINK command line. You cannot specify a .PDB file's name or location on the command line.


modulename cannot use program database pdbfile : module newer than database
CVPACK Fatal Error CK1023

modulename cannot use program database pdbfile : module newer than database

The .OBJ file modulename uses the .PDB file pdbfile, but pdbfile is older than modulename.

Recompile and relink. If a makefile is used, check the makefile dependencies.


modulename cannot use program database pdbfile : signatures do not match
CVPACK Fatal Error CK1024

modulename cannot use program database pdbfile : signatures do not match

The .OBJ file modulename uses the .PDB file pdbfile, but the internal signature in pdbfile does not match the internal signature in modulename.

Delete modulename, recompile, and relink. If a makefile is used, check the makefile dependencies.


incorrect COFF symbol table
CVPACK Fatal Error CK1025

incorrect COFF symbol table

[description needed]


file already packed
CVPACK Warning CK4001

file already packed

CVPACK took no action because the executable file has already been processed by this version of CVPACK.


error in lexical scopes for module module; symbols deleted
CVPACK Warning CK4003

error in lexical scopes for module module; symbols deleted

The scoping of symbols in the given object module was corrupted. CVPACK deleted the symbols in the module.

This is probably a compiler error. Recompile and relink the object file.


unrecognized symbols discarded; recompile module modulename
CVPACK Warning CK4004

unrecognized symbols discarded; recompile module modulename

The compiler generated an invalid symbol record in the modulename object file. CVPACK discarded the record.

The debugger can run the resulting executable file. However, the symbol will be accessible only by the decorated name known to the linker, and display of the symbol will be limited. To see decorated names of identifiers, use DUMPBIN /UNDECORATE.


unrecognized type converted to NULL; recompile module modulename
CVPACK Warning CK4005

unrecognized type converted to NULL; recompile module modulename

The compiler generated an invalid type record in the modulename object file. CVPACK discarded the record.

The debugger can run the resulting executable file, but display of objects that reference the invalid type will be limited.


type length limit exceeded; converted to NULL
CVPACK Warning CK4006

type length limit exceeded; converted to NULL

A struct, enum, union, or class was too large for CVPACK to process. You can use the executable file with the debugger, but you cannot reference the object or type while debugging.


unrecognized option /option; option ignored
CVPACK Warning CK4007

unrecognized option /option; option ignored

The given option is not a valid CVPACK option. CVPACK ignored the specification and attempted to run using the rest of the command line.


source line limit exceeded in module filename; source line info discarded
CVPACK Warning CK4008

source line limit exceeded in module filename; source line info discarded

CVPACK could not translate the debugging information in the given filename module because filename was too large. CVPACK discarded the debugging information for this module.

Break up the module into smaller files.


exceeded 64K types at module; discarding subsequent types
CVPACK Warning CK4009

exceeded 64K types at module; discarding subsequent types

The debugging information exceeded a CVPACK limit.

One of the following may be a solution:

Compile some object files without debugging information.

Avoid including unneeded header files.

The checksum can be calculated only when running on Windows NT.


cannot update checksum
CVPACK Warning CK4009

cannot update checksum

The checksum can be calculated only when running on Windows NT.


DOSXNT MS-DOS Extender Errors

Fatal Errors

DX1020

DX1070

DX1140

DX1180

DX1230

DX1270

DX1350

DX1390

DX5420


unhandled exception: exception; contact Microsoft Support Services
DOSXNT MS-DOS Extender Error DX1020

unhandled exception: exception;
contact Microsoft Support Services

A problem exists in the MS-DOS-extended program. Additional information is displayed after this error message. Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.

The following causes of this error have been observed:

A problem occurred with a TSR.

A problem occurred with a memory manager.

A PAGE directive in a MASM program specified an invalid length or width value.

A .WHILE directive in a MASM program was used to test a processor flag. To work around this situation, OR the processor flag with zero.


GODOSXNT.EXE stub out of date
DOSXNT MS-DOS Extender Error DX1070

GODOSXNT.EXE stub out of date

The program you are attempting to run is not compatible with the version of DOSXNT.EXE available to the program.

The program is a 32-bit MS-DOS-extended application. A compatible version of the Microsoft DOSXNT MS-DOS Extender (DOSXNT.EXE) must exist in the same directory or in a directory specified in the PATH environment variable.

One way this error can result is when Microsoft MASM 6.1 is installed in the same directory as another language product. Either reinstall in separate directories or update from this version of MASM.


DOSXNT.386 driver required to run with Windows
DOSXNT MS-DOS Extender Error DX1140

DOSXNT.386 driver required to run with Windows

For an MS-DOS-extended program that uses DOSXNT to run with the Microsoft Windows operating system, the driver called DOSXNT.386 must be specified in the [386Enh] section of SYSTEM.INI as follows:

DEVICE=path\DOSXNT.386

where path is the directory that contains the DOSXNT.386 file.


cannot load program : reason
DOSXNT MS-DOS Extender Error DX1180

cannot load program : reason

The MS-DOS extender could not load the MS-DOS-extended program for the given reason. The reason can be one of the following:

access denied to file

Change the access rights for the file.

invalid or corrupted .EXE file

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the "Microsoft Support Services" section in one of your manuals.

out of memory

Remove some TSRs or add more memory.

too many open files

Either close some files or increase the number of file handles specified in the FILES= statement in CONFIG.SYS.


DOSXNT initialization failed
DOSXNT MS-DOS Extender Error DX1230

DOSXNT initialization failed

This error usually follows error DX5420.


command line error : unknown command switch
DOSXNT MS-DOS Extender Error DX1270

command line error : unknown command switch

This error occurs if one of the following environment variables is set: G, GO, GOT, GOTN, GOTNT, T, TN, TNT.

To see the current settings of environment variables, run the SET command at the operating system prompt. To clear an environment variable, run the command SET variable=, where variable is the name of the variable to be cleared; no other characters can appear before pressing ENTER. Changes in environment variables must be made outside of Windows. Check AUTOEXEC.BAT for environment variable settings.


cannot load program: file not found
DOSXNT MS-DOS Extender Error DX1350

cannot load program: file not found

This error occurs if one of the following environment variables is set: G, GO, GOT, GOTN, GOTNT, T, TN, TNT.

To see the current settings of environment variables, run the SET command at the operating system prompt. To clear an environment variable, run the command SET variable=, where variable is the name of the variable to be cleared; no other characters can appear before pressing ENTER. Changes in environment variables must be made outside of Windows. Check AUTOEXEC.BAT for environment variable settings.


cannot load program
DOSXNT MS-DOS Extender Error DX1390

cannot load program

DOSXNT cannot load the executable file because all memory is exhausted. For an MS-DOS-extended program that uses DOSXNT to run with the Microsoft Windows operating system, a Windows swap file must exist.


CheckDPMI: error when checking for coprocessor support
DOSXNT MS-DOS Extender Error DX5420

CheckDPMI: error when checking for coprocessor support

For an MS-DOS-extended program that uses DOSXNT to run with the Microsoft Windows operating system, the following must be specified in the [386Enh] section of SYSTEM.INI:

DEVICE=*vmcpd


Linker Tools Errors

The Linker Tools errors (LNKnnnn) are generated by LINK, LIB, DUMPBIN, and EDITBIN.

Fatal Errors	Warnings
LNK1000	LNK4000
LNK1102	LNK4001
LNK1104	LNK4003
LNK1105	LNK4005
LNK1106	LNK4006
LNK1107	LNK4008
LNK1108	LNK4010
LNK1109	LNK4011
LNK1110	LNK4013
LNK1111	LNK4014
LNK1113	LNK4015
LNK1116	LNK4016
LNK1117	LNK4017
LNK1118	LNK4019
LNK1119	LNK4022
LNK1120	LNK4023
LNK1121	LNK4027
LNK1122	LNK4029
LNK1123	LNK4030
LNK1127	LNK4031
LNK1129	LNK4033
LNK1131	LNK4036
LNK1132	LNK4037
LNK1136	LNK4038
LNK1137	LNK4039
LNK1138	LNK4040
LNK1139	LNK4041
LNK1141	LNK4042
LNK1143	LNK4044
LNK1146	LNK4047
LNK1147	LNK4048
LNK1148	LNK4049
LNK1149	LNK4051
LNK1150	LNK4052
LNK1151	LNK4053
	LNK4055
	LNK4056
	LNK4057
	LNK4058
	LNK4060


unknown error; contact Microsoft Product Support Services
Linker Tools Error LNK1000

unknown error; contact Microsoft Product Support Services

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


out of memory
Linker Tools Error LNK1102

out of memory

There was not enough memory for the tool to run. Probably the paging file exceeded available disk space.

If a shortage of disk space is not the cause, note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


cannot open file "filename"
Linker Tools Error LNK1104

cannot open file "filename"

The tool could not open the given file. One of the following may be a cause:

The filename was incorrectly specified.

The file does not exist in the location specified.

The specified drive is invalid.

The file does not have the appropriate permissions.

The path for filename expands to more than 260 characters.

If the given file is TEMPFILE or LIBTEMPFILE then one of the following may also be a cause:

The directory specified in the TMP environment variable does not exist.

There was not enough disk space to create the temporary file.


cannot close file "filename"
Linker Tools Error LNK1105

cannot close file "filename"

The tool could not close the given file. Possibly there was insufficient disk space available.


invalid file or disk full : cannot seek to location
Linker Tools Error LNK1106

invalid file or disk full : cannot seek to location

The tool could not read the file. Recreate the file.


invalid or corrupt file : cannot read at location
Linker Tools Error LNK1107

invalid or corrupt file : cannot read at location

The tool could not read the file. Recreate the file.


cannot write file at location
Linker Tools Error LNK1108

cannot write file at location

The tool could not write to the file. One of the following may be a cause:

There was not enough disk space to create the file.

The floppy disk containing the file was removed.

The drive being written to was not available, possibly due to a network problem.


cannot remove file "filename"
Linker Tools Error LNK1109

cannot remove file "filename"

LIB could not delete the given file.

Before LIB writes the new version of a library, it removes the existing library file.

One of the following may be a cause:

The given file does not have the appropriate permissions.

The floppy disk containing the file was removed.

The drive containing the file was not available, possibly due to a network problem.


cannot rename file "filename"
Linker Tools Error LNK1110

cannot rename file "filename"

LIB could not rename the given file.

When LIB builds a new version of a library, it creates a temporary file, then renames the file.

One of the following may be a cause:

The given file does not have the appropriate permissions.

The floppy disk containing the file was removed.

The drive containing the file was not available, possibly due to a network problem.


invalid /BASE argument "argument"
Linker Tools Error LNK1111

invalid /BASE argument "argument"

The /BASE option was incorrectly specified. Either no argument was specified or argument is not a number.


invalid machine type
Linker Tools Error LNK1113

invalid machine type

The machine type specified in the object header is not valid. Probably the file is corrupt. Rebuild the object.


base key "key" not found
Linker Tools Error LNK1116

base key "key" not found

The key specified with the /BASE option was not found in the base address file.

Check the specification of the /BASE file and key arguments.


syntax error in option "option"
Linker Tools Error LNK1117

syntax error in option "option"

The given option was not correctly specified.


syntax error in keyword statement
Linker Tools Error LNK1118

syntax error in keyword statement

The given module-definition statement was not correctly specified.


invalid ordinal number "argument"
Linker Tools Error LNK1119

invalid ordinal number "argument"

The argument following the at sign (@) in an ordinal specification was not a valid number.

An ordinal number is an optional argument in either an /EXPORT option in a LINK or LIB command or an EXPORTS statement in a module-definition file. It is an index into the exports table. The number must be an integer in the range 1-65535.


number unresolved externals
Linker Tools Error LNK1120

number unresolved externals

The given number of external references could not be resolved.

This error is preceded by warning LNK4016.


duplicate ordinal number "number"
Linker Tools Error LNK1121

duplicate ordinal number "number"

The given ordinal number was specified more than once in either an /EXPORT option in a LINK or LIB command or an EXPORTS statement in a module-definition file. Ordinal numbers must be unique integers in the range 1-65535.


invalid keyword "keyword"
Linker Tools Error LNK1122

invalid keyword "keyword"

An /EXPORT option or EXPORTS statement contained a keyword other than NONAME or DATA.


failure during convertion to COFF : file invalid or corrupt
Linker Tools Error LNK1123

failure during conversion to COFF : file invalid or corrupt

The object or resource could not be converted to COFF.

This tool requires the format of all input files to be COFF. If an input file is not COFF, the tool runs a conversion tool, either CVTOMF (to convert 32-bit OMF objects) or CVTRES (to convert resource files).

One of the following may be a cause:

The file is corrupt.

The file is not a valid file type. An example of an invalid type is a 16-bit OMF object.

This error is preceded by errors or warnings from the conversion tool.


library is corrupt
Linker Tools Error LNK1127

library is corrupt

The header of the library file is corrupt. Rebuild the library.


cannot find resolution for weak extern symbol
Linker Tools Error LNK1129

cannot find resolution for weak extern symbol

The given weak external symbol does not have a default resolution. Probably the symbol table is corrupt. Rebuild the object file.


no library file specified
Linker Tools Error LNK1131

no library file specified

The LIB /EXTRACT command required a library as input, but a library filename was not specified.


invalid format for MS-DOS stub file "filename"
Linker Tools Error LNK1132

invalid format for MS-DOS stub file "filename"

The filename specified with the /STUB option was not a valid real-mode MS-DOS executable file.


invalid or corrupt file
Linker Tools Error LNK1136

invalid or corrupt file

The input file either has a corrupt header or is zero size or abnormally small.


invalid argument specified with /SECTION
Linker Tools Error LNK1137

invalid argument specified with /SECTION

Either the name or the attributes argument to the /SECTION option is specified incorrectly.


corrupt debugging information in object file "filename"
Linker Tools Error LNK1138

corrupt debugging information in object file "filename"

The debugging information is corrupt. Rebuild the filename object.


corrupt debugging information in section number
Linker Tools Error LNK1139

corrupt debugging information in section number

The debugging information is corrupt. Rebuild the object.


failure during build of exports file
Linker Tools Error LNK1141

failure during build of exports file

LINK could not build the exports (.EXP) file.

Causes of this error include system problems such as insufficient memory and syntax errors in options or module-definition statements.

This error is preceded by another error that gives additional information.


invalid or corrupt file : no symbol for comdat section number
Linker Tools Error LNK1143

invalid or corrupt file : no symbol for comdat section number

The object file is corrupt. Rebuild the file.


no argument specified with option "option"
Linker Tools Error LNK1146

no argument specified with option "option"

The given option requires an argument.


invalid number specified with option "option"
Linker Tools Error LNK1147

invalid number specified with option "option"

The argument to the given option was specified incorrectly.


failure during convertion to COFF : cannot copy temp file filename
Linker Tools Error LNK1148

failure during conversion to COFF : cannot copy temp file filename

EDITBIN could not convert the input file to COFF.

When EDITBIN converts a file, it creates a temporary file, then copies the file.

One of the following may be a cause:

The given file does not have the appropriate permissions.

There was not enough disk space to create the file.

The floppy disk containing the file was removed.

The drive being written to was not available, possibly due to a network problem.


output filename matches input filename "filename"
Linker Tools Error LNK1149

output filename matches input filename "filename"

The output filename specified with the /OUT or /IMPLIB option was the same as an input file.


/BIND error : reason
Linker Tools Error LNK1150

/BIND error : reason

An error occurred when EDITBIN /BIND or LINK /BIND was used, for the given reason.


/REBASE error : reason
Linker Tools Error LNK1151

/REBASE error : reason

An error occurred when EDITBIN /REBASE or LINK /REBASE was used, for the given reason.


unknown warning; contact Microsoft Product Support Services
Linker Tools Warning LNK4000

unknown warning; contact Microsoft Product Support Services

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


no object files specified; libraries used
Linker Tools Warning LNK4001

no object files specified; libraries used

The command did not specify any object files as input. The tool used objects from the libraries that were specified as input.


invalid library format; library ignored
Linker Tools Warning LNK4003

invalid library format; library ignored

The file header for the input library was invalid. The tool did not use the library.


no objects used from library library
Linker Tools Warning LNK4005

no objects used from library library

The library was specified in the command, but no references were resolved from that library.


symbol already defined in object; second definition ignored
Linker Tools Warning LNK4006

symbol already defined in object; second definition ignored

The given symbol was multiply defined. The first definition was used.

One of the following may be a cause:

The given symbol was a packaged function (created by compiling with /Gy) and was included in more than one file but was changed between compilations. Recompile all files that include the symbol.

The given symbol was defined differently in two member objects in different libraries, and both member objects were used.

An absolute was defined twice, with a different value in each definition.

The given symbol was specified in its undecorated form, but a unique match to a decorated symbol could not be found. This warning is preceded by warning LNK4022.


invalid fixup found, type number, address address; fixup ignored
Linker Tools Warning LNK4008

invalid fixup found, type number, address address; fixup ignored

The object contained an invalid fixup. The resulting executable file will probably not run correctly.

Rebuild the object file.


invalid version number "number"; default version assumed
Linker Tools Warning LNK4010

invalid version number "number"; default version assumed

Either the major or the minor number in the specified version argument was not valid.

Each part of a version specification must be an integer in the range 1-65535. Options that take a version argument include /SUBSYSTEM and /VERSION.


unknown subsystem "argument"; default assumed
Linker Tools Warning LNK4011

unknown subsystem "argument"; default assumed

The /SUBSYSTEM option was incorrectly specified. Either no argument was specified or argument did not have the expected syntax. The tool assumed an appropriate default.


image size imagesize exceeds specified maximum maxsize
Linker Tools Warning LNK4013

image size imagesize exceeds specified maximum maxsize

The base address file specified with the /BASE option listed the maximum size of the program as maxsize, but maxsize was less than the resulting image size of the program.


cannot find member object "objectname"
Linker Tools Warning LNK4014

cannot find member object "objectname"

LIB could not find objectname in the library.

The /REMOVE and /EXTRACT options require the full name of the member object that is to be deleted or copied to a file. The full name includes the path of the original object file. To see the full names of member objects in a library, use DUMPBIN /ARCHIVEMEMBERS or LIB /LIST.


memorytype commit exceeds reserve; commit size set to size
Linker Tools Warning LNK4015

memorytype commit exceeds reserve; commit size set to size

The value specified for the commit size for the memorytype exceeded the value specified for the reserve size. The tool assumed size as the value of the commit size.


unresolved external symbol "symbol"
Linker Tools Warning LNK4016

unresolved external symbol "symbol"

The given externally referenced symbol could not be resolved.

This warning is followed by fatal error LNK1120.


keyword statement not supported; ignored
Linker Tools Warning LNK4017

keyword statement not supported; ignored

The given module-definition statement is not supported by this version of the linker tools. The tool ignored the statement in the .DEF file.


corrupt string table (table end); new end assumed
Linker Tools Warning LNK4019

corrupt string table (table end); new end assumed

The object file is corrupt. The tool attempted to correct the problem.

To prevent this warning, rebuild the object file.


object contains decorated symbol symbol
Linker Tools Warning LNK4022

cannot find unique match for symbol "symbol"

LINK or LIB found multiple matches for the given undecorated symbol. No output file (.EXE, .DLL, .EXP, or .LIB) is produced. This warning is followed by warning LNK4006.

To prevent this warning, specify the symbol in its decorated form. Run DUMPBIN on the object to see decorated names.


base address address not a 64K multiple; assumed newaddress
Linker Tools Warning LNK4023

base address address not a 64K multiple; assumed newaddress

The base address specified with the /BASE option must be a multiple of 64K. The tool assumed a newaddress value for the base address.


CVPACK error
Linker Tools Warning LNK4027

CVPACK error

LINK called CVPACK to process the debugging information, but one of the following occurred:

The call failed. Be sure that CVPACK is in a directory specified in the PATH environment variable and that there is sufficient memory.

CVPACK issued an error. Errors generated by CVPACK have the form CKnnnn.


invalid fixup found in comdat "name"; fixup failed
Linker Tools Warning LNK4029

invalid fixup found in comdat "name"; fixup failed

LINK's verification of a comdat fixup failed. This is probably due to a compiler problem. The resulting program may not run as expected.


invalid file offset number for category; category not dumped
Linker Tools Warning LNK4030

invalid file offset number for category; category not dumped

DUMPBIN could not display information for the given category. Probably the file is invalid or corrupt.


no subsystem specified; CONSOLE assumed
Linker Tools Warning LNK4031

no subsystem specified; CONSOLE assumed

The /SUBSYSTEM option was not specified, and LINK was not able to determine a subsystem from the input files.


converting object format from OMF to COFF
Linker Tools Warning LNK4033

converting object format from OMF to COFF

The format of the object file is OMF. This tool requres COFF input.

To permanently convert the file, run EDITBIN on the file with no options.


ordered function "symbol" not found in code section; ignored
Linker Tools Warning LNK4036

ordered function "symbol" not found in code section; ignored

The symbol could not be ordered using the /ORDER option because it does not belong in a code section. Probably the symbol is data.


ordered function "symbol" does not exist; ignored
Linker Tools Warning LNK4037

ordered function "symbol" does not exist; ignored

The symbol could not be ordered using the /ORDER option because it could not be found in the program. Check the specification of symbol in the ordering file.


displaying raw data in number units per line
Linker Tools Warning LNK4038

displaying raw data in number units per line

The /RAWDATA option was specified without a formatting argument. DUMPBIN assumed a format value of number units per line of the specified or assumed data type, as follows:

Data Type	number
none	16
BYTES	16
SHORTS	8
LONGS	4


section "name" does not exist
Linker Tools Warning LNK4039

section "name" does not exist

DUMPBIN or EDITBIN could not find a section called name in the input file.

To see the sections in a file, run DUMPBIN with the /HEADERS option.


corrupt string table (size); string table ignored
Linker Tools Warning LNK4040

corrupt string table (size); string table ignored

The string table in the object file is corrupt. The program may not run as expected. Rebuild the object file.


no edit options specified
Linker Tools Warning LNK4041

no edit options specified

EDITBIN was run on the input file, but no options were used.

If the file format was not COFF, EDITBIN attempted to convert it. Otherwise, EDITBIN took no action on the file.


object specified more than once; extras ignored
Linker Tools Warning LNK4042

object specified more than once; extras ignored

The same object file was specified more than once in the LINK or LIB command. The result is the same as if the file were specified only the first time.


unrecognized option "option"; ignored
Linker Tools Warning LNK4044

unrecognized option "option"; ignored

The given option is not a valid option for this tool. The tool ignored the option.

To see a list of valid options, run the tool with no arguments or options.


cannot edit library file "filename"; ignored
Linker Tools Warning LNK4047

cannot edit library file "filename"; ignored

EDITBIN cannot process a library file.


cannot edit invalid file "filename"; ignored
Linker Tools Warning LNK4048

cannot edit invalid file "filename"; ignored

EDITBIN could not process the given file because it was not a valid object file, executable file, or dynamic-link library (DLL).


exported symbol "symbol" also imported
Linker Tools Warning LNK4049

exported symbol "symbol" also imported

The symbol was both exported from and imported to the program.

This warning is displayed when the LINK warning level (set by the /WARN option) is greater than 1.


extra delimiter in /EXPORT specification
Linker Tools Warning LNK4051

extra delimiter in /EXPORT specification

The specification of the /EXPORT option ended with a comma (,).


using .EXP file; ignoring .DEF file "filename"
Linker Tools Warning LNK4052

using .EXP file; ignoring .DEF file "filename"

The .DEF file specified in the LINK command was ignored because an .EXP file was also specified. The .DEF file was already processed when the .EXP file was created and is not necessary in this step of the build process.


IMPORTS statement not supported; ignored
Linker Tools Warning LNK4053

IMPORTS statement not supported; ignored

The IMPORTS statement is not supported by this version of the linker tools. The tool ignored the statement in the .DEF file.


invalid fixup found, address address; fixup ignored
Linker Tools Warning LNK4055

invalid fixup found, address address; fixup ignored

The object contained an invalid fixup. The resulting executable file will probably not run correctly.

Rebuild the object file.


extra arguments ignored for option "option"
Linker Tools Warning LNK4056

extra arguments ignored for option "option"

The option was specified with too many arguments. The additional arguments were ignored.


checksum set to 0 (calculation not supported on this OS)
Linker Tools Warning LNK4057

checksum set to 0 (calculation not supported on this OS)

The checksum can be calculated only when running on Windows NT.


resourcefile already specified; additional resource file ignored
Linker Tools Warning LNK4058

resourcefile already specified; additional resource file ignored

Only one resource file is allowed. The first .RES file specified in the command was used.


stub file missing full MS-DOS header; relink stub with /KNOWEAS
Linker Tools Warning LNK4060

stub file missing full MS-DOS header; relink stub with /KNOWEAS

The MS-DOS application specified with the /STUB option does not have a full 40-byte header. The stub program may not run as expected.

To rebuild the 16-bit stub with a full 40-byte header, use the undocumented /KNOWEAS option with the 16-bit LINK version 5.5x or higher.


NMAKE Errors
NMAKE 1.30 Errors

Fatal Errors		Error	Warnings
U1000	U1056	U2001	U4001
U1001	U1057		U4002
U1002	U1058		U4004
U1003	U1059		U4005
U1004	U1060		U4006
U1005	U1061		U4007
U1006	U1062		U4008
U1007	U1063		U4010
U1017	U1064		U4011
U1018	U1065
U1019	U1069
U1020	U1070
U1021	U1071
U1022	U1072
U1023	U1073
U1024	U1076
U1031	U1077
U1033	U1078
U1034	U1079
U1035	U1080
U1036	U1081
U1037	U1082
U1038	U1083
U1039	U1084
U1040	U1085
U1041	U1086
U1042	U1087
U1043	U1088
U1045	U1089
U1047	U1090
U1048	U1092
U1049	U1093
U1050	U1094
U1051	U1095
U1052	U1096
U1053	U1097
U1054	U1098
U1055	U1099


syntax error : ')' missing in macro invocation
NMAKE Fatal Error U1000

syntax error : ')' missing in macro invocation

A left parenthesis, (, appeared without a matching right parenthesis, ), in a macro invocation. The correct form is $(name); $n is allowed for one-character names.


syntax error : illegal character 'character' in macro
NMAKE Fatal Error U1001

syntax error : illegal character 'character' in macro

The given character appeared in a macro but was not a letter, number, or underscore (_).

If the colon (:) is omitted in a macro expansion, the following error occurs:

syntax error : illegal character '=' in macro


syntax error : invalid macro invocation '$'
NMAKE Fatal Error U1002

syntax error : invalid macro invocation '$'

A single dollar sign ($) appeared without a macro name associated with it.

The correct form is $(name). To specify a dollar sign, use a double dollar sign ($$) or precede it with a caret (^).


syntax error : '=' missing in macro
NMAKE Fatal Error U1003

syntax error : '=' missing in macro

A macro invocation contained a colon (:), which begins a substitution, but it did not contain an equal sign (=).

The correct form is:

$(macroname:oldstring=newstring)


syntax error : macro name missing
NMAKE Fatal Error U1004

syntax error : macro name missing

One of the following occurred:

The name of a macro being defined was itself a macro invocation that expanded to nothing. For example, if the macro named ONE is undefined or has a null value, the following macro definition causes this error:

$(ONE)=TWO

A macro invocation did not specify a name in the parentheses. The following specification causes this error:

$()

The syntax for using a macro is:

$(name)


syntax error : text must follow ':' in macro
NMAKE Fatal Error U1005

syntax error : text must follow ':' in macro

A string substitution was specified for a macro, but the string to be changed in the macro was not specified.


syntax error : missing closing double quotation mark
NMAKE Fatal Error U1006

syntax error : missing closing double quotation mark

An opening double quotation mark (") appeared without a closing double quotation mark.


double quotation mark not allowed in name
NMAKE Fatal Error U1007

double quotation mark not allowed in name

The specified target name or filename contained a double quotation mark (").

Double quotation marks can surround a filename but cannot be contained within it.


unknown directive '!directive'
NMAKE Fatal Error U1017

unknown directive '!directive'

The specified directive is not one of the recognized directives.


directive and/or expression part missing
NMAKE Fatal Error U1018

directive and/or expression part missing

The directive was incompletely specified.

The expression part of the directive is required.


too many nested !IF blocks
NMAKE Fatal Error U1019

too many nested !IF blocks

The limit on nesting of !IF directives was exceeded.

The !IF preprocessing directives include !IF, !IFDEF, !IFNDEF, !ELSE IF, !ELSE IFDEF, and !ELSE IFNDEF.


end-of-file found before next directive
NMAKE Fatal Error U1020

end-of-file found before next directive

An expected directive was missing.

For example, an !IF was not followed by an !ENDIF.


syntax error : !ELSE unexpected
NMAKE Fatal Error U1021

syntax error : !ELSE unexpected

An !ELSE directive was found that was not preceded by an !IF directive, or the directive was placed in a syntactically incorrect place.

The !IF preprocessing directives include !IF, !IFDEF, !IFNDEF, !ELSE IF, !ELSE IFDEF, and !ELSE IFNDEF.


missing terminating character for string/program invocation : 'char'
NMAKE Fatal Error U1022

missing terminating character for string/program invocation : 'char'

One of the following occurred:

The closing double quotation mark (") in a string comparison in a directive was missing.

The closing bracket (]) in a program invocation in a directive was missing.


syntax error in expression
NMAKE Fatal Error U1023

syntax error in expression

An expression was invalid.

Check the allowed operators and operator precedence.


illegal argument to !CMDSWITCHES
NMAKE Fatal Error U1024

illegal argument to !CMDSWITCHES

An unrecognized command switch was specified.


filename missing (or macro is null)
NMAKE Fatal Error U1031

filename missing (or macro is null)

An !INCLUDE directive was found, but the name of the file to be included was missing or a macro representing the filename expanded to nothing.


syntax error : 'string' unexpected
NMAKE Fatal Error U1033

syntax error : 'string' unexpected

The given string is not part of the valid syntax for a makefile.

The following are examples of causes and results of this error:

If the closing set of angle brackets (<<) for an inline file are not at the beginning of a line, the following error occurs:

syntax error : 'EOF' unexpected

If a macro definition in the makefile contained an equal sign (=) without a preceding name or if the name being defined is a macro that expands to nothing, the following error occurs:

syntax error : '=' unexpected

If the semicolon (;) in a comment line in TOOLS.INI is not at the beginning of the line, the following error occurs:

syntax error : ';' unexpected

If the makefile has been formatted by a word processor, the following error can occur:

syntax error : ':' unexpected


syntax error : separator missing
NMAKE Fatal Error U1034

syntax error : separator missing

The colon (:) that separates targets and dependents is missing.


syntax error : expected ':' or '=' separator
NMAKE Fatal Error U1035

syntax error : expected ':' or '=' separator

Either a colon (:) or an equal sign (=) was expected.

Possible causes include the following:

A target was not followed by a colon.

A single-letter target was followed by a colon and no space (such as a:). NMAKE interpreted it as a drive specification.

An inference rule was not followed by a colon.

A macro definition was not followed by an equal sign.

A character followed a backslash (\) that was used to continue a command to a new line.

A string appeared that did not follow any NMAKE syntax rule.

The makefile was formatted by a word processor.


syntax error : too many names to left of '='
NMAKE Fatal Error U1036

syntax error : too many names to left of '='

Only one string is allowed to the left of a macro definition.


syntax error : target name missing
NMAKE Fatal Error U1037

syntax error : target name missing

A colon (:) was found before a target name was found.

At least one target is required.


internal error : lexer
NMAKE Fatal Error U1038

internal error : lexer

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


internal error : parser
NMAKE Fatal Error U1039

internal error : parser

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


internal error : macro expansion
NMAKE Fatal Error U1040

internal error : macro expansion

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


internal error : target building
NMAKE Fatal Error U1041

internal error : target building

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


internal error : expression stack overflow
NMAKE Fatal Error U1042

internal error : expression stack overflow

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


internal error : temp file limit exceeded
NMAKE Fatal Error U1043

internal error : temp file limit exceeded

Note the circumstances of the error and notify Microsoft Corporation by following the instructions in the Technical Support help file or the "Microsoft Support Services" section in one of your manuals.


spawn failed : message
NMAKE Fatal Error U1045

spawn failed : message

A program or command, called by NMAKE, failed for the given reason.


argument before ')' expands to nothing
NMAKE Fatal Error U1047

argument before ')' expands to nothing

The parentheses following the preprocessing operator DEFINED or EXIST either were empty or contained an argument that evaluated to a null string.


cannot write to file 'filename'
NMAKE Fatal Error U1048

cannot write to file 'filename'

NMAKE could not write to the given file.

One cause of this error is a read-only file specified with /X.


macro or inline file too long (maximum : 64K)
NMAKE Fatal Error U1049

macro or inline file too long (maximum : 64K)

An inline file or a macro exceeded the limit of 64K.


message
NMAKE Fatal Error U1050

message

The message specified with the !ERROR directive was displayed.


out of memory
NMAKE Fatal Error U1051

out of memory

NMAKE ran out of memory, including virtual memory, because the makefile was too large or complex.

One of the following may be a solution:

Free some space on disk.

Increase the size of the Windows NT paging file or the Windows swap file.

If only part of the makefile is being used, either divide the makefile into separate files or use !IF preprocessing directives to limit the amount that NMAKE must process. The !IF directives include !IF, !IFDEF, !IFNDEF, !ELSE IF, !ELSE IFDEF, and !ELSE IFNDEF.


file 'filename' not found
NMAKE Fatal Error U1052

file 'filename' not found

NMAKE could not find the given file, which was specified with one of the following:

The /F option

The !INCLUDE preprocessing directive

The at sign (@) specifier for a response file

Check that the file exists and the filename is spelled correctly.


file 'filename' unreadable
NMAKE Fatal Error U1053

file 'filename' unreadable

The file cannot be read.

One of the following may be a cause:

The file is in use by another process.

A bad area exists on disk.

A bad file-allocation table exists.


cannot create inline file 'filename'
NMAKE Fatal Error U1054

cannot create inline file 'filename'

NMAKE failed to create the given inline file.

One of the following may be a cause:

A file by that name exists with a read-only attribute.

The disk is full.


out of environment space
NMAKE Fatal Error U1055

out of environment space

The operating system ran out of room for environment variables.

Either increase the environment space or set fewer environment variables.


cannot find command processor
NMAKE Fatal Error U1056

cannot find command processor

The command processor was not in the path specified in the COMSPEC or PATH environment variables.

NMAKE uses COMMAND.COM or CMD.EXE as a command processor when executing commands. It looks for the command processor first in the path set in COMSPEC. If COMSPEC does not exist, NMAKE searches the directories specified in PATH.


cannot delete temporary file 'filename'
NMAKE Fatal Error U1057

cannot delete temporary file 'filename'

NMAKE failed to delete the temporary inline file.


terminated by user
NMAKE Fatal Error U1058

terminated by user

NMAKE was halted by CTRL+C or CTRL+BREAK.


syntax error : '}' missing in dependent
' missing in dependent NMAKE Fatal Error U1059

syntax error : '}' missing in dependent

A search path for a dependent was incorrectly specified. Either a space existed in the path or the closing brace (}) was omitted.

The syntax for a directory specification for a dependent is:

{directories}dependent

where directories specifies one or more paths, each separated by a semicolon (;). No spaces are allowed.

If part or all of a search path is replaced by a macro, be sure that no spaces exist in the macro expansion.


unable to close file : 'filename'
NMAKE Fatal Error U1060

unable to close file : 'filename'

NMAKE encountered an error while closing a file.

One of the following may be a cause:

The file is a read-only file.

There is a locking or sharing violation.

The disk is full.


/F option requires a filename
NMAKE Fatal Error U1061

/F option requires a filename

The /F command-line option must be followed by either a makefile name or a dash (-), which represents standard input.


missing filename with /X option
NMAKE Fatal Error U1062

missing filename with /X option

The /X command-line option requires the name of the file to which diagnostic error output should be redirected.

To use standard output, specify a dash (-) as the output filename.


missing macro name before '='
NMAKE Fatal Error U1063

missing macro name before '='

A macro definition on the NMAKE command line contained an equal sign (=) without a preceding name.

This error can occur if the macro name being defined is itself a macro that expands to nothing.


MAKEFILE not found and no target specified
NMAKE Fatal Error U1064

MAKEFILE not found and no target specified

The NMAKE command line did not specify a makefile or a target, and the current directory did not contain a file named MAKEFILE.

NMAKE requires either a makefile or a command-line target (or both). To make a makefile available to NMAKE, either specify the /F option or place a file named MAKEFILE in the current directory. NMAKE can create a command-line target by using an inference rule if a makefile is not provided.


invalid option 'option'
NMAKE Fatal Error U1065

invalid option 'option'

The specified option is not a valid option for NMAKE.


no match found for wildcard 'filename'
NMAKE Fatal Error U1069

no match found for wildcard 'filename'

There is no file that matches the given filename, which was specified using one or more wildcards (* and ?).

A target file that is specified using a wildcard must exist on disk.


cycle in macro definition 'macroname'
NMAKE Fatal Error U1070

cycle in macro definition 'macroname'

The given macro definition contained a macro whose definition contained the given macro. Circular macro definitions are invalid.

For example, the following macro definitions

ONE=$(TWO)

TWO=$(ONE)

cause the following error:

cycle in macro definition 'TWO'


cycle in dependency tree for target 'targetname'
NMAKE Fatal Error U1071

cycle in dependency tree for target 'targetname'

A circular dependency exists in the dependency tree for the given target. The given target is a dependent of one of the dependents of the given target. Circular dependencies are invalid.


cycle in include files : 'filename'
NMAKE Fatal Error U1072

cycle in include files : 'filename'

The given file includes a file that eventually includes the given file. Inclusions (using the !INCLUDE preprocessing directive) cannot be circular.


don't know how to make 'targetname'
NMAKE Fatal Error U1073

don't know how to make 'targetname'

The specified target does not exist, and there is no command to execute or inference rule to apply.

One of the following may be a solution:

Check the spelling of the target name.

If targetname is a pseudotarget, specify it as a target in another description block.

If targetname is a macro invocation, be sure it does not expand to a null string.


name too long
NMAKE Fatal Error U1076

name too long

A string exceeded one of the following limits:

A macro name cannot exceed 1024 characters.

A target name (including path) cannot exceed 256 characters.

A command cannot exceed 2048 characters.


'program' : return code 'value'
NMAKE Fatal Error U1077

'program' : return code 'value'

The given command or program called by NMAKE failed and returned the given exit code.

To suppress this error and continue the NMAKE session, use the /I option, the .IGNORE dot directive, or the dash (-) command modifier. To continue the NMAKE session for unrelated parts of the dependency tree, use the /K option.


constant overflow at 'expression'
NMAKE Fatal Error U1078

constant overflow at 'expression'

The given expression contained a constant that exceeded the range -2,147,483,648 to 2,147,483,647. The constant appeared in one of the following situations:

An expression specified with a preprocessing directive

An error level specified with the dash (-) command modifier


illegal expression : divide by zero
NMAKE Fatal Error U1079

illegal expression : divide by zero

An expression tried to divide by zero.


operator and/or operand usage illegal
NMAKE Fatal Error U1080

operator and/or operand usage illegal

The expression incorrectly used an operator or operand.

Check the allowed set of operators and their order of precedence.


'filename' : program not found
NMAKE Fatal Error U1081

'filename' : program not found

NMAKE could not find the given program in order to run it.

Make sure that the program is in a directory specified in the PATH environment variable and is not misspelled.


'command' : cannot execute command; out of memory
NMAKE Fatal Error U1082

'command' : cannot execute command; out of memory

There is not enough memory to execute the given command.

One solution is to use the /N option to generate a batch file, then run the batch file instead of using NMAKE. In most cases the results will be the same.


target macro 'target' expands to nothing
NMAKE Fatal Error U1083

target macro 'target' expands to nothing

The given target is an invocation of a macro that has not been defined or has a null value. NMAKE cannot process a null target.


cannot create temporary file 'filename'
NMAKE Fatal Error U1084

cannot create temporary file 'filename'

NMAKE was unable to create the temporary file it needs when it processes the makefile.

One of the following may be a cause:

The file already exists with a read-only attribute.

There is insufficient disk space to create the file.

The directory specified in the TMP environment variable does not exist.


cannot mix implicit and explicit rules
NMAKE Fatal Error U1085

cannot mix implicit and explicit rules

A target and a pair of inference-rule extensions were specified on the same line. Targets cannot be named in inference rules.


inference rule cannot have dependents
NMAKE Fatal Error U1086

inference rule cannot have dependents

The colon (:) in an inference rule must be followed by one of the following:

A newline character

A semicolon (;), which can be followed by a command

A number sign (#), which can be followed by a comment


cannot have : and :: dependents for same target
NMAKE Fatal Error U1087

cannot have : and :: dependents for same target

A target cannot be specified in both a single-colon (:) and a double-colon (::) dependency.

To specify a target in multiple description blocks, use :: in each dependency line.


invalid separator '::' on inference rule
NMAKE Fatal Error U1088

invalid separator '::' on inference rule

An inference rule must be followed by a single colon (:).


cannot have build commands for directive 'targetname'
NMAKE Fatal Error U1089

cannot have build commands for directive 'targetname'

Dot directives cannot be followed by commands. The dot directives are .IGNORE, .PRECIOUS, .SILENT, and .SUFFIXES.


cannot have dependents for directive 'targetname'
NMAKE Fatal Error U1090

cannot have dependents for directive 'targetname'

Dot directives cannot be followed by dependents. The dot directives are .IGNORE, .PRECIOUS, .SILENT, and .SUFFIXES.


too many names in rule
NMAKE Fatal Error U1092

too many names in rule

An inference rule cannot specify more than two extensions.


cannot mix dot directives
NMAKE Fatal Error U1093

cannot mix dot directives

Multiple dot directives cannot be specified on one line. The dot directives are .IGNORE, .PRECIOUS, .SILENT, and .SUFFIXES.


syntax error : only (NO)KEEP allowed here
NMAKE Fatal Error U1094

syntax error : only (NO)KEEP allowed here

Something other than KEEP or NOKEEP appeared after the closing set of angle brackets (<<) specifying an inline file. Only KEEP, NOKEEP, or a newline character may follow the angle brackets. No spaces, tabs, or other characters may appear.

KEEP preserves the inline file on disk. NOKEEP deletes the file after the NMAKE session. The default is NOKEEP.


expanded command line 'commandline' too long
NMAKE Fatal Error U1095

expanded command line 'commandline' too long

After macro expansion, the given command line exceeded the limit on length of command lines for the operating system.

MS-DOS permits up to 128 characters on a command line.

If the command is for a program that can accept command-line input from a file, change the command and supply input from either a file on disk or an inline file. For example, LINK and LIB accept input from a response file.


cannot open inline file 'filename'
NMAKE Fatal Error U1096

cannot open inline file 'filename'

NMAKE could not create the given inline file.

One of the following occurred:

The disk was full.

A file with that name exists as a read-only file.


filename-parts syntax requires dependent
NMAKE Fatal Error U1097

filename-parts syntax requires dependent

The current dependency does not have either an explicit dependent or an implicit dependent. Filename-parts syntax, which uses the percent (%) specifier, represents components of the first dependent of the current target.


illegal filename-parts syntax in 'string'
NMAKE Fatal Error U1098

illegal filename-parts syntax in 'string'

The given string does not contain valid filename-parts syntax.


stack overflow
NMAKE Fatal Error U1099

stack overflow

The makefile being processed was too complex for the current stack allocation in NMAKE. NMAKE has an allocation of 0x3000 (12K).

To increase NMAKE's stack allocation, run the EXEHDR utility with a larger stack option:

EXEHDR /STACK:stacksize NMAKE.EXE

where stacksize is a number greater than the current stack allocation in NMAKE.


no more file handles (too many files open)
NMAKE Error U2001

no more file handles (too many files open)

NMAKE could not find a free file handle.

One of the following may be a solution:

Reduce recursion in the build procedures.

In MS-DOS, increase the number of file handles by changing the FILES setting in CONFIG.SYS to allow a larger number of open files. FILES=50 is the recommended setting.


command file can be invoked only from command line
NMAKE Warning U4001

command file can be invoked only from command line

A command file, which is invoked by the at sign (@) specifier, cannot contain a specification for another command file. Such nesting is not allowed. The specification was ignored.


resetting value of special macro 'macroname'
NMAKE Warning U4002

resetting value of special macro 'macroname'

The given predefined macro was redefined.


too many rules for target 'targetname'
NMAKE Warning U4004

too many rules for target 'targetname'

More than one description block was specified for the given target using single colons (:) as separators. NMAKE executed the commands in the first description block and ignored later blocks.

To specify the same target in multiple dependencies, use double colons (::) as the separator in each dependency line.


ignoring rule 'rule' (extension not in .SUFFIXES)
NMAKE Warning U4005

ignoring rule 'rule' (extension not in .SUFFIXES)

The given rule contained a suffix that is not specified in the .SUFFIXES list. NMAKE ignored the rule.

This warning appears only when the /P option is used.


special macro undefined : 'macroname'
NMAKE Warning U4006

special macro undefined : 'macroname'

The given special macro name is undefined and expands to nothing.


filename 'filename' too long; truncating to 8.3
NMAKE Warning U4007

filename 'filename' too long; truncating to 8.3

The base name of the given file has more than eight characters, or the extension has more than three characters. NMAKE truncated the name to an eight-character base and a three-character extension.

If long filenames are supported by your file system, enclose the name in double quotation marks (").


removed target 'target'
NMAKE Warning U4008

removed target 'target'

NMAKE was interrupted while trying to build the given target, and the target file was incomplete. Because the target was not specified in the .PRECIOUS list, NMAKE deleted the file.


'target' : build failed; /K specified, continuing ...
NMAKE Warning U4010

'target' : build failed; /K specified, continuing ...

A command in the commands block for the given target returned a nonzero exit code. The /K option told NMAKE to continue processing unrelated parts of the build and to issue an exit code 1 when the NMAKE session is finished.

If the given target is itself a dependent for another target, NMAKE issues warning U4011 after this warning.


'target' : not all dependents available; target not built
NMAKE Warning U4011

'target' : not all dependents available; target not built

A dependent of the given target either did not exist or was out-of-date, and a command for updating the dependent returned a nonzero exit code. The /K option told NMAKE to continue processing unrelated parts of the build and to issue an exit code 1 when the NMAKE session is finished.

This warning is preceded by warning U4010 for each dependent that failed to be created or updated.