Re: linking OpenGL (was :still having problems with cross development)
Re: linking OpenGL (was :still having problems with cross development)
- Subject: Re: linking OpenGL (was :still having problems with cross development)
- From: joshua portway <email@hidden>
- Date: Wed, 29 Oct 2003 18:35:42 +0000
It seems to be working for me to just copy the Libraries folder from a
10.2 install into the SDKs folder.
At least - it links and according to our beta testers the app now seems
to run OK on 10.2.
what problem are you having exactly with glTexImage2D ? I seem to
remember having some problems there earlier on, but it's a bit foggy -
the last days have been somewhat sleepless...
It certainly doesn't seem right to me that i should have to make an
function table in order to link to the openGL framework, unless I want
to be able to use extensions that might not be present on the target
machine. The way I would have thought it would work is that I would
select a target SDK and build - if every openGL function is present in
that version of the SDK it should link and that should be it. If I'm
using a function which isn't present in that version then I should get
a link error and then I can worry about using function pointers etc.
After all - I can still run old OpenGL apps that were built years ago
and linked against the OpenGL frameworks on 10.1, and they still run on
10.3. Surely if I could build an app in 10.1 then by selecting the 10.1
target SDK in xCode I should be able to do the same thing ? Or have I
misunderstood the cross development stuff completely ?
j
On 29 Oct 2003, at 04:29, Monroe Williams wrote:
On Oct 27, 2003, at 9:45 PM, Chris Espinosa wrote:
On Monday, October 27, 2003, at 07:01 PM, joshua portway wrote:
So - I've been spending the last couple of days desperately trying
to get the build to work. Now my target SDKs are all set to 10.2 and
my deployment targets are all set to 10.2. I've worked around what
appears to be a bug in the SDKs, where if you use the OpenGL
framework it won't link because XCode attempts to link against
dylibs that aren't there (I worked around it by copying the dylibs
into the 10.2 sdk from a jaguar install).
Yes, the OpenGL community has a separate dynamic loading/versioning
scheme that's common to all OpenGL implementations, but very
different from the way other Mac OS X frameworks do it. The OpenGL
sample code has some examples of how to deal with different versions
of OpenGL: basically you build your own jump table and indirect
through it for every call.
I believe I've seen the mechanism you're talking about, and I don't
think it explains the issue Joshua is referring to. I just got far
enough to run into this myself. (I'm still not sure what I did to
solve the earlier problems I was having, but that's another issue.)
When I set up to use the 10.2.7 SDK with OpenGL.framework to the
project, my link step fails with:
ld: warning can't open dynamic library:
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/
OpenGL.framework/Versions/A/Libraries/libGL.dylib (checking for
undefined symbols may be affected) (No such file or directory, errno =
2)
ld: warning prebinding disabled because dependent library:
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/
OpenGL.framework/Versions/A/Libraries/libGL.dylib can't be searched
ld: warning can't open dynamic library:
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/
OpenGL.framework/Versions/A/Libraries/libGLU.dylib (checking for
undefined symbols may be affected) (No such file or directory, errno =
2)
ld: warning suggest use of -bind_at_load, as lazy binding may result
in errors or different symbols being used
symbol _crypt used from dynamic library
/Developer/SDKs/MacOSX10.2.7.sdk/usr/lib/libSystem.dylib(crypt.So) not
from earlier dynamic library /usr/lib/libcrypto.0.9.dylib(fcrypt.o)
ld: Undefined symbols:
_glGetDoublev
_glGetFloatv
_glGetIntegerv
_glLoadIdentity
_glLoadMatrixf
_glMatrixMode
_glMultMatrixf
_glRotatef
...
and many, many more.
The problem could be that OpenGL.Framework/Versions/A/Libraries
doesn't exist in the SDK:
-----
$ ls -lR
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/
OpenGL.framework/
total 8
lrwxr-xr-x 1 root admin 24 22 Oct 19:49 Headers ->
Versions/Current/Headers
lrwxr-xr-x 1 root admin 23 22 Oct 19:49 OpenGL ->
Versions/Current/OpenGL
drwxrwxr-x 4 root admin 136 5 Sep 16:35 Versions
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/
OpenGL.framework//Versions:
total 4
drwxrwxr-x 4 root admin 136 5 Sep 16:35 A
lrwxr-xr-x 1 root admin 1 22 Oct 19:49 Current -> A
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/
OpenGL.framework//Versions/A:
total 12
drwxrwxr-x 16 root admin 544 6 Aug 00:32 Headers
-rwxrwxr-x 1 root admin 11412 5 Sep 16:35 OpenGL
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/
OpenGL.framework//Versions/A/Headers:
total 408
-rw-rw-r-- 1 root admin 567 30 May 14:11 CGLContext.h
-rw-rw-r-- 1 root admin 390 30 May 14:11 CGLCurrent.h
-rw-rw-r-- 1 root admin 70472 30 May 14:11 CGLMacro.h
-rw-rw-r-- 1 root admin 2539 14 Jul 2002 CGLProfiler.h
-rw-rw-r-- 1 root admin 606 30 May 14:11 CGLRenderers.h
-rw-rw-r-- 1 root admin 10445 30 May 14:11 CGLTypes.h
-rw-rw-r-- 1 root admin 2607 30 May 14:11 OpenGL.h
-rw-rw-r-- 1 root admin 88876 30 May 14:11 gl.h
-rw-rw-r-- 1 root admin 139430 30 May 14:11 glext.h
-rw-rw-r-- 1 root admin 294 30 May 14:11 gliContext.h
-rw-rw-r-- 1 root admin 47592 30 May 14:11 gliDispatch.h
-rw-rw-r-- 1 root admin 16259 30 May 14:11 glu.h
-rw-rw-r-- 1 root admin 2597 30 May 14:11 gluContext.h
-rw-rw-r-- 1 root admin 2242 30 May 14:11 gluMacro.h
$
-----
but I think there may be something else going on. The framework
binary seems to reference the libraries in the non-SDK locations:
-----
$ otool -L
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/
OpenGL.framework/OpenGL
/Developer/SDKs/MacOSX10.2.7.sdk/System/Library/Frameworks/
OpenGL.framework/OpenGL:
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
(compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/
ApplicationServices (compatibility version 1.0.0, current version
18.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
(compatibility version 1.0.0, current version 120.4.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/
CoreFoundation (compatibility version 150.0.0, current version
263.5.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/
libGLU.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/
libGL.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 63.2.0)
$
-----
which hints that perhaps this is how it's supposed to be set up. Is
there some project setting we're supposed to tweak so that the linker
doesn't look in the SDK tree for these particular libraries?
I've tried dropping the OpenGL.framework from a 10.2.8 install into my
SDK tree, and that allows me to build and run on 10.3, but I crash in
glTexImage2D on 10.2. It's far from optimal to have everyone who
wants to build this code hack up their development environment like
that, and I suspect it's not the right answer anyway.
As has been said before, "help me obi-wan", etc, etc...
Thanks,
-- monroe
-----------------------------------------------------------------------
-
Monroe Williams
email@hidden
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.