Compiling For Device Yields Errors; Simulator Compiles Fine
I'm having a weird issue. I just got all my stuff set up to finally push an iPhone game to my phone that I'm working on but I can't seem to get it to compile for the device. I can compile and run it just fine in the simulator, but when I switch to the device itself, it gives me this laundry list of errors and warnings:
So I'm a little confused. I'd post code, but I figure this must be some sort of project setting rather than the actual code since it compiles perfectly for the simulator. Is there some framework settings I need to be switching when moving over to compiling for the actual device? Or something else that could be tripping me up?
Code:
Line Location gl.h:685: previous declaration of 'glRotatef' was here
Line Location gl.h:686: previous declaration of 'glScalef' was here
Line Location gl.h:691: previous declaration of 'glTranslatef' was here
Line Location gl.h:696: previous declaration of 'glBindTexture' was here
Line Location gl.h:697: previous declaration of 'glBlendFunc' was here
Line Location gl.h:722: previous declaration of 'glDrawArrays' was here
Line Location gl.h:724: previous declaration of 'glEnable' was here
Line Location gl.h:724: previous declaration of 'glEnable' was here
Line Location gl.h:725: previous declaration of 'glEnableClientState' was here
Line Location gl.h:725: previous declaration of 'glEnableClientState' was here
Line Location gl.h:757: previous declaration of 'glLoadIdentity' was here
Line Location gl.h:762: previous declaration of 'glMatrixMode' was here
Line Location gl.h:785: previous declaration of 'glTexCoordPointer' was here
Line Location gl.h:791: previous declaration of 'glTexParameteri' was here
Line Location JugglingBall.h:14: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:14: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:18: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:18: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:23: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:23: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:24: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:24: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:25: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:25: error: syntax error before 'NSPoint'
Line Location JugglingBall.h:26: fatal error: method definition not in @implementation context
Line Location JugglingBall.h:26: fatal error: method definition not in @implementation context
Line Location Sprite.h:25: error: syntax error before 'NSPoint'
Line Location Sprite.h:25: error: syntax error before 'NSPoint'
Line Location Sprite.h:25: error: syntax error before 'NSPoint'
Line Location Sprite.h:27: warning: '@end' must appear in an @implementation context
Line Location Sprite.h:27: warning: '@end' must appear in an @implementation context
Line Location Sprite.h:27: warning: '@end' must appear in an @implementation context
Line Location Sprite.m:93: error: syntax error before 'NSPoint'
Line Location Sprite.m:97: warning: type defaults to 'int' in declaration of 'glEnableClientState'
Line Location Sprite.m:97: error: conflicting types for 'glEnableClientState'
Line Location Sprite.m:97: error: syntax error before numeric constant
Line Location Sprite.m:97: warning: data definition has no type or storage class
Line Location Sprite.m:100: warning: type defaults to 'int' in declaration of 'glTexCoordPointer'
Line Location Sprite.m:100: error: conflicting types for 'glTexCoordPointer'
Line Location Sprite.m:100: error: syntax error before numeric constant
Line Location Sprite.m:100: warning: data definition has no type or storage class
Line Location Sprite.m:101: warning: type defaults to 'int' in declaration of 'glEnableClientState'
Line Location Sprite.m:101: error: conflicting types for 'glEnableClientState'
Line Location Sprite.m:101: error: syntax error before numeric constant
Line Location Sprite.m:101: warning: data definition has no type or storage class
Line Location Sprite.m:104: warning: type defaults to 'int' in declaration of 'glEnable'
Line Location Sprite.m:104: error: conflicting types for 'glEnable'
Line Location Sprite.m:104: warning: data definition has no type or storage class
Line Location Sprite.m:104: error: syntax error before numeric constant
Line Location Sprite.m:105: error: conflicting types for 'glBindTexture'
Line Location Sprite.m:105: warning: data definition has no type or storage class
Line Location Sprite.m:105: warning: type defaults to 'int' in declaration of 'glBindTexture'
Line Location Sprite.m:105: error: syntax error before numeric constant
Line Location Sprite.m:108: warning: data definition has no type or storage class
Line Location Sprite.m:108: error: conflicting types for 'glTexParameteri'
Line Location Sprite.m:108: warning: type defaults to 'int' in declaration of 'glTexParameteri'
Line Location Sprite.m:108: error: syntax error before numeric constant
Line Location Sprite.m:111: warning: data definition has no type or storage class
Line Location Sprite.m:111: warning: type defaults to 'int' in declaration of 'glBlendFunc'
Line Location Sprite.m:111: error: syntax error before numeric constant
Line Location Sprite.m:111: error: conflicting types for 'glBlendFunc'
Line Location Sprite.m:114: warning: data definition has no type or storage class
Line Location Sprite.m:114: warning: type defaults to 'int' in declaration of 'glEnable'
Line Location Sprite.m:114: error: syntax error before numeric constant
Line Location Sprite.m:114: error: conflicting types for 'glEnable'
Line Location Sprite.m:117: warning: data definition has no type or storage class
Line Location Sprite.m:117: error: conflicting types for 'glMatrixMode'
Line Location Sprite.m:117: warning: type defaults to 'int' in declaration of 'glMatrixMode'
Line Location Sprite.m:117: error: syntax error before numeric constant
Line Location Sprite.m:118: error: conflicting types for 'glLoadIdentity'
Line Location Sprite.m:118: warning: type defaults to 'int' in declaration of 'glLoadIdentity'
Line Location Sprite.m:118: warning: data definition has no type or storage class
Line Location Sprite.m:119: error: conflicting types for 'glTranslatef'
Line Location Sprite.m:119: warning: data definition has no type or storage class
Line Location Sprite.m:119: warning: type defaults to 'int' in declaration of 'glTranslatef'
Line Location Sprite.m:119: error: syntax error before '.' token
Line Location Sprite.m:120: error: syntax error before numeric constant
Line Location Sprite.m:120: warning: type defaults to 'int' in declaration of 'glRotatef'
Line Location Sprite.m:120: error: conflicting types for 'glRotatef'
Line Location Sprite.m:120: warning: data definition has no type or storage class
Line Location Sprite.m:121: error: syntax error before '.' token
Line Location Sprite.m:121: warning: type defaults to 'int' in declaration of 'glScalef'
Line Location Sprite.m:121: error: conflicting types for 'glScalef'
Line Location Sprite.m:121: warning: data definition has no type or storage class
Line Location Sprite.m:124: warning: data definition has no type or storage class
Line Location Sprite.m:124: error: conflicting types for 'glDrawArrays'
Line Location Sprite.m:124: warning: type defaults to 'int' in declaration of 'glDrawArrays'
Line Location Sprite.m:124: error: syntax error before numeric constantSo I'm a little confused. I'd post code, but I figure this must be some sort of project setting rather than the actual code since it compiles perfectly for the simulator. Is there some framework settings I need to be switching when moving over to compiling for the actual device? Or something else that could be tripping me up?
NSPoint/Rect/Size/etc and related functions don't exist on the iPhone. No NSGeometry.h. They'll compile fine on the simulator but not for the device.
As for the OGL stuff, make sure you're linked against the OpenGLES.framework and check the build results to make sure it's actually linking properly and what not. In the "Ld" line make sure there's sections that look like "-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk" (or 2.0 or 2.1) and "-framework OpenGLES"
As for the OGL stuff, make sure you're linked against the OpenGLES.framework and check the build results to make sure it's actually linking properly and what not. In the "Ld" line make sure there's sections that look like "-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk" (or 2.0 or 2.1) and "-framework OpenGLES"
Bachus Wrote:NSPoint/Rect/Size/etc and related functions don't exist on the iPhone. No NSGeometry.h. They'll compile fine on the simulator but not for the device.Because that makes sense...
. I guess I'll make my own primitive types.Quote:As for the OGL stuff, make sure you're linked against the OpenGLES.framework and check the build results to make sure it's actually linking properly and what not. In the "Ld" line make sure there's sections that look like "-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.sdk" (or 2.0 or 2.1) and "-framework OpenGLES"I'll take a look for that. Thanks.
Hm. All I had to do was switch over to CGPoint and CGSize and all my errors (even the OpenGL ones) were resolved. Not entirely sure why, but thanks for the help.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| iOS 6 fine, iOS 5, aspect ratio messed up | Madrayken | 0 | 835 |
Jan 7, 2013 11:50 AM Last Post: Madrayken |
|
| NSTimer fine, CADisplayLink having some issues | monteboyd | 5 | 7,530 |
Aug 31, 2010 07:05 PM Last Post: Skorche |
|
| Touches: Device vs Simulator | vectorscope | 4 | 3,716 |
Sep 22, 2009 03:25 PM Last Post: Skorche |
|
| touches stopped working on device, works in simulator | aerospaceman | 4 | 4,004 |
Jul 29, 2009 05:06 PM Last Post: aerospaceman |
|
| Images loading in simulator but not on device | fretmunky | 4 | 2,834 |
Dec 12, 2008 02:27 AM Last Post: fretmunky |
|

