Game Development Community

Building in Xcode

by Seth Willits · in Torque Game Engine · 11/09/2005 (10:23 pm) · 13 replies

*Enter the total TNL newbie*

I'm thinking of using TNL in one of my non-Torque related projects but I'm seeing a curious handful of errors relating to "*begin();" and "*end();" such as line 302 in tnlVector.h

tnlVector.h:302: error: there are no arguments to 'begin' that depend on a template parameter, so a declaration of 'begin' must be available
tnlVector.h:302: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)


Hopefully this forum isn't so dead that no one can offer some insight into what this is etc. :^)

#1
11/13/2005 (8:29 pm)
I'm seeing the same problem, and haven't seen a good solution either.

I'm pretty surprised that this forum isn't more active. Hopefully, someone at GG will see the posts here and come back with something helpful.

It'd be nice if TNL builds right from CVS without us having to research a solution.
#2
11/13/2005 (11:47 pm)
Well, I'm still confused by why begin and end are there. It's a little strange. I commented them out and got the same error with TNLAssert which was because the include for it was missing from tnlVector.h. It's almost as if tnl Vector was based on another class which implemented begin and end...
#3
11/14/2005 (12:57 am)
It isn't; have you tried using the -fpermissive parameter? :)

(GCC is quite picky, and we do most of our development on VC7, so things tend to get a little out of date. We compile Torque as permissive without issue, so it seems a safe bet here.)
#4
11/14/2005 (4:30 am)
Yes, I put the -fpermissive in the mix, and I went from a handful of errors, up to over twenty in another section of the code.
#5
12/14/2005 (6:53 pm)
@Ben: Do y'all have a working, buildable project for XCode 2.1? I couldn't get it to work properly. Considering it's xplat, it really should.

I know you do most of your dev on VC7, but I'm primarily on OS X and would really love to have a standalone server for various tasks using TNL.

Thanks.
#6
12/14/2005 (7:56 pm)
Ditto.
#7
12/14/2005 (8:04 pm)
Seth, do you own a license? I do. I haven't gotten it to build yet. *sigh*
#8
12/14/2005 (8:36 pm)
For TNL specifically? No -- Just looking for a working build.
#9
01/16/2006 (4:39 pm)
Is there any way to get it to build? Any hacks?
#10
01/16/2006 (5:02 pm)
If anyone knows how, I'd love to hear it. GG's been silent and I don't know of any updates, so I'd consider it a dead product for the Mac.
#11
01/18/2006 (12:09 pm)
So I know this is probably not helpful, but I noticed that none of the rest of the TNL code uses the function first and end in TnlVector, so what I did was just comment the 5 offending lines. Then there was one other line of a TNL assert that causes a error. So I went with my method again and commented that out. I know its bad. Anyway I was able to get both the tnl lib and the crypto lib to compile. So then I added it to my existing code from another project and I was able to get TNL working on my Mac. There are probably some serious issues to what I did but it seem to work. I wrote up the sample hello world app So I know this is probably not helpful, but I noticed that none of the rest of the TNL code uses the function first and end in TnlVector, so what I did was just comment the 5 offending lines. Then there was one other line of a TNL assert that causes a error. So I went with my method again and commented that out. I know its bad. Anyway I was able to get both the tnl lib and the crypto lib to compile. So then I added it to my existing code from another project and I was able to get TNL working on my Mac. There are probably some serious issues to what I did but it seem to work. I wrote up the sample hello world app and it worked. I was not able to get the Examples to work at all.

*This is not a fix just a quick work around*, If you use the TnlVector a bunch then this might not work for you. :)
#12
05/19/2007 (12:20 pm)
Another problem I encountered was in MyOpenGLView.mm. The errors:

/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:35: error: expected class-name before '{' token
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:77: warning: 'MyOpenGLView' may not respond to '-restartAsClient:'
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:77: warning: (Messages without a matching method signature
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:102: error: 'U32' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:102: error: expected ')' before 'rect'
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:104: error: 'U32' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:104: error: expected ')' before 'rect'
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:133: error: 'IPProtocol' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:133: error: 'Address' has not been declared
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:133: error: 'Any' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:133: error: 'Address' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:143: error: 'IPProtocol' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:143: error: 'Address' has not been declared
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:143: error: 'Any' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:143: error: 'Address' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:152: error: 'IPProtocol' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:152: error: 'Address' has not been declared
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:152: error: 'Any' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:152: error: 'Address' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:160: error: 'IPProtocol' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:160: error: 'Address' has not been declared
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:160: error: 'Any' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:160: error: 'Address' was not declared in this scope
/Users/seth/Desktop/tnl/osx/MyOpenGLView.mm:162: error: 'Address' is not a class or namespace

I fixed it by adding a namespace directive:

#include <OpenGL/gl.h>
#import "MyOpenGLView.h"
#include "testGame.h"

using namespace TNL;

class TestGameLog : public LogConsumer
{
   ...
#13
05/19/2007 (12:25 pm)
Okay another bug in MyOpenGLView.mm is that it within initWithFrame it sets "self" as a target for the NSTimer BEFORE it initializes itself ([super initWithFrame...]). Bad juju.

Fix:

- (id) initWithFrame: (NSRect) frame
{
	GLuint attribs[] = 
	{
		NSOpenGLPFANoRecovery,
		NSOpenGLPFAWindow,
		NSOpenGLPFAAccelerated,
		NSOpenGLPFADoubleBuffer,
		NSOpenGLPFAColorSize, 24,
		NSOpenGLPFAAlphaSize, 8,
		NSOpenGLPFADepthSize, 24,
		NSOpenGLPFAStencilSize, 8,
		NSOpenGLPFAAccumSize, 0,
		0
	};
	
	NSOpenGLPixelFormat* fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*) attribs]; 
	
	if (!fmt)
		NSLog(@"No OpenGL pixel format");

	theLog = new TestGameLog(self);
	[self restartAsClient:self];   
	
	
	if (!(self = [super initWithFrame:frame pixelFormat: [fmt autorelease]])) {
		[self release];
		NSLog(@"Could not initialize MyOpenGLView");
		return nil;
	}
	
	[NSTimer scheduledTimerWithTimeInterval: 0.02 target: self selector:@selector(tick) userInfo:NULL repeats: true];
	
	return self;
}