Closed zeyonaut closed 8 years ago
If you try to compile and link c++ program that uses and links to ffmpeg libraries, does the same happen? Also, was the ffmpeg compiled with clang, or maybe gcc? I don't know if gcc is supported anymore on the OSX, but could you maybe try co compile ffmpeg 2.7.6 with gcc, then try the same?
I can't remember what ffmpeg was compiled with, it was just the configure, make, and make install. With clang, building a c++ project with ffmpeg's libraries linked works as expected. Only d has this problem.
I'm not really sure what could be the problem here. I would gladly try to solve this, but I'd have to set up a virtual machine to do it, and since I'm short of spare time, I fear It could take me a long time to do it. The only thing I suggest is to try to build ffmpeg with gcc if possible, and then try to link it in D program. Although that is only a guess, since I know really nothing about the DMD for OS X. Anyway, if building it with gcc doesn't cut it, I think we should go on D forums with this. I suppose this problem is strongly related to the OS X platform itself (or maybe clang), so I believe more experienced people could help here. Do you agree?
Sure. I'll compile it one more time and ask somewhere else. Thanks for your help.
Great! Thank you as well, for bringing this issue up! Could I ask you to leave a notification here about your findings on this issue afterwards? If this problem is, as I suspect, matter of system configuration, and not the library itself, then other people will cross it in future for sure...
Alright, I found an answer. I don't know if this is intended, but I had to run (while building ffmpeg) ./configure --disable-pthreads
. That fixed it, at least for now. I'm not sure if it's supposed to run without threads. Furthermore, ./configure --help
shows disable pthreads [autodetect]
which seems to indicate that it's meant to be detected automatically, which is strange.
I'm not sure if this is the end of it. I'll keep you posted if I find another solution or something else happens. For now, I'll be testing some code first just to make sure things work fine.
That's great, and thanks for the info! Although, I also feel that this is not a long term fix. But anyways, I hope it works for you for now. Cheers!
Although I couldn't get this to work through installing FFMPEG manually, I could by installing it through Homebrew.
I think this thread should be closed, because it is more of an issue with dmd linking. Perhaps a tip could be left in the README instead.
Awesome- Thanks, Aaron! Will close the issue as soon as I update the README as you've suggested.
Cheers!
Linker issue is visible on Ubuntu 17.10. Apparently this occurs because I didn't build FFmpeg from source, but I use the one that comes with the distro by default. Just had to install the following packages to solve this issue (sudo apt install <package>
).
libavcodec-dev
libavformat-dev
libavdevice-dev
libavfilter-dev
libavutil-dev
libswscale-dev
That's what happens on my MBA 2013 running OS X 10.11.2. Here's my LD version.
I did some research. Apparently pthread is not supported everywhere. It is hard to find info on. Perhaps that is true for OS X too?
This only happens when depending on ffmpeg-d.