Thibault Langlois tl@di.fc.ul.pt writes:
I'm trying open-gl for the first time and I get the following error:
Undefined foreign symbol: "glAttachShader" [Condition of type KERNEL:SIMPLE-PROGRAM-ERROR]
I am using cmucl 19c on a intel linux. I fetched cffi and cl-opengl from their respective websites today.
IIRC, CMUCL is unique in that it is rather eager about resolving foreign function linkage at compile-time. In most other Lisps, you can define an interface to a C function that doesn't exist, and you are alright unless you call it.
Unfortunately, CL-OPENGL's strategy of defining linkage for every OpenGL 2.0 function will break horribly in CMUCL if the GL library version is lower, which is probably what's going on in your situation.
As a workaround for now, you could comment out the DEFCFUNs in funcs.lisp that give you errors, or try in SBCL instead of CMUCL, which resolves foreign linkage lazily.
I'm not sure what a long-term solution to this would involve---we'd have to resolve functions that may or may not be present at runtime (like C programs do with GL_EXTENSIONS). Blech.
James