VideoCore-Inactive icon indicating copy to clipboard operation
VideoCore-Inactive copied to clipboard

I'm getting Linking error undefined symbols arm64 H264Encode

Open antoniotuzzi opened this issue 9 years ago • 9 comments

compiling from scratch the SampleBroadcaster (ObjC) with VideoCore 0.3.2 XCode Version 6.4 (6E35b) (same error in SWIFT project too)

everything seems ok in project settings, I tried to switch "Build current arch only" to OFF too no solution Undefined symbols for architecture arm64: "videocore::Apple::H264Encode::~H264Encode()", referenced from: std::__1::__libcpp_compressed_pair_impstd::__1::allocator<videocore::Apple::H264Encode, videocore::Apple::H264Encode, 1u>::~__libcpp_compressed_pair_imp() in libVideoCore.a(VCSimpleSession.o) "videocore::Apple::H264Encode::H264Encode(int, int, int, int, bool, int)", referenced from: std::__1::shared_ptrvideocore::Apple::H264Encode std::__1::shared_ptrvideocore::Apple::H264Encode::make_shared<double, double, int, int, bool, int&>(double&&, double&&, int&&, int&&, bool&&, int&&&) in libVideoCore.a(VCSimpleSession.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

antoniotuzzi avatar Sep 04 '15 11:09 antoniotuzzi

what version of CocoaPods are you using? I experienced this error when I updated to CocoaPods 0.38.x, and had to switch back to 0.37.2 to make it work

germanSancho avatar Sep 04 '15 12:09 germanSancho

yes, I'm using the 0.38.2 but what could be wrong and different from the 0.37.2 ?

antoniotuzzi avatar Sep 04 '15 15:09 antoniotuzzi

I don't know exactly but it seems the problem comes from the fact that there are two files called H264Encode.h (and .mm) in two different folders. This somehow causes CocoaPods 0.38.2 to "ignore" these files or something like that. If you see the output of pod install or pod update you'll notice a warning about those files.

I did not have time to investigate more deeply so I don't know what the problem exactly is, but if you downgrade to 0.37.x and run pod install/pod update again it should work correctly.

germanSancho avatar Sep 04 '15 15:09 germanSancho

at the end I was able to compile with CocoaPods 0.38.2 you must add manually the 2 files removed by the pod install process: Precisely are ../../../transforms/Apple/H264Encode.h and ../../../transforms/Apple/H264Encode.mm

thank you for your HELP!! Antonio

antoniotuzzi avatar Sep 04 '15 16:09 antoniotuzzi

No problem :)

Anyway this should be fixed. Does anyone know whether this comes from a bug in CocoaPods itself (that's my bet) or from a misconfiguration in VideoCore ? In the former case, an issue should be raised in their github...

germanSancho avatar Sep 07 '15 07:09 germanSancho

I don't really know much about Cocoapods but we haven't really changed anything since Jeffrey made the pod last summer. I bet it's a bug or something in the new version if it's complaining about files with duplicate names. It should be possible to put files with the same names in different directories and still have it work with the build system!

On Mon, Sep 7, 2015 at 12:48 AM, Germán Sancho [email protected] wrote:

No problem :)

Anyway this should be fixed. Does anyone know whether this comes from a bug in CocoaPods itself (that's my bet) or from a misconfiguration in VideoCore ? In the former case, an issue should be raised in their github...

— Reply to this email directly or view it on GitHub https://github.com/jgh-/VideoCore/issues/186#issuecomment-138218263.

jgh- avatar Sep 07 '15 15:09 jgh-

Yes, the cocoa pod 0.38.2 installer breaks the project: if you take a look at the compiled files you'll see the same iOS/H264Encode.mm present twice.

You need to

  1. Remove one of the files
  2. Add the Apple/H264Encode.mm one
  3. Set the -fno-objc-arc option similar to all the other files in the project.

Obviously this local change will have to be remade every time you update pods, so we really need to get in touch with the CocoaPod team.

Did anyone already file this issue to them?

ilyannn avatar Sep 07 '15 15:09 ilyannn

I have the same issue with U, need to add Apple/H264Encode.mm every time to update pods

toss156 avatar Sep 08 '15 01:09 toss156

Rename transforms/Apple/H264Encode.{h,mm} to H264EncodeApple(so does the include header) does the work. Need to pod install after rename

familyconnect avatar May 28 '16 15:05 familyconnect