Compile error I can't seem to fix 
Author Message
 Compile error I can't seem to fix

This seems like a simple thing to do, but it won't compile in VC++6:
CList<Record, Record> recList;

for testing purposes, I tried the following as well, with the same results:
CList<CString, CString> recList;
CList<CString, &CString> recList;
CArray<Record, Record> recList;

The following errors are generated: (If this statement is removed, no errors
are generated)

error C2143: syntax error : missing ';' before '<'
error C2501: 'CList' : missing storage-class or type specifiers
error C2059: syntax error : '<'
error C2238: unexpected token(s) preceding ';'

It may also be of note that the errors always appear twice, in sequence,
referring to exactly the same line of code.

If anyone has an explanation or preferably a fix, it would be very much
appreciated.  If you need any further info, just ask.

Thanks,
Darrick



Fri, 13 Apr 2001 03:00:00 GMT  
 Compile error I can't seem to fix
Add the following include to your stdafx.h:

#include <afxtempl.h>

That should fix your compiler errors.

--
J. Keith Wedinger
Technical Specialist - The Limited, Inc.

http://www.serve.com/uccats

Quote:
>This seems like a simple thing to do, but it won't compile in VC++6:
>CList<Record, Record> recList;

>for testing purposes, I tried the following as well, with the same results:
>CList<CString, CString> recList;
>CList<CString, &CString> recList;
>CArray<Record, Record> recList;

>The following errors are generated: (If this statement is removed, no
errors
>are generated)

>error C2143: syntax error : missing ';' before '<'
>error C2501: 'CList' : missing storage-class or type specifiers
>error C2059: syntax error : '<'
>error C2238: unexpected token(s) preceding ';'

>It may also be of note that the errors always appear twice, in sequence,
>referring to exactly the same line of code.

>If anyone has an explanation or preferably a fix, it would be very much
>appreciated.  If you need any further info, just ask.

>Thanks,
>Darrick



Fri, 13 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help with compiling a "canned" program

2. Q291380 FIX: Redefinition Errors When You Compile an IDL File

3. i can't fix this error

4. FAQ "fix" seems very weak

5. Newbie - Compile error (Cannot open include file: 'xmldom.idl': No such file or directory)

6. compile error ( 'struct' redefinition )

7. Compile Error : 'class' type redefinition

8. Help Wnet API's don't seem to work under WINNT Service Control Manager

9. Can't compile - Error C1010 - Precompiled header?

10. error compiling Jeck Klein's getsafe function

11. HELP I'm having compile errors.

12. don't understand compile-time error

 

 
Powered by phpBB® Forum Software