Sign in to follow this  
bory

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 this post


Link to post
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 this post


Link to post
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 this post


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

Share this post


Link to post
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;
unsigned short address;
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 this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this