Open source game engine

Forums

Guest  

Welcome Guest, posting in this forum requires registration.

Pages: [1]
Topic: Compiling Hello World?
BirdaoGwra
Member
Posts: 1
Compiling Hello World?
on: April 13, 2011, 03:54

Hi,

I just downloaded the KGE 0.0.6 from kge3d.org. And when I tryed to compile the hello world I got this error.


CMain.cpp

d:kochol game engine.0.6includekgeunknown.h(45) : error C2664: 'InterlockedIncrement' : cannot convert parameter 1 from 'volatile long *' to 'long *'

Conversion loses qualifiers

d:kochol game engine.0.6includekgeunknown.h(55) : error C2664: 'InterlockedDecrement' : cannot convert parameter 1 from 'volatile long *' to 'long *'

Conversion loses qualifiers

d:kochol game engine.0.6includemathvector.h(240) : fatal error C1506: unrecoverable block scoping error

Error executing cl.exe.


Kochol Test.exe – 3 error(s), 0 warning(s)


Could you kindly tell me what does it mean. I have VC6.


Thanks in advance

Regards


admin
Administrator
Posts: 19
Re: Compiling Hello World?
on: April 14, 2011, 20:54

Hello

I never tested KGE on VC 6 but it seems VC 6 dose not support volatile.

You can change the KgeUnknown class AddRef & DecRef functions to below code.


We will fix this problem with next release.


	

//! Add a refrence to the object.
void AddRef()
{
++m_iRefrenceCount;
} // AddRef

//! Decrease a refrence from the object. if its refrence count get 0 then the object will destroy.
void DecRef()
{
--m_iRefrenceCount;
if (m_iRefrenceCount == 0)
{
delete this;
}

} // DecRef

for more info on volatile see this link

http://msdn.microsoft.com/en-us/library/12a04hfd%28v=vs.80%29.aspx


Pages: [1]
WP Forum Server by ForumPress | LucidCrew
Version: 1.7.5 ; Page loaded in: 0.016 seconds.

Comments are closed.