1

Getting a linker error on my swift project on installing MobileVLCKit via pods.

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_VLCMediaPlayer", referenced from:
      objc-class-ref in StreamingController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I did the following steps

  1. To solve errors on building project after pod install of Vlckit In Build-Phases -> Link Binaries -> libstdc++.6.tbd

  2. To solve apple-linker error after previous step BuildSettings ->'EnableBitcode = No'

  3. In Bridging-Header file, do #import <MobileVLCKit/MobileVLCKit.h>

In 'BuildSettings -> other_linker_flags' also, this MobileVLCKit framework is not showing, though I can see 'MobileVLCKit' folder inside the 'Pods' folder


EDIT

I was able to remove this error and make 'MobileVLCKit' to be found by doing these steps:

  1. In Build_Settings -> Other_Linker_Flags, add: -framework "MobileVLCKit"
  2. In Build_Settings -> Other_Linker_Flags, add: -l"bz2"
  3. In Build_Settings -> Other_Linker_Flags, add: -l"iconv"

But then these fixes generated other Linker errors from other framework 'libavsobjc.stripped.a' used in AVSLibrary framework which is used in app for some other purpose.

I want both Vlc and AVSLibrary should co-exist. Any ideas ?

1 Answers1

1

I had the similar problem and it a lot of efforts to fix get this done.

  1. Create a dummy Xcode project, download MobileVLCkit using cocoa pods.
  2. Copy the downloaded "MobileVLCKit.framework" file from the dummy project, into your project root folder.
  3. Go to your project's target build settings and add the following lines to your "Header Search Paths" (add the quotes too) "$(PROJECT_DIR)/MobileVLCKit.framework/Headers" "$(BUILT_PRODUCTS_DIR)"
  4. In your project's target build settings add the following lines to your framework search paths (add the quotes too) "$(SRCROOT)/MobileVLCKit.framework" "$(PROJECT_DIR)"
  5. in Other linker flags add the following lines -l"bz2" -l"iconv" -framework "MobileVLCKit"
  6. In General > Linked Frameworks and Libraries add the following library by clicking on the + icon libstdc++.6.tbd
  7. Most important of all add the reference to the Bridging-Header.h by including the following line #import "MobileVLCKit/MobileVLCKit.h"
  8. Test by typing VLCMediaPlayerDelegate, see if that auto completes. If so help others by pointing them here, else retrace your steps to see what you have missed.

Hope that helps. I was able to solve this by the below given link. Source: https://forum.videolan.org/viewtopic.php?f=32&t=137065

Utsav Dusad
  • 2,139
  • 4
  • 31
  • 52