gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] search lib path for c-library (gforth 0.7.2)


From: Cyrille Duret
Subject: Re: [gforth] search lib path for c-library (gforth 0.7.2)
Date: Fri, 26 Apr 2013 17:33:53 +0200

pretty interesting I tried to bind this library in gambit scheme and I get the same crash !

(define-module glfw/glfw
  (pragma lang: r4rs
          cc-options: "-Wno-write-strings -U___SINGLE_HOST -I/usr/local/include"
          ld-options: "-L/usr/local/lib/ -Wl,-rpath,/usr/local/lib/ -lglfw")
  (define glfwInit (c-lambda () int "glfwInit"))
  (define glfwOpenWindow (c-lambda (int int int int int int int int int) int "glfwOpenWindow"))
  (define glfwGetWindowParam (c-lambda (int) int "glfwGetWindowParam"))
  (define glfwSwapBuffers (c-lambda () void "glfwSwapBuffers")))

Unable to find pthread_mutexattr_setkind_np versioned symbol. Aborting.
/home/cydu/Local/bin/gloom: line 3: 13862: Abort(coredump)
Abort

So it is a problem between glfw and pthread version in my freebsd !? 
I'll check it out..

thanks for your help


On Fri, Apr 26, 2013 at 4:21 PM, Cyrille Duret <address@hidden> wrote:
thanks, I tweaked a little libcc.fs and inserted add-libpath definition.
By the way I discovered that the LIBRARY_PATH variable works also.

I try to setup simple ffi bindings for opengl  & glfw

c-library glfw
\c #include <GL/glfw.h>
s" glfw" add-lib
s" /usr/local/lib" add-libpath
c-function glfw-init glfwInit -- void
c-function gflw-open-window glfwOpenWindow n n n n n n n n n -- n
c-function glfw-get-window-param glfwGetWindowParam n -- n
c-function glfw-swap-buffers glfwSwapBuffers -- void
end-c-library

but gforth crashes with a core dump (I let a trace in libcc.fs):
@ gforth test-glfw.fs
libtool --silent --tag=CC --mode=link gcc -module -rpath ~/.gforth/libcc-named/ ~/.gforth/libcc-named/glfw.lo -o ~/.gforth/libcc-named/glfw.la -L/usr/local/lib -lglfw
Unable to find pthread_mutexattr_setkind_np versioned symbol. Aborting.

Abort trap: 6.
Memory fault(coredump)

I don't know very much the process of loading share object in gforth but I observe that the file ~/.gforth/libcc-named/glfw.la is created


On Fri, Apr 26, 2013 at 3:33 PM, Bernd Paysan <address@hidden> wrote:
Am Freitag, 26. April 2013, 15:12:51 schrieb Cyrille Duret:
> hello everybody,
> I am looking for a way to indicate the lib path of gcc while gforth is
> compiling a c-library
>
> I have tried export CFLAGS=-L/usr/local/lib but the linker still complain
> he not find my lib.
>
> I have seen in the last development version you have added the word
> add-libpath but for now it seems that this version is a bit buggy for
> freeBSD.

Bug reports please!

> Any solution for the 0.7.2 version ?

: add-libpath ( c-addr1 u1 node -- c-addr2 u2 )
    \ append " -L<nodelib>" to string1
    >r s"  -L" append r> c-lib-string 2@ append ;

should do it for 0.7.2.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]