leif
2017-7-18 14:07:40

leif
2017-7-18 14:07:58

@mflatt Any idea what I’m missing here? ^


leif
2017-7-18 14:08:24

Namely, it looks like ffi-lib is not searching where get-lib-search-dirs says it will, despite what the docs says?


mflatt
2017-7-18 14:09:21

You’re definitely using a 32/64-bit DLL with a 32/64-bit Racket?


sergej
2017-7-18 14:09:37

55 vs 57?


leif
2017-7-18 14:09:45

Woops, wrong image


leif
2017-7-18 14:09:57

@sergej I get the same issue with 57.


mflatt
2017-7-18 14:10:02

Does the DLL have any dependencies?


leif
2017-7-18 14:10:07

leif
2017-7-18 14:10:26

I get this issue with both 32 and 64 bit varients of windows.


leif
2017-7-18 14:10:44

I downloaded them from the ffmpeg website. So honestly, I don’t know if they have any deps.


leif
2017-7-18 14:10:49

I can check.


leif
2017-7-18 14:12:33

Hmm…the website lets you pick. And I’m pretty sure I picked the right one. I’ll see if there is anyway to tell on Windows.


leif
2017-7-18 14:12:43

Also, here is the website: https://ffmpeg.zeranoe.com/builds/


mflatt
2017-7-18 14:12:57

I recommend “depends.exe”


leif
2017-7-18 14:13:11

Specifically 3.3.2 > 32/64 (in this case 32) > Shared


leif
2017-7-18 14:13:15

Oh cool, thanks.


leif
2017-7-18 14:17:04

Hmm…that very likely could be the problem:


leif
2017-7-18 14:17:13

leif
2017-7-18 14:17:37

They look like standard libraries, but apparently they’re not there.


mflatt
2017-7-18 14:20:18

I think those are VC++ redistributable DLLs, which means that they don’t come with the OS, but applications can redistribute and install them. They’re a pain.


leif
2017-7-18 14:20:18

OH


leif
2017-7-18 14:20:52

Yup, that’s what I just found out too. (Although its not clear what version of the packages they are).


leif
2017-7-18 14:20:55

Anyway…ugg…thanks.


mflatt
2017-7-18 14:21:44

Also keep in mind that just putting the dependencies in Racket’s “lib” won’t make them found. The strategy that works best is to manually load every dependency before anything that needs it.


leif
2017-7-18 14:23:42

Welp…ugg… I see.


leif
2017-7-18 14:23:55

Would you happen to have a good tutorial on the proper use of them?


leif
2017-7-18 14:24:07

(I’m going to assume no, but its worth asking anyway. :slightly_smiling_face: )


leif
2017-7-18 14:29:35

@mflatt Oh interesting, it looks like the library was compiled on Ubuntu with the MinGW-w64 toolchain.


mflatt
2017-7-18 14:31:30

I have managed to avoid all VC redistributables – mostly by using MinGW-w64, but maybe there are modes that involve them even with MinGW-w64


mflatt
2017-7-18 14:31:58

So, other than avoiding them, I don’t have good advice for dealing with redistributables


leif
2017-7-18 14:36:14

Ha, fair, thanks.


leif
2017-7-18 14:47:29

Interesting. I am not finding a mode where mingw-w64 uses VC++ libraries. I wonder if one of the DLLs that build used linked to those libraries.


leif
2017-7-18 14:51:21

Oh, here’s a thought. Maybe GCC has its own runtime that tries to mimic the VC++ one.


leif
2017-7-18 14:58:31

@mflatt Hmm…apparently this post seems to indeicate that this might not be the case: https://www.windowsforum.org/topic/51273-mingw-c11-app-compiles-cant-run-outside-ide-0xc000007b/


leif
2017-7-18 14:58:43

Err…that dependency walker is misleading here.


mflatt
2017-7-18 15:01:48

Ok – now I understand the part of the screen shown by your image. For this purpose, you should pay attention only to the top-left panel of “depends.exe”


leif
2017-7-18 15:11:12

But wasn’t that screenshot from the top panel?


leif
2017-7-18 15:12:03

leif
2017-7-18 15:12:06

Like, here is the whole window.


leif
2017-7-18 15:28:39

Ah, okay, I see what you mean now


leif
2017-7-18 15:28:43

(I needed a reboot apparently)


leif
2017-7-18 15:30:43

leif
2017-7-18 15:30:59

@mflatt Ya, it doesn’t seem to have any extra libs.


leif
2017-7-18 15:31:42

(AVUtil and SWResample are also part of ffmpeg and in the same directory as AVcocec)


mflatt
2017-7-18 15:32:07

So, does it work to explicitly load “AVUTIL–55.DLL” and “SWRESAMPLE–2.DLL” first?


mflatt
2017-7-18 15:32:19

(since they won’t be found by just being in “lib”)


leif
2017-7-18 15:33:53

Oh yes they are.


leif
2017-7-18 15:33:57

err…yes it does work.


leif
2017-7-18 15:34:03

Odd. I wonder why that worked on OS X. :confused:


leif
2017-7-18 15:34:32

(I used the @loader_path symbol when compiling it for os x, that might be why.)


leif
2017-7-18 15:34:34

Anyway, thanks. :smile:


mflatt
2017-7-18 15:35:07

Yes, @loader_path avoids the problem


leif
2017-7-18 15:36:05

Anyway, this seems to work, if I just reorder the way I load the libraries. Thanks. :slightly_smiling_face:


leif
2017-7-18 15:42:36

So, question I should probably know the answer to; does this mean that if I have some lib a.so, that links to b.so (but the link has an absolute path), if the program dynamically loads b.so first, and then a.so, it doesn’t matter what directories the two libraries are in?


mflatt
2017-7-18 16:10:56

@leif Possibly. Probably it depends on the OS, and it may depend on whether the shared library is opened in “global” mode versus “local” mode (where racket uses the latter by default, at least on most platforms)


leif
2017-7-18 16:13:24

That makes sense.


leif
2017-7-18 16:13:31

Well at least it seems to work on Windows. So thanks. :slightly_smiling_face:


soegaard2
2017-7-18 16:15:44

leif
2017-7-18 16:39:21

@soegaard2 Oh cool, thanks.