1

The Issue

I'm trying to compile an iOS test project with the NDI v3.0 SDK and I'm running into Apple Mach-O Linker (ld) Errors. It's a static framework (libndi_ios.a) that you are to link your binary to, and reference the headers in order to use their C/C++ API in our ObjC++ code.

I am copying sample code of theirs that simply creates a NDIlib_send_instance_t for use. As soon as I attempt to compile this code the build fails with this linker error:

Undefined symbols for architecture armv7:
  "NDI_multicast::send::packetize::~packetize()", referenced from:
      std::__1::__shared_ptr_emplace<NDI_multicast::send::packetize, std::__1::allocator<NDI_multicast::send::packetize> >::~__shared_ptr_emplace() in libndi_ios.a(send_server.o)
      std::__1::__shared_ptr_emplace<NDI_multicast::send::packetize, std::__1::allocator<NDI_multicast::send::packetize> >::~__shared_ptr_emplace() in libndi_ios.a(send_server.o)
      std::__1::__shared_ptr_emplace<NDI_multicast::send::packetize, std::__1::allocator<NDI_multicast::send::packetize> >::__on_zero_shared() in libndi_ios.a(send_server.o)
      NDI_multicast::send::send(NDI_multicast::send::config_multicast_t const&) in libndi_ios.a(NDI_multicast_send.o)
      NDI_multicast::send::send(NDI_multicast::send::config_unicast_t const&) in libndi_ios.a(NDI_multicast_send.o)
      NDI_multicast::send::~send() in libndi_ios.a(NDI_multicast_send.o)
  "NDI_multicast::send::packetize::packetize()", referenced from:
      ndi::reference::send::server::send(ndi::reference::buffer_pack const&, ndi::reference::send::connection*) in libndi_ios.a(send_server.o)
      NDI_multicast::send::send(NDI_multicast::send::config_multicast_t const&) in libndi_ios.a(NDI_multicast_send.o)
      NDI_multicast::send::send(NDI_multicast::send::config_unicast_t const&) in libndi_ios.a(NDI_multicast_send.o)
  "NDI_multicast::send::packetize::operator()(std::__1::function<std::__1::pair<unsigned char const*, unsigned long> (unsigned long, unsigned long)>)", referenced from:
      ndi::reference::send::server::send(ndi::reference::buffer_pack const&, ndi::reference::send::connection*) in libndi_ios.a(send_server.o)
      NDI_multicast::send::operator()(NDI_multicast::send::buffer_source_t&, std::__1::pair<int, int>, std::__1::function<void (bool)>) in libndi_ios.a(NDI_multicast_send.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproducing

You can reproduce this error by following the steps below. I'm currently using Xcode 9.4 (and I've tested on the latest beta with the same results)

The steps I have taken to get this error:

  1. Install the NewTek NDI SDK from their website here
  2. Create a new Xcode project for a single view Objective-C iOS app
  3. Rename the ViewController.m to ViewController.mm (So it's compiled as Objc++)
  4. Add /NewTek NDI SDK/include to Header Search Paths
  5. Add /NewTek NDI SDK/lib/iOS to Library Search Paths
  6. Add the libndi_ios.a under the "Link Binary With Libraries" in "Build Phases".
  7. Add this code to the ViewController.mm:

    NDIlib_initialize();
    
    NDIlib_send_create_t NDI_send_create_desc;
    NDI_send_create_desc.p_ndi_name = "My Audio";
    NDI_send_create_desc.clock_audio = true;
    
    // (Without this line, everything compiles fine...)
    NDIlib_send_instance_t pNDI_send = NDIlib_send_create(&NDI_send_create_desc);
    

This will fail with the error above.

One thing that I found interesting was that using other code from their samples, such as for receiving video, worked as expected. The issue only exists when using the NDIlib_send_create API.

Does anyone have any tips, or ideas to lend?


You can find the NewTek iOS SDK by requesting it on their website here.

Will Townsend
  • 11
  • 2
  • 4
  • You should first look at this answer: https://stackoverflow.com/questions/6429494/undefined-symbols-for-architecture-armv7 | If this did not solve your problem, it is possible that the compiled sdk do not include the required symbols. If that is the case, you should be opening a support case on NewTek's web site. – emrahgunduz Jun 28 '18 at 16:26

2 Answers2

0

use nariakiiwatani's ofxNDI static library version.

https://github.com/nariakiiwatani/ofxNDI/blob/master/libs/NDI/lib/iOS/libndi_ios.a

I solved same problem by his static library version.

  • Thanks for the reply! I heard back from NewTek support and they're going to publish an update to the SDK you can get from their website with this issue fixed – Will Townsend Jun 29 '18 at 22:26
0

After contacting support at NewTek about this issue, and linking to this post, they have updated (or are in the process of updating) the library that is included in the SDK. I believe that it will be posted on their website shortly.

Thanks to both Lightlive.dev and emrahgunduz for your suggestions

Will Townsend
  • 11
  • 2
  • 4