Skip to main content
gamedev.net
🔒 Locked

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

Started by bory May 27, 2005 at 8:58 AM 4 replies 550+ views
Original Post
bory
bory
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
Illco
Illco
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
bory
bory
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
Illco
Illco
Ok that's more interesting perhaps. Maybe you can post an excerpt of the source around the error?
bory
bory
In one of my header files I use
#include and that's were the problem begins.
For example later in the file I have:
struct SMessage
{
EMType messtype;
unsigned short address;
list 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 '<'

Dave Hunt
Dave Hunt
You should use '', not ''.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.