Jump to content
  • Advertisement
Sign in to follow this  
bory

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

This topic is 4897 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!