glfwInit failing error

Luminary
Posts: 5,143
Joined: 2002.04
Post: #16
I don't believe this is anything to do with GLFW.

If you have zero-link turned on, turn it off, just in case.

Remember that you can't make OpenGL calls until after you have an OpenGL context (glfwOpenWindow, probably).
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #17
Now I get a corrupt stack error.

And this after disabling zero-linking:
Code:
Building target “O3Dtest1-6” of project “O3Dtest1-6” with configuration “Debug” — (1 error)
        mkdir /Users/obie/Documents/Clibraries/O3D/O3Dtest1-6/build/Debug/O3Dtest1-6.app/Contents/MacOS
    cd /Users/obie/Documents/Clibraries/O3D/O3Dtest1-6
    /usr/bin/gcc-4.0 -o /Users/obie/Documents/Clibraries/O3D/O3Dtest1-6/build/Debug/O3Dtest1-6.app/Contents/MacOS/O3Dtest1-6 -L/Users/obie/Documents/Clibraries/O3D/O3Dtest1-6/build/Debug -L/Users/obie/Documents/Clibraries/O3D/O3Dtest1-6 -F/Users/obie/Documents/Clibraries/O3D/O3Dtest1-6/build/Debug -filelist /Applications/Oliver\'s\ finished\ projects/O3Dtest1-6.build/Debug/O3Dtest1-6.build/Objects-normal/ppc/O3Dtest1-6.LinkFileList -framework Carbon -framework AGL -framework OpenGL -lglfw -arch ppc -Wl,-Y,1455 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
