[gambit-list] Conflicting c-lambda definitions in Gambit generated C code
TJay
tjay.dreaming at gmail.com
Fri Dec 23 10:56:12 EST 2005
Another problem I've found while porting OpenGL to Gambit-C 4 b15. I
have 3 functions in C which take a function pointer, which has this
prototype in C:
void (*fn)()
I defined the 3 functions in Gambit by using the followinf c-lambda
special forms:
(define gluTessCallback
(c-lambda (GLUtriangulatorObj* GLenum (function () void)) void
"gluTessCallback"))
(define gluNurbsCallback
(c-lambda (GLUnurbsObj* GLenum (function () void)) void "gluNurbsCallback"))
(define gluQuadricCallback
(c-lambda (GLUquadricObj* GLenum (function () void)) void
"gluQuadricCallback"))
When I compile, I get the following errors:
/tmp/cc4tArz0.o: In function `___converter0':
gluQuadricCallback.c:(.text+0x0): multiple definition of `___converter0'
/tmp/ccnNcStz.o:gluNurbsCallback.c:(.text+0x0): first defined here
/tmp/ccicCqhJ.o: In function `___converter0':
gluTessCallback.c:(.text+0x0): multiple definition of `___converter0'
/tmp/ccnNcStz.o:gluNurbsCallback.c:(.text+0x0): first defined here
collect2: ld returned 1 exit status
It seems there is a problem having multiple "(function () void)"s.
Even if I create a (c-define-type voidFunc* (function () void)) in
another file and include it in the three files containing tose 3
functions, it still gives me the same error.
If I move all 3 functions to the same file, however, the error
disappears. (Because the ___converter0 function only appears in 1 C
file.)
~ TJay ~
More information about the Gambit-list
mailing list