Newton Example Compile Error

Discussion about everything. New games, 3d math, development tips...
Post Reply
dazedandconfused
Posts: 16
Joined: Wed Nov 29, 2006 1:41 am

Newton Example Compile Error

Post by dazedandconfused »

Hey guys,

Any one had problems compiling newton examples.

I get the following:
------ Build started: Project: Tutorial_01_GettingStarted, Configuration: Debug Win32 ------

Compiling...
RenderPrimitive.cpp
d:\SDK\Newton\samples\common\OpenGlUtil.h(23) : error C2146: syntax error : missing ';' before identifier 'g_cubeTexture'
d:\SDK\Newton\samples\common\OpenGlUtil.h(23) : error C2501: 'g_cubeTexture' : missing storage-class or type specifiers
d:\SDK\Newton\samples\common\OpenGlUtil.h(24) : error C2146: syntax error : missing ';' before identifier 'g_ballTexture'
d:\SDK\Newton\samples\common\OpenGlUtil.h(24) : error C2501: 'g_ballTexture' : missing storage-class or type specifiers
d:\SDK\Newton\samples\common\OpenGlUtil.h(25) : error C2146: syntax error : missing ';' before identifier 'g_floorTexture'
d:\SDK\Newton\samples\common\OpenGlUtil.h(25) : error C2501: 'g_floorTexture' : missing storage-class or type specifiers
d:\SDK\Newton\samples\common\OpenGlUtil.h(26) : error C2146: syntax error : missing ';' before identifier 'g_buggyTexture'
d:\SDK\Newton\samples\common\OpenGlUtil.h(26) : error C2501: 'g_buggyTexture' : missing storage-class or type specifiers
d:\SDK\Newton\samples\common\OpenGlUtil.h(27) : error C2146: syntax error : missing ';' before identifier 'g_tireTexture'
d:\SDK\Newton\samples\common\OpenGlUtil.h(27) : error C2501: 'g_tireTexture' : missing storage-class or type specifiers
d:\SDK\Newton\samples\common\OpenGlUtil.h(41) : error C2061: syntax error : identifier 'GLuint'
d:\SDK\Newton\samples\toolBox\dGeometry.h(23) : error C2146: syntax error : missing ';' before identifier 'm_texture'
d:\SDK\Newton\samples\toolBox\dGeometry.h(23) : error C2501: 'dGeometrySegment::GLuint' : missing storage-class or type specifiers
d:\SDK\Newton\samples\toolBox\dGeometry.h(23) : error C2501: 'dGeometrySegment::m_texture' : missing storage-class or type specifiers
d:\SDK\Newton\samples\toolBox\dGeometry.h(26) : error C2143: syntax error : missing ';' before '*'
d:\SDK\Newton\samples\toolBox\dGeometry.h(26) : error C2501: 'dGeometrySegment::GLfloat' : missing storage-class or type specifiers
d:\SDK\Newton\samples\toolBox\dGeometry.h(26) : error C2501: 'dGeometrySegment::m_uv' : missing storage-class or type specifiers
d:\SDK\Newton\samples\toolBox\dGeometry.h(27) : error C2143: syntax error : missing ';' before '*'
d:\SDK\Newton\samples\toolBox\dGeometry.h(27) : error C2501: 'dGeometrySegment::GLfloat' : missing storage-class or type specifiers
d:\SDK\Newton\samples\toolBox\dGeometry.h(27) : error C2501: 'dGeometrySegment::m_vertex' : missing storage-class or type specifiers
Followed by around 300 errors.

I am using visuial studio 2003, I think the include and library paths are ok.
I am trying to compile the examples (unmodified) straight out the box.

I have tried the first 3 or 4 examples, and all similar problems, nothing compiles.

Thanks in advance :lol:
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Here's two threads where I sorted out problems people had with Irrlicht/Newton:

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=17007

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=17137
dazedandconfused
Posts: 16
Joined: Wed Nov 29, 2006 1:41 am

Post by dazedandconfused »

Hi,

I'm not sure those threads are the problem.

I cant see anything about missing files.

I have checked my include and library paths, and they seem ok.
I have also changed the order of the paths, but nothing will compile.

Image

Image
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Looks like another "stdafx" issue, as mentioned in the first thread.

The build log in your first post states "syntax error : missing ';' before identifier 'g_cubeTexture'". The "#include <stdafx.h> in OpenGLUtil.h refers to a stdafx.h file that includes gl.h, which has the required define for GLuint.

What you need to do is sort out your precompiled headers.

Or you could just include gl.h in the file thats missing the defines. You'll probably have issues elsewhere, though, so I'd sort out the PCH's.
dazedandconfused
Posts: 16
Joined: Wed Nov 29, 2006 1:41 am

Post by dazedandconfused »

HI,

thanks for the answer, but I am confused.

firstly there is no "gl.h" file in the SDK.
I tried adding this to stdafx.h in the example, and it would not compile either. (not found)

and there are no precompiled headers, what do I need to do :cry:

I know this will teach me some stuff, but do I really need all this trouble.
I just want to add the newtons library to an irrlicht project.

But that is also another problem, about some DLL not working with Visual 2003.

I just wanted to make sure newtons compiles and runs, before moving on to using it in irrlicht.

So I could rule out newton as being the problem
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Worked OK for me. I opened the tutorials in VS2005, it converted the project and I built Tutorial1.

Go and download Newton 1.53 and install it to the default location. Open the tutorials project and see if you can build (you'll need to clean up the include/lib folder locations).
Post Reply