# Visual C++.NET: Strange errors when compiling a program

## Recommended Posts

I'm trying to compile a program in Visual C++ .NET but I'm getting lots of errors. The problem is that none of these errors have to do with my program, they have to do with the .NET libraries. A few of the errors are... c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(37) : error C2146: syntax error : missing ';' before identifier 'Length' c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(37) : error C2501: '_LIST:WORD' : missing storage-class or type specifiers c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(37) : error C2501: '_LIST::Length' : missing storage-class or type specifiers Best regards, bory

##### Share on other sites
Many times when the error indicates a file not written by you, you can safely assume the error is yours. Effectively all profesionally distributed libraries have been compiled and will work. So, always suspect your own coding. Then, next, suspect your own coding. Continue to do that for about a week and then start suspecting other things.

Also, the error message tells you the error occurs before the specified location. Probably, the error is in one of your files just before the specified header file is included. If I may try a bold guess, it is probably like this:

// In some header file of yours:class SomeClassOfYours{}// Look: a semicolon is missing on the previous line!// In some cpp file of yours#include "someheaderfileofyours"#include "List.h"

Such code will generate said error. Good luck! Greetz,

Illco

##### Share on other sites
Yes, I assume that the error should be in my program, but if I compile the same program on another PC on which is installed the same Microsoft Visual Studio.NET 2003 it works ok.
I'll check again my code, thank you for your answer and time.

best regards,
bory

##### Share on other sites
Ok that's more interesting perhaps. Maybe you can post an excerpt of the source around the error?

##### Share on other sites
In one of my header files I use
#include <list.h> and that's were the problem begins.
For example later in the file I have:
struct SMessage
{
EMType messtype;
list <LInfo> info;
};
and first I have the errors :
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(37) : error C2146: syntax error : missing ';' before identifier 'Length'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(37) : error C2501: '_LIST::DWORD' : missing storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\List.h(37) : error C2501: '_LIST::Length' : missing storage-class or type specifiers
etc..
and after the errors for my header file wherever I use List:
z:coord.h(54) : error C2143: syntax error : missing ';' before '<'

##### Share on other sites
You should use '<list>', not '<list.h>'.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627735
• Total Posts
2978855

• 10
• 10
• 21
• 14
• 12