iDevGames Forums
Errors with Texture2D - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: Errors with Texture2D (/thread-1960.html)



Errors with Texture2D - davidB - Jan 4, 2009 07:29 AM

Hi,

I'm a total newb to mac/iphone/opengl development. I have lots of other programming experience, but not with any of this stuff specifically... I read through the Beginning iPhone Development book, and wanted to start playing around with making a game.

I originally wanted to use Quartz since I didn't want to do any 3d stuff, but after looking around on the forums here and mulling it over, I thought I'd try going the opengl route, at least to see for myself how it works before doing more mucking about with Quartz so I could get a better feel for the two.

Anyway, in the book there;s a chapter on quartz and opengl, and the authors included the Texture2D class, which I see was in that crash landing demo that apple removed (which probably would have been awesome to look at...grrr). Anyway, that class works following the book code, but when I tried to load a new OpenGl project from XCode, and then add in Texture2D, I get 18 errors - without doing anything other than adding the two (.h, .m) to the project.

Does this make sense to anyone? Has anyone else seen these errors? I was wanted to play with the generated OpenGl project since it already had the timer stuff set up, vs the book code (where the texture2d class works) which didn't. I can probably put the timer stuff into the view class from there, but I thought starting from the freshly generated project would be the 'cleaner' approach.

Anyway, these are the errors. I don't really understand them (as I said, I'm new to opengl, obj-c, and mac development... ), so I'm curious if anyone else had this problem with a new project. This is a new OpenGLES project from Xcode with the build set to iPhone Simulator 2.2. I didn't change any of the frameworks or anything like that. If I just build the completely empty project, I get a screen with a rotating colored square, so everything works before I copy in those two files. Is there something I should change to make this class work?

Thanks.. sorry for the essay post. Rasp

Code:
Building target “GLMovingImageTest” of project “GLMovingImageTest” with configuration “Debug” — (18 errors)
        cd "/Users/davidb/Documents/Xcode Workspace/GLMovingImageTest"
    setenv MACOSX_DEPLOYMENT_TARGET 10.5
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.0 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.2.sdk "-L/Users/davidb/Documents/Xcode Workspace/GLMovingImageTest/build/Debug-iphonesimulator" "-F/Users/davidb/Documents/Xcode Workspace/GLMovingImageTest/build/Debug-iphonesimulator" -filelist "/Users/davidb/Documents/Xcode Workspace/GLMovingImageTest/build/GLMovingImageTest.build/Debug-iphonesimulator/GLMovingImageTest.build/Objects-normal/i386/GLMovingImageTest.LinkFileList" -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -o "/Users/davidb/Documents/Xcode Workspace/GLMovingImageTest/build/Debug-iphonesimulator/GLMovingImageTest.app/GLMovingImageTest"
Undefined symbols:
  "_CGContextRelease", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
  "_CGAffineTransformScale", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
  "_CGColorSpaceRelease", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
  "_CGContextSetGrayFillColor", referenced from:
      -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
  "_CGContextDrawImage", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
  "_CGContextTranslateCTM", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
  "_CGBitmapContextCreate", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
  "_CGAffineTransformIsIdentity", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
  "_CGImageGetColorSpace", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
  "_CGContextScaleCTM", referenced from:
      -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
  "_CGContextClearRect", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
  "_CGColorSpaceCreateDeviceGray", referenced from:
      -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
  "_CGAffineTransformIdentity", referenced from:
      _CGAffineTransformIdentity$non_lazy_ptr in Texture2D.o
  "_CGImageGetAlphaInfo", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
  "_CGContextConcatCTM", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
  "_CGColorSpaceCreateDeviceRGB", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Image) initWithImage:] in Texture2D.o
  "_CGImageGetWidth", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Image) initWithImage:] in Texture2D.o
  "_CGImageGetHeight", referenced from:
      -[Texture2D(Image) initWithImage:] in Texture2D.o
      -[Texture2D(Image) initWithImage:] in Texture2D.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
          "_CGContextRelease", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
          "_CGAffineTransformScale", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
          "_CGColorSpaceRelease", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
          "_CGContextSetGrayFillColor", referenced from:
              -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
          "_CGContextDrawImage", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
          "_CGContextTranslateCTM", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
          "_CGBitmapContextCreate", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
          "_CGAffineTransformIsIdentity", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
          "_CGImageGetColorSpace", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
          "_CGContextScaleCTM", referenced from:
              -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
          "_CGContextClearRect", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
          "_CGColorSpaceCreateDeviceGray", referenced from:
              -[Texture2D(Text) initWithString:dimensions:alignment:fontName:fontSize:] in Texture2D.o
          "_CGAffineTransformIdentity", referenced from:
              _CGAffineTransformIdentity$non_lazy_ptr in Texture2D.o
          "_CGImageGetAlphaInfo", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
          "_CGContextConcatCTM", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
          "_CGColorSpaceCreateDeviceRGB", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Image) initWithImage:] in Texture2D.o
          "_CGImageGetWidth", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Image) initWithImage:] in Texture2D.o
          "_CGImageGetHeight", referenced from:
              -[Texture2D(Image) initWithImage:] in Texture2D.o
              -[Texture2D(Image) initWithImage:] in Texture2D.o
        ld: symbol(s) not found
        collect2: ld returned 1 exit status



Errors with Texture2D - longjumper - Jan 4, 2009 06:41 PM

You need to add CoreGraphics.framework to your project.


Errors with Texture2D - davidB - Jan 4, 2009 07:39 PM

LOL that's all?!? Mad

just added it and it works. thanks!!