/usr/bin/ld: table of contents for archive: /Users/obie/Documents/Clibraries/O3D/O3Dtest1-6/libglfw.a is out of date; rerun ranlib(1) (can't load from it)
collect2: ld returned 1 exit status
        /usr/bin/ld: table of contents for archive: /Users/obie/Documents/Clibraries/O3D/O3Dtest1-6/libglfw.a is out of date; rerun ranlib(1) (can't load from it)
        collect2: ld returned 1 exit status
Build failed (1 error)

And this after putting in a dylib version of glfw:
Code:
[Session started at 2008-08-27 15:52:17 -0400.]
dyld: Library not loaded: @executable_path/libglfw.dylib
  Referenced from: /Users/obie/Documents/Clibraries/O3D/O3Dtest1-6/build/Debug/O3Dtest1-6.app/Contents/MacOS/O3Dtest1-6
  Reason: image not found

O3Dtest1-6 has exited due to signal 5 (SIGTRAP).

What on OSX is going on!
Quote this message in a reply
Member
Posts: 245
Joined: 2005.11
Post: #18
For the first error, Google came up with this (first result): http://lists.apple.com/archives/xcode-us...00378.html
It looks like you have copied libglfw.a and messed up its created/modified dates. Running ranlib (as suggested by Xcode) should sort that out. Since the library has not been linking, this is probably the cause of all your problems up until now.

Regarding your new error (with the dylib), have you added the dylib to your "copy files" build phase? The path @executable_path/libglfw.dylib looks wrong anyway - the dylib should go in the Frameworks directory inside your app bundle, so it should be loaded from @executable_path/../Frameworks/libglfw.dylib I think.
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #19
Thanks, that solved the linking problem with libglfw.a

Now I have this:
[Image: my.php?image=screenshotng3.png]
which opens auto maticly even in release mode.

Also, I looked into the app bundle and there is no frameworks folder.

Are you sure no one has a sample .xcodeproject for me to try because this is driving me up the wall at the lack of online documentation for glfw and xcode.
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #20
Yes, this is a double post due to the fact that no one has answered in a while and now I have a new problem, when I use pkgconfig to compile I get this:

Code:
/usr/bin/ld: Undefined symbols:
_glBegin
_glClear
_glClearColor
_glColor3f
_glEnd
_glFlush
_glFrustum
_glLoadIdentity
_glMatrixMode
_glVertex3i
_glViewport
_glfwEnable
_glfwGetKey
_glfwGetWindowSize
_glfwInit
_glfwOpenWindow
_glfwSetWindowTitle
_glfwSwapBuffers
_glfwSwapInterval
_glfwTerminate
collect2: ld returned 1 exit status
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #21
The above message most likely means that the linker isn't aware of those functions at link time, so it can't resolve the symbols. Check the command-line parameters to gcc/ld and verify that OpenGL.framework and glfw are present. Ideally, paste the entire command line that's being used.
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #22
Code:
[Obie-Daidss-Computer:Clibraries/O3D/O3Dtest1-6] obie% gcc `pkg-config --cflags libglfw` -o myprog myprog.c `pkg-config --libs libglfw`
tcsh: pkg-config: Command not found.
tcsh: pkg-config: Command not found.
powerpc-apple-darwin8-gcc-4.0.1: myprog.c: No such file or directory
powerpc-apple-darwin8-gcc-4.0.1: no input files
[Obie-Daidss-Computer:Clibraries/O3D/O3Dtest1-6] obie% gcc `pkg-config --cflags libglfw` -o main main.c `pkg-config --libs libglfw`
tcsh: pkg-config: Command not found.
tcsh: pkg-config: Command not found.
/usr/bin/ld: Undefined symbols:
_glBegin
_glClear
_glClearColor
_glColor3f
_glEnd
_glFlush
_glFrustum
_glLoadIdentity
_glMatrixMode
_glVertex3i
_glViewport
_glfwEnable
_glfwGetKey
_glfwGetWindowSize
_glfwInit
_glfwOpenWindow
_glfwSetWindowTitle
_glfwSwapBuffers
_glfwSwapInterval
_glfwTerminate
collect2: ld returned 1 exit status
[Obie-Daidss-Computer:Clibraries/O3D/O3Dtest1-6] obie%
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #23
Yep, as suspected, OpenGL.framework is missing from your compiler parameters. It looks like a number of other things are broken, too:
  • You're trying to call pkg-config, which doesn't appear to exist, or at least isn't in your $PATH. It's warning you about it with "tcsh: pkg-config: Command not found.".
  • myprog.c doesn't exist in the first call.
  • You'll need to add "-framework OpenGL" and either "-lglfw" or the path to libglfw.a, depending on whether it's in your library search paths or not. Maybe this is what the output of pkg-config is expected to be?
So, what you'd want would look something like this:
Code:
gcc -o myProgram -framework OpenGL libglfw.a main.c
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #24
Thanks, that worked!
I had to change it to :
Code:
gcc -o myProgram -framework Carbon -framework AGL -framework OpenGL libglfw.a main.c

Now its telling me to build an .app wrapper.
Fortunately that message is from glfw.
How do I build an .app wrapper?
(google keeps giving results for java)

Entire message
Code:
Last login: Thu Aug 28 17:50:18 on ttyp4
Welcome to Darwin!
/Users/obie/Documents/Clibraries/O3D/O3Dgcctest1-1/myProgram; exit
[Obie-Daidss-Computer:~] obie% /Users/obie/Documents/Clibraries/O3D/O3Dgcctest1-1/myProgram; exit
Working in unbundled mode.  You should build a .app wrapper for your Mac OS X applications.
Bus error
logout
[Process completed]
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #25
Glad to hear that's working for you!

The most basic .app wrapper would look be a directory structure that looks like this, where MyProgram is your executable: MyProgram.app/Contents/MacOS/MyProgram

To be a little bit more correct about it, you'd want to put two more files in Contents: Info.plist and PkgInfo. This page can tell you more about those two files: http://developer.apple.com/documentation...2094-98415

You'd also most likely want a "Resources" directory sibling to MacOS for storing external assets your application uses. Applications on Mac OS X are supposed to be self-contained, and this is the standard place to put ancillary files.
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #26
So, I built a .app wrapper and I get a EXC_BAD_ACCESS error in the crash log.
Code:
===== Sunday, August 31, 2008 3:58:12 PM US/Eastern =====
**********

Host Name:      Obie-Daidss-Computer
Date/Time:      2008-08-31 15:58:22.008 -0400
OS Version:     10.4.11 (Build 8S165)
Report Version: 4

Command: myProgram
Path:    /OLIVER/Developement/Xcode/Clibraries/O3D/O3Dgcctest1-1/O3D.app/Contents/MacOS/myProgram
Parent:  WindowServer [61]

Version: T1 v0.1 (v0.1)

PID:    19607
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000ab0

Thread 0 Crashed:
0   libGL.dylib          0x92f26f28 glClearColor + 56
1   com.oddmedia.O3D     0x00002858 main + 100
2   com.oddmedia.O3D     0x0000237c _start + 760
3   com.oddmedia.O3D     0x00002080 start + 48

Thread 0 crashed with PPC Thread State 64:
  srr0: 0x0000000092f26f28 srr1: 0x000000000200f030                        vrsave: 0x0000000000000000
    cr: 0x82000222          xer: 0x0000000000000004   lr: 0x0000000092f26f04  ctr: 0x0000000092f26ef0
    r0: 0x0000000000002858   r1: 0x00000000bffffad0   r2: 0x00000000a2f26f04   r3: 0x0000000000000000
    r4: 0x0000000000003f40   r5: 0x0000000000000000   r6: 0x000000000007774e   r7: 0x0000000048baf7dd
    r8: 0x0000000000003f40   r9: 0x000000000000280c  r10: 0x0000000000003af8  r11: 0x0000000042000228
   r12: 0x0000000092f26ef0  r13: 0x0000000000000000  r14: 0x0000000000000000  r15: 0x0000000000000000
   r16: 0x0000000000000000  r17: 0x0000000000000000  r18: 0x0000000000000000  r19: 0x0000000000000000
   r20: 0x0000000000000000  r21: 0x0000000000000000  r22: 0x0000000000000000  r23: 0x0000000000000000
   r24: 0x0000000000000000  r25: 0x0000000000000002  r26: 0x00000000bffffcc8  r27: 0x00000000bffffca8
   r28: 0x00000000bffffc9c  r29: 0x00000000a2f26004  r30: 0x00000000bffffad0  r31: 0x0000000092f26f04

Binary Images Description:
    0x1000 -     0x7fff com.oddmedia.O3D T1 v0.1 (v0.1)    /OLIVER/Developement/Xcode/Clibraries/O3D/O3Dgcctest1-1/O3D.app/Contents/MacOS/myProgram
0x8fe00000 - 0x8fe52fff dyld 46.16    /usr/lib/dyld
0x90000000 - 0x901bcfff libSystem.B.dylib     /usr/lib/libSystem.B.dylib
0x90214000 - 0x90219fff libmathCommon.A.dylib     /usr/lib/system/libmathCommon.A.dylib
0x9021b000 - 0x90268fff com.apple.CoreText 1.0.4 (???)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
0x90293000 - 0x90344fff ATS     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x90373000 - 0x9072efff com.apple.CoreGraphics 1.258.79 (???)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x907bb000 - 0x90895fff com.apple.CoreFoundation 6.4.11 (368.35)    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x908de000 - 0x908defff com.apple.CoreServices 10.4 (???)    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x908e0000 - 0x909e2fff libicucore.A.dylib     /usr/lib/libicucore.A.dylib
0x90a3c000 - 0x90ac0fff libobjc.A.dylib     /usr/lib/libobjc.A.dylib
0x90aea000 - 0x90b5cfff com.apple.framework.IOKit 1.4 (???)    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x90b72000 - 0x90b84fff libauto.dylib     /usr/lib/libauto.dylib
0x90b8b000 - 0x90e62fff com.apple.CoreServices.CarbonCore 681.18    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x90ec8000 - 0x90f48fff com.apple.CoreServices.OSServices 4.1    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x90f92000 - 0x90fd4fff com.apple.CFNetwork 4.0 (129.23)    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x90fe9000 - 0x91001fff com.apple.WebServices 1.1.2 (1.1.0)    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/WebServicesCore.framework/Versions/A/WebServicesCore
0x91011000 - 0x91092fff com.apple.SearchKit 1.0.7    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x910d8000 - 0x91101fff com.apple.Metadata 10.4.4 (121.36)    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x91112000 - 0x91120fff libz.1.dylib     /usr/lib/libz.1.dylib
0x91123000 - 0x912defff com.apple.security 4.6 (29770)    /System/Library/Frameworks/Security.framework/Versions/A/Security
0x913dd000 - 0x913e6fff com.apple.DiskArbitration 2.1.2    /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x913ed000 - 0x913f5fff libbsm.dylib     /usr/lib/libbsm.dylib
0x913f9000 - 0x91421fff com.apple.SystemConfiguration 1.8.3    /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x91434000 - 0x9143ffff libgcc_s.1.dylib     /usr/lib/libgcc_s.1.dylib
0x91444000 - 0x914bffff com.apple.audio.CoreAudio 3.0.5    /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x914fc000 - 0x914fcfff com.apple.ApplicationServices 10.4 (???)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x914fe000 - 0x91536fff com.apple.AE 1.5 (297)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x91551000 - 0x91623fff com.apple.ColorSync 4.4.10    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x91676000 - 0x91707fff com.apple.print.framework.PrintCore 4.6 (177.13)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x9174e000 - 0x91805fff com.apple.QD 3.10.25 (???)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x91842000 - 0x918a0fff com.apple.HIServices 1.5.3 (???)    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x918cf000 - 0x918f0fff com.apple.LangAnalysis 1.6.1    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x91904000 - 0x91929fff com.apple.FindByContent 1.5    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/FindByContent.framework/Versions/A/FindByContent
0x9193c000 - 0x9197efff com.apple.LaunchServices 183    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x9199a000 - 0x919aefff com.apple.speech.synthesis.framework 3.3    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x919bc000 - 0x91a02fff com.apple.ImageIO.framework 1.5.7    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x91a19000 - 0x91ae0fff libcrypto.0.9.7.dylib     /usr/lib/libcrypto.0.9.7.dylib
0x91b2e000 - 0x91b43fff libcups.2.dylib     /usr/lib/libcups.2.dylib
0x91b48000 - 0x91b66fff libJPEG.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x91b6c000 - 0x91c23fff libJP2.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
0x91c72000 - 0x91c76fff libGIF.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x91c78000 - 0x91ce2fff libRaw.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRaw.dylib
0x91ce7000 - 0x91d24fff libTIFF.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x91d2b000 - 0x91d45fff libPng.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x91d4a000 - 0x91d4dfff libRadiance.dylib     /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x91d4f000 - 0x91e3dfff libxml2.2.dylib     /usr/lib/libxml2.2.dylib
0x91e5c000 - 0x91e5cfff com.apple.Accelerate 1.2.2 (Accelerate 1.2.2)    /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x91e5e000 - 0x91f43fff com.apple.vImage 2.4    /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x91f4b000 - 0x91f6afff com.apple.Accelerate.vecLib 3.2.2 (vecLib 3.2.2)    /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x91fd6000 - 0x92044fff libvMisc.dylib     /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x9204f000 - 0x920e4fff libvDSP.dylib     /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x920fe000 - 0x92686fff libBLAS.dylib     /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x926b9000 - 0x929e4fff libLAPACK.dylib     /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x92a14000 - 0x92b02fff libiconv.2.dylib     /usr/lib/libiconv.2.dylib
0x92b05000 - 0x92b8dfff com.apple.DesktopServices 1.3.7    /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x92bce000 - 0x92df9fff com.apple.Foundation 6.4.10 (567.37)    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x92f26000 - 0x92f44fff libGL.dylib     /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x92f4f000 - 0x92fa9fff libGLU.dylib     /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x92fc7000 - 0x92fc7fff com.apple.Carbon 10.4 (???)    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x92fc9000 - 0x92fddfff com.apple.ImageCapture 3.0    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
0x92ff5000 - 0x93005fff com.apple.speech.recognition.framework 3.4    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x93011000 - 0x93026fff com.apple.securityhi 2.0 (203)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
0x93038000 - 0x930bffff com.apple.ink.framework 101.2 (69)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
0x930d3000 - 0x930defff com.apple.help 1.0.3 (32)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
0x930e8000 - 0x93116fff com.apple.openscripting 1.2.7 (???)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x93130000 - 0x9313ffff com.apple.print.framework.Print 5.2 (192.4)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
0x9314b000 - 0x931b1fff com.apple.htmlrendering 1.1.2    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering
0x931e2000 - 0x93231fff com.apple.NavigationServices 3.4.4 (3.4.3)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices
0x9325f000 - 0x9327cfff com.apple.audio.SoundManager 3.9    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
0x9328e000 - 0x9329bfff com.apple.CommonPanels 1.2.2 (73)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
0x932a4000 - 0x935b2fff com.apple.HIToolbox 1.4.10 (???)    /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x93702000 - 0x9370efff com.apple.opengl 1.4.7    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x985d8000 - 0x985e5fff com.apple.agl 2.5.6 (AGL-2.5.6)    /System/Library/Frameworks/AGL.framework/Versions/A/AGL

I'm not really much of a Mac guy(can you tell), I just hate Microsoft .
I've only did this stuff for a year and haven't learned all the error codes and the like.
Forgot:
my O3D.app is setup like:
Contents
-PkgInfo
-Info.plist
-Frameworks
->OpenGL.framework
->AGL.framework
->Carbon.framework
-MacOs
->myProgram
-Resources
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #27
Again, there's too little information here, but the most likely reason to crash during glClearColor is that you cannot call OpenGL functions before you have a window.
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #28
However the window is opening as, if it didn't, an error from my code would go to the console.
I believe all my errors may come from linking to the frameworks.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #29
You've called glClearColor successfully, it has a sane address in the correct dylib. This is *not* a linking issue. Check that your call to glClearColor comes *after* glfwOpenWindow.

Alternatively, put
Code:
extern void *CGLGetCurrentContext(void);
if (!CGLGetCurrentContext()) abort();
just before the glClearColor call that's crashing. If that abort gets hit, you haven't called glfwOpenWindow [successfully].
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Help! Build failing on libcurl GolfHacker 7 5,456 Nov 3, 2007 08:03 PM
Last Post: GolfHacker
  Failing to link with static library c0d1f1ed 11 5,324 Sep 24, 2006 05:37 PM
Last Post: c0d1f1ed
  'Unidentified error' error in Xcode scgames 2 3,676 Jun 10, 2006 01:38 AM
Last Post: scgames