Thanks Leif,


On Mon, Apr 1, 2019 at 3:12 PM Leif Andersen <l...@leifandersen.net> wrote:

> A common cause of this is you don't have installed the libraries that
> the library you're trying to load depends on.
>
> Since you are using the libvid library it depends on libavutil, which
> is not (currently) listed as a dependency in the libvid-x86_64-macosx
> package[1].
>
libavutil is in /Users/spdegabrielle/Library/Racket/7.2/lib


> Can you try installing the ffmpeg-x86_64-macosx package on your
> machine and see if it still works?


I've installed #lang video and that works so I'm assuming that means
ffmpeg-x86_64-macosx is working


> If not, can you show us the list of
> files in your /Users/spdegabrielle/Library/Racket/7.2/lib and
> /Applications/Racket v7.2/lib directories?
>

Yes,

Miriams-MacBook-Pro:lib spdegabrielle$ pwd

/Users/spdegabrielle/Library/Racket/7.2/lib

Miriams-MacBook-Pro:lib spdegabrielle$ ls

launchers.rktd libavformat.57.dylib libswresample.2.dylib

libavcodec.57.dylib *libavutil.55.dylib* libswscale.4.dylib

libavdevice.57.dylib libopenh264.4.dylib *libvid.0.dylib*

libavfilter.6.dylib libs.rktd


Miriams-MacBook-Pro:lib spdegabrielle$ cd /Applications/Racket\ v7.2/lib/

Miriams-MacBook-Pro:lib spdegabrielle$ pwd

/Applications/Racket v7.2/lib

Miriams-MacBook-Pro:lib spdegabrielle$ ls

GRacket.app libgobject-2.0.0.dylib

MMTabBarView.framework libgthread-2.0.0.dylib

PSMTabBarControl.framework libharfbuzz.0.dylib

Racket.framework libintl.9.dylib

Starter.app libjpeg.9.dylib

buildinfo libmpfr.4.dylib

launchers.rktd libpango-1.0.0.dylib

libatk-1.0.0.dylib libpangocairo-1.0.0.dylib

libcairo.2.dylib libpangoft2-1.0.0.dylib

libcrypto.1.1.dylib libpixman-1.0.dylib

libexpat.1.dylib libpng16.16.dylib

libffi.6.dylib libs.rktd

libfontconfig.1.dylib libssl.1.1.dylib

libfreetype.6.dylib libuuid.1.dylib

libfribidi.0.dylib mans.rktd

libgio-2.0.0.dylib mzdyn3m.o

libglib-2.0.0.dylib starter

libgmodule-2.0.0.dylib starter-sh

libgmp.10.dylib system.rktd

Miriams-MacBook-Pro:lib spdegabrielle$
(Miriam knows I have her MacBook)


>
> Hope that helps.
>
> [1]: That was my fault. I probably should have listed it. I never
> really imagined libvid being used without the video package, which
> _does_ have the required deps. I'll update the deps for that package,
> thanks for pointing out the problem.
>

Thank *you* for making #lang video 😀

Kind regards,
Stephen



> On 4/1/19, Stephen De Gabrielle <spdegabrie...@gmail.com> wrote:
> > Hi,
> >
> > I'm trying to work out how to use 'copy-foreign-libs' [1], but not having
> > much luck.  I believe the implementation of the collection using '
> > copy-foreign-libs' is correct because it works in '#lang video', but I've
> > been unable to use it myself.
> >
> > I created a collection 'testffi-1' that would make use of the
> > existing(known working) 'libvid-x86_64-macosx' package [2] used by `#lang
> > video`.
> >
> > I installed 'testffi-1' with 'raco pkg install' , but attempts to call it
> > with a short test program fail with an error that the foreign library
> > cannot be found.
> >
> > Thinking that I hadn't 'provided'ed the foreign lib to my test script let
> > me to create a 'main.rkt' in 'testffi-1', but that also fails to fine the
> > foreign lib with the same error message, and using the DrRacket 'trace'
> > functionality seems to blame 'kw.rkt' (/Applications/Racket
> > v7.2/collects/racket/private/kw.rkt: 1325:47), which seems odd to me
> > because the error is in my code, not in the standard racket libs.
> >
> > I used (require setup/dirs
> > <https://docs.racket-lang.org/raco/dirs.html?q=get-lib-dirs>) to see if
> the
> > foreign lib was included, but
> > get-lib-search-dirs
> > <
> https://docs.racket-lang.org/raco/dirs.html#%28def._%28%28lib._setup%2Fdirs..rkt%29._get-lib-search-dirs%29%29
> >
> > returns
> > /Users/spdegabrielle/Library/Racket/7.2/lib /Applications/Racket v7.2/lib
> > when called from both the test script and the 'testffi-1' collection.
> >
> > Any suggestions on how I can test or resolve this issue would be
> > appreciated.
> >
> > Kind regards,
> > Stephen
> >
> > * 'copy-foreign-libs' : *
> >
> https://github.com/videolang/native-pkgs/blob/master/libvid-x86_64-macosx/info.rkt
> >
> > *test program: *
> > #lang racket
> > (require ffi/unsafe)
> > (require testffi-1)
> > (define libvid-val (ffi-lib (string-append "libvid") "0"))
> > (displayln libvid-val)
> >
> >
> > *'main.rkt' in 'testffi-1'*
> > #lang racket/base
> > (require ffi/unsafe)
> > ;(ffi-lib? "libvid.0.dylib")
> >
> > (define libvid-val (ffi-lib (string-append "libvid") "0"))
> >
> > (displayln libvid-val)
> >
> >
> > *Error*
> > Welcome to DrRacket, version 7.2 [3m].
> > Language: racket, with debugging; memory limit: 2048 MB.
> > *. . ../../../Applications/Racket
> > v7.2/collects/racket/private/kw.rkt:1325:47: ffi-lib: couldn't open
> > "libvid.0.dylib" (dlopen(libvid.0.dylib, 6): image not found)*
> >>
> >
> > *tracing the error : *
> > ffi-lib: couldn't open "libvid.0.dylib" (dlopen(libvid.0.dylib, 6): image
> > not found)
> > ffi-lib: couldn't open "libvid.0.dylib" (dlopen(libvid.0.dylib, 6): image
> > not found)
> >
> >
> > *package used set deps 'testffi-1' *
> > #lang info
> > (define collection "testffi-1")
> > (define deps '("base"
> >                ("libvid-x86_64-macosx" #:platform "x86_64-macosx")))
> > (define build-deps '("scribble-lib" "racket-doc" "rackunit-lib"))
> > (define scribblings '(("scribblings/testffi.scrbl" ())))
> > (define pkg-desc "testffi Description Here")
> > (define version "0.1")
> > (define pkg-authors '(spdegabrielle))
> >
> > [1] 'copy-foreign-libs' in '6.3 Controlling raco setup with "info.rkt"
> > Files'
> >
> https://docs.racket-lang.org/raco/setup-info.html?q=copy-foreign-libs#%28idx._%28gentag._21._%28lib._scribblings%2Fraco%2Fraco..scrbl%29%29%29
> >
> >
> > [2] https://pkgs.racket-lang.org/package/libvid-x86_64-macosx
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
>
> --
> ~Leif Andersen
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to