Re: Extending NSOpenGLView leads to strange compile error...
Re: Extending NSOpenGLView leads to strange compile error...
- Subject: Re: Extending NSOpenGLView leads to strange compile error...
- From: Wayne Packard <email@hidden>
- Date: Sun, 20 Apr 2008 02:29:30 -0700
What happens if you change
- (tetra)init;
to
- (id)init;
wp
On Apr 20, 2008, at 2:08 AM, Spam Tron wrote:
HI all -
I want to be able to extend the NSOpenGLView class to have a ptr to
some ptr
to an NSObject class (nothing too complicated I think?).
Here's the tetra.h file
//Tetra.h
//
// tetra.h
// myogl
//
// Created by shockwave on 4/2/08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
enum {
X=0, Y, Z
};
@interface tetra : NSObject {
@private
//the 3-D coords of the tetrahedron; they will be initialized
within a
unit cube
float vertices[4][3];
//colors of each face
float vert_colors[4][3];
//indirection indexes to draw the tetrahedron
char triangles[4][3];
//rotation angles (x, y, z)
float rot[3];
}
- (tetra)init;
- (float *)GetVertexPositions: (int)side :(int)idx;
- (void)IncRotation: (int)axis :(float)angle;
- (float *)Rot;
@end
//MyNSOpenGLview.h
#import <Cocoa/Cocoa.h>
#import "tetra.h"
@interface CMoglView : NSOpenGLView {
tetra *myTetra;
}
@end
When I try to compile this code I get these weird errors and warnings:
cd /Users/mycomputer/myogl
/Developer/usr/bin/gcc-4.0 -x objective-c -arch ppc -pipe -Wno-
trigraphs
-fpascal-strings -fasm-blocks -Os -mdynamic-no-pic -Wreturn-type
-Wunused-variable -fmessage-length=0 -mtune=G5 -fvisibility=hidden
-mmacosx-version-min=10.5 -gdwarf-2
-I/Users/mycomputer/src/builds/objs/myogl.build/Release/myogl.build/
myogl.hmap
-F/Users/mycomputer/src/builds/Release
-I/Users/mycomputer/src/builds/Release/include
-I/Users/mycomputer/src/builds/objs/myogl.build/Release/myogl.build/
DerivedSources
-isysroot /Developer/SDKs/MacOSX10.5.sdk -include
/Library/Caches/com.apple.Xcode.501/SharedPrecompiledHeaders/
myogl_Prefix-dhaifsjpxttfyafwyvevbztxhrgj/myogl_Prefix.pch
-c /Users/mycomputer/myogl/../src/MeinOGLView.m -o
/Users/mycomputer/src/builds/objs/myogl.build/Release/myogl.build/
Objects-normal/ppc/MeinOGLView.o
In file included from /Users/mycomputer/myogl/../src/MeinOGLView.h:2,
from /Users/mycomputer/myogl/../src/MeinOGLView.m:1:
*/Users/mycomputer/myogl/tetra.h:31: error: can not use an object as
parameter to a method*
from
/Users/mycomputer/myogl/../src/MeinOGLView.m:1:
In file included from
/Users/mycomputer/myogl/../src/MeinOGLView.h:2,
* /Users/mycomputer/myogl/tetra.h:31: error: can not
use an
object as parameter to a method*
cd /Users/mycomputer/myogl
/Developer/usr/bin/gcc-4.0 -x objective-c -arch ppc -pipe -Wno-
trigraphs
-fpascal-strings -fasm-blocks -Os -mdynamic-no-pic -Wreturn-type
-Wunused-variable -fmessage-length=0 -mtune=G5 -fvisibility=hidden
-mmacosx-version-min=10.5 -gdwarf-2
-I/Users/mycomputer/src/builds/objs/myogl.build/Release/myogl.build/
myogl.hmap
-F/Users/mycomputer/src/builds/Release
-I/Users/mycomputer/src/builds/Release/include
-I/Users/mycomputer/src/builds/objs/myogl.build/Release/myogl.build/
DerivedSources
-isysroot /Developer/SDKs/MacOSX10.5.sdk -include
/Library/Caches/com.apple.Xcode.501/SharedPrecompiledHeaders/
myogl_Prefix-dhaifsjpxttfyafwyvevbztxhrgj/myogl_Prefix.pch
-c /Users/mycomputer/myogl/tetra.m -o
/Users/mycomputer/src/builds/objs/myogl.build/Release/myogl.build/
Objects-normal/ppc/tetra.o
In file included from /Users/mycomputer/myogl/tetra.m:9:
*/Users/mycomputer/myogl/tetra.h:31: error: can not use an object as
parameter to a method*
/Users/mycomputer/myogl/tetra.m: In function '-[tetra init]':
*/Users/mycomputer/myogl/tetra.m:15: warning: conflicting types for
'-(id)init'
/Users/mycomputer/myogl/tetra.h:31: warning: previous declaration of
'-(tetra)init'
* In file included from /Users/mycomputer/myogl/tetra.m:9:
* /Users/mycomputer/myogl/tetra.h:31: error: can not use an
object as parameter to a method
/Users/mycomputer/myogl/tetra.m:15: warning: conflicting
types for
'-(id)init'
/Users/mycomputer/myogl/tetra.h:31: warning: previous
declaration of
'-(tetra)init'
*Build failed (2 errors, 2 warnings)
The errors don't make any sense to me as to why they're happening.
The
warnings neither, because the message names in the src are identical
in the
code.
So, any ideas why this isn't compiling, when it should??
Thanks, charles.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden