iOS8/Swift and MobileVLCKit build fails

iOS, iPad, iPhone, tvOS specific usage questions
jeanlolo
New Cone
New Cone
Posts: 9
Joined: 21 Aug 2015 10:23

iOS8/Swift and MobileVLCKit build fails

Postby jeanlolo » 21 Aug 2015 11:04

Hello,

I'm struggling a bit to build my project with MobileVLCKit and cocoapods.
Without adding any VLCKit code, I get errors when building the app, on simulator or device.

Pod file:

Code: Select all

platform :ios, '8.0' target 'VLCKitTest' do pod 'MobileVLCKit' end
This is the error I get

Code: Select all

Undefined symbols for architecture arm64: "std::runtime_error::runtime_error(std::string const&)", referenced from: libebml::CRTError::CRTError(std::string const&, int) in MobileVLCKit(StdIOCallback.o) "std::ostream& std::ostream::_M_insert<void const*>(void const*)", referenced from: libebml::IOCallback::writeFully(void const*, unsigned long) in MobileVLCKit(IOCallback.o) libebml::IOCallback::readFully(void*, unsigned long) in MobileVLCKit(IOCallback.o) [...]
My deployment target is 8.0.
I have set my "Build Active Architecture Only" to YES in Debug.

Thanks a lot for your help!

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: iOS8/Swift and MobileVLCKit build fails

Postby fkuehne » 21 Aug 2015 12:02

You don't link against libc++.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

jeanlolo
New Cone
New Cone
Posts: 9
Joined: 21 Aug 2015 10:23

Re: iOS8/Swift and MobileVLCKit build fails

Postby jeanlolo » 21 Aug 2015 14:25

My C++ Standard Library setting is set to libc++

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: iOS8/Swift and MobileVLCKit build fails

Postby fkuehne » 21 Aug 2015 14:27

Yes, but you don't link against it. Add it as a "framework" to your linking step.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

jeanlolo
New Cone
New Cone
Posts: 9
Joined: 21 Aug 2015 10:23

Re: iOS8/Swift and MobileVLCKit build fails

Postby jeanlolo » 21 Aug 2015 15:41

Hello Felix,

thanks for your answers. Unfortunately it still doesn't work.
Here are my settings:

Image

Image

I just figured that in my Other Linker Flags, I had "-l stdc++" because I'm using Core Plot. Could it be the cause of the problem?

Image

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: iOS8/Swift and MobileVLCKit build fails

Postby fkuehne » 21 Aug 2015 15:44

Yes, you should decide for 1 c++ stdlib. Mixing 2 can lead to evil things such as this one.

Of course, you can also recompile MobileVLCKit to deploy the GNU stdlib. This is still supported in current releases (it will go away this fall).
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

jeanlolo
New Cone
New Cone
Posts: 9
Joined: 21 Aug 2015 10:23

Re: iOS8/Swift and MobileVLCKit build fails

Postby jeanlolo » 24 Aug 2015 10:01

To be sure I created a new blank project:
- I delete the Tests target
- I add the podfile to the project
- I execute "pod install"
- I close my project, and open the the new workspace

Here if I build I get the "Undefined symbols for architecture" error.

So I check the flags in the xcconfig file and cocoapods automatically adds: -l"stdc++"
The C++ Standard library is set to libstdc++ by default, so I add "libstdc++" in Link Binary with Libraries.

Then I compile again and it fails.

I tried several other combination using libc++, removing the flag...but nothing works.

What did I forget?

Thanks for your help!

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: iOS8/Swift and MobileVLCKit build fails

Postby fkuehne » 24 Aug 2015 10:29

Do you get the same undefined symbols when linking either libstdc++ or libc++ or different ones? Note that MobileVLCKit requires a lot more frameworks from the OS to link against, which will also lead to undefined symbol errors if you don't.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

jeanlolo
New Cone
New Cone
Posts: 9
Joined: 21 Aug 2015 10:23

Re: iOS8/Swift and MobileVLCKit build fails

Postby jeanlolo » 24 Aug 2015 10:52

I have in both cases:

Code: Select all

Undefined symbols for architecture x86_64: "std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::find(wchar_t const*, unsigned long, unsigned long) const", referenced from: TagLib::String::find(TagLib::String const&, int) const in MobileVLCKit(tstring.cpp.o) TagLib::String::split(TagLib::String const&) const in MobileVLCKit(tstring.cpp.o) "std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::rfind(wchar_t const*, unsigned long, unsigned long) const", referenced from: TagLib::String::rfind(TagLib::String const&, int) const in MobileVLCKit(tstring.cpp.o) "std::string::find(char const*, unsigned long, unsigned long) const", referenced from:
I guess that cocoapods automatically adds them when compiling:
-framework AVFoundation -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreText -framework MobileVLCKit -framework OpenGLES -framework QuartzCore -framework Security

I added them nonetheless in the Build Phases but it did not change the results of the compilation.

jeanlolo
New Cone
New Cone
Posts: 9
Joined: 21 Aug 2015 10:23

Re: iOS8/Swift and MobileVLCKit build fails

Postby jeanlolo » 24 Aug 2015 14:43

After searching a bit I succeeded in compiling the blank objective C project with a 6.1 deployment target, unfortunately I need to make it work on iOS8 with swift.

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: iOS8/Swift and MobileVLCKit build fails

Postby fkuehne » 24 Aug 2015 17:39

I'd like you to try a special binary I'd cook until tomorrow morning CEST if you are interested, which should solve this issue and will support 8.0 or later, but nothing less.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

jeanlolo
New Cone
New Cone
Posts: 9
Joined: 21 Aug 2015 10:23

Re: iOS8/Swift and MobileVLCKit build fails

Postby jeanlolo » 24 Aug 2015 17:44

With great pleasure!
Thank you Felix.

jeanlolo
New Cone
New Cone
Posts: 9
Joined: 21 Aug 2015 10:23

Re: iOS8/Swift and MobileVLCKit build fails

Postby jeanlolo » 27 Aug 2015 14:22

Hello Felix,

do you have any news on that cook?

Thanks

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: iOS8/Swift and MobileVLCKit build fails

Postby fkuehne » 28 Aug 2015 11:30

Thanks for the reminder - I knew that I forgot something :D

There you go: http://files.feepk.net/_/bvna5xE

Note that in addition to the previous static framework, we also support dynamic frameworks now.
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net

jeanlolo
New Cone
New Cone
Posts: 9
Joined: 21 Aug 2015 10:23

Re: iOS8/Swift and MobileVLCKit build fails

Postby jeanlolo » 28 Aug 2015 15:48

It works!
Thank you so much for all your help Felix, you rock!

fkuehne
Developer
Developer
Posts: 7264
Joined: 16 Mar 2004 19:37
VLC version: 0.4.6 - present
Operating System: Darwin
Location: Germany
Contact:

Re: iOS8/Swift and MobileVLCKit build fails

Postby fkuehne » 28 Aug 2015 17:36

Great to hear, enjoy! Feel free to drop me a line when your app is in production. We are always curious where our code ends up :)
VideoLAN
Felix Paul Kühne
Medic. VLC developer for appleOS since before you were born.
Blog: https://www.feepk.net


Return to “VLC for iOS, iPadOS and Apple TV”

Who is online

Users browsing this forum: No registered users and 15 guests