shenfei2015 / oglsuperbible5

Automatically exported from code.google.com/p/oglsuperbible5
0 stars 0 forks source link

Chapter 1 link problem with gltReadTGABits() under OSX 10.6, XCode 4.0 #36

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up a project according to the instructions in Chapter 2, but using the 
block.cpp sourcecode from chapter 1.
2. Included libGLTools.a from the XCode.zip download into the project.

What is the expected output? What do you see instead?

The linker error that I'm getting is the typical undefined symbol: 
"gltReadTGABits(char const*, int*, int*, int*, unsigned int*). It doesn't seem 
to matter whether I compile 32-bit or 64-bit.

BTW, the Triangle example works fine, so I don't think the problem is my setup.

What version of the product are you using? On what operating system?
OSX 10.6, XCode 4.0

Please provide any additional information below.

I'm a little new to Mac programming as well as OpenGL -- but I see other 
newbies with the same problem on other discussion boards.  They've largely 
solved it by copying the source of the function directly into their source 
file.  I'd rather figure out what the cause is and fix that.

Original issue reported on code.google.com by tomnant...@gmail.com on 31 Aug 2011 at 10:06

GoogleCodeExporter commented 9 years ago
I have the same problem. Looking at the link error, it seems like the compiler 
is looking for a c++ mangled name. Is it possible the library version is a pure 
C function?

One way to fix the problem is to simply copy the code from the book as part of 
the example and replace the function call with that one.

Original comment by pa...@pinger.org on 24 Nov 2011 at 5:19