Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Problems compiling egtb code using VS.NET 2003

Author: Koundinya Veluri

Date: 18:20:21 09/11/03

Go up one level in this thread


On September 11, 2003 at 19:55:25, Dann Corbit wrote:

>On September 11, 2003 at 16:07:09, Koundinya Veluri wrote:
>
>>On September 11, 2003 at 15:09:40, Dann Corbit wrote:
>>
>>>Try always including <windows.h> first of all.
>>>I have found that (inexplicably) this cures many problems of this nature.
>>
>>Thanks, this works :)
>>I'll probably end up wasting time trying to find out why though.
>
>If you find out, tell me.  I discovered it by accident.  I don't know the reason
>behind it.
>
>But for any VS .NET 2003 C++ project that needs Win32 system services of any
>sort, I always include <windows.h> first of all.

Think I have an idea why it's happening. In TBIndex.h near the top:

#if defined (SMP)
static	lock_t	lockLRU;
#else
#define	LockInit(x)
#define Lock(x)
#define UnLock(x)
#endif

If windows.h is included before this then all good; if included afterwards it
fails. ObjIdl.h declares a pure virtual function Lock in an interface class. So
basically, this is what's happening:

#define f()

class A
{
public:
    virtual void f() = 0;
};

int main()
{
    return 0;
}

This doesn't compile and gives me the same errors. On the other hand, the
following does compile:

class A
{
public:
    virtual void f() = 0;
};

#define f()

int main()
{
    return 0;
}

I'm not sure what the standard says on this, but my feeling is that they should
both compile. Technically, both pieces of code are identical. It seems to be a
bug in the compiler or preprocessor.

Regards,
Koundinya



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.