Page 1 of 1

Using LibVLC on MacOSX

Posted: 30 Mar 2012 08:14
by Brit
I've been having trouble getting LibVLC to work with my application. I'm using Mac OS X 10.6 and XCode. (I have it embedded into a Qt application in Windows, but when I try to port it to Mac, I run into problems.) I downloaded the 64-bit version of VLC (VLC 2.0.1 64-bit), selected "Show Package Contents" on the VLC.app, and grabbed some of the files, and put them into my application's directory.

Specifically, I took all the directories (shown below) and copied them to my application's folder.
/Contents/MacOS/bin/
/Contents/MacOS/include/
/Contents/MacOS/lib/ (this contains the libvlc.5.dylib and libvlccore.5.dylib)
/Contents/MacOS/plugins/
/Contents/MacOS/share/

So it looks like this:
MyApplicationDirectory/[MyApplication]
MyApplicationDirectory/bin/
MyApplicationDirectory/include/
MyApplicationDirectory/lib/
MyApplicationDirectory/plugins/
MyApplicationDirectory/share/

I also tried copying the dylibs (libvlc.5.dylib and libvlccore.5.dylib) into the same directory as my application, but that didn't help either.

When I run my application, it fails to open and I get an error message "[LunarSim] cannot be opened because of a problem. Check with the developer to make sure [LunarSim] works with this version of Mac OSX..." I only get this error when I add LibVLC to my application. I'm not trying to open any media files yet, I'm just trying to link it into my application.

Am I missing something? Is there a different way to accomplish this? I couldn't find much information about how to use LibVLC on Mac OSX. (I could only find information on how to get/install the VLC Player or rebuild the entire project. I just want the library.)

* Changed "Sim" to "LunarSim" in the error message for clarity.

Re: Using LibVLC on MacOSX

Posted: 30 Mar 2012 15:17
by Jean-Baptiste Kempf
Whas is Sim?

Re: Using LibVLC on MacOSX

Posted: 30 Mar 2012 19:15
by Brit
The name of the application. Edit: I changed it to [LunarSim] instead of Sim in the error message for clarity.

Re: Using LibVLC on MacOSX

Posted: 31 Mar 2012 13:42
by Jean-Baptiste Kempf
What are the logs?

Re: Using LibVLC on MacOSX

Posted: 02 Apr 2012 20:45
by Brit
I'm not sure what you mean. There are log files somewhere? I don't see any logs in the application directory. (I'm new to Mac development, are there some logs stored in some other directory somewhere?)

Re: Using LibVLC on MacOSX

Posted: 03 Apr 2012 01:22
by Jean-Baptiste Kempf
Run your application from the command line, you should see the logs.

Re: Using LibVLC on MacOSX

Posted: 05 Apr 2012 22:58
by Brit
Okay, so here's what's going on: when I try to run the application from Finder, I get the error listed above.

If I run the application from XCode, I get an error message in the status XCode status bar that says, "GDB: Program received signal "EXC_BAD_ACCESS"". The console says, "gdb-i386-apple-d (map: 0x68fe854) triggered DYLD shared region unnest for map: 0x68fe47c, region 0x7ff80e00000->0x7fff81000000. While not abnormal for debuggers, this increases system memory footprint until the target exits."

I'm building the application as x86_64. I thought I'd mention that because the error message has "i386" in the message text, which makes me wonder if its a 32-bit/64-bit problem. (I'm using Qt, which is only available in 64-bit. I hope I don't have to perform the huge task of rebuilding Qt as 32-bit in order to get this to work.)

Re: Using LibVLC on MacOSX

Posted: 19 Dec 2017 12:58
by AndyZhengSeven
are you resolve it?