0

I am trying to build openh264 for ios. I have downloaded the source code from the latest release. then changed the PREFIX in makefile to ios_local. After that I did make OS=ios ARCH=arm64 which completed with lot of warning.

After that when I did sudo make OS=ios ARCH=arm64 install It exited with error like below

clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of iOS 7 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libopenh264.2.0.0.dylib] Error 1

After researching it seems like Apple does not support libstdc++ now, so mac os compatible version is libc++ which is supposed to be installed when you install XCode. My XCode version is Version 10.2.1 (10E1001) which is more than enough to get this libc++ I think.I am using macOS Mojave. What's going wrong here?

Anuran Barman
  • 1,556
  • 2
  • 16
  • 31
  • Where are you including the library? I imagine this will just be a simple switch in a header file? – Harry Beadle Jul 17 '19 at 13:09
  • sorry did not get you. including means? I am just compiling the given source from the git. only thing I changed in the makefile is PREFIX value. In the Makefile I see this line `STATIC_LDFLAGS=-lstdc++`. Is this line creating the problem? – Anuran Barman Jul 17 '19 at 13:16
  • Try changing that to `STATIC_LDFLAGS=-libc++` to use the newer library. You will probably have to change the `#include ` (or simular) in the source too. Can you add a link to the git repo in your question? – Harry Beadle Jul 17 '19 at 13:18
  • here is the git repo: https://github.com/cisco/openh264/ – Anuran Barman Jul 17 '19 at 13:19
  • Try changing the `LDFLAGS` in the makefile. What happens? – Harry Beadle Jul 17 '19 at 13:25
  • No, it does not work. I changed. Interesting enough, it still complains about the same problem though the LDFLAG is changed. I guess error is coming from inside not the Makefile. – Anuran Barman Jul 17 '19 at 13:28
  • Have you got libstdc++ installed? If it's a legacy library it won't come bundled with xcode. The makefile works fine on my machine. – Harry Beadle Jul 17 '19 at 13:34
  • I dont have libstdc++. XCode 10 does not have it. It's available till XCode 8 which I dont have access to now. Neither macOS Mojave has it. – Anuran Barman Jul 17 '19 at 13:37
  • Try installing the correct version from source.https://gcc.gnu.org/onlinedocs/libstdc++/ – Harry Beadle Jul 17 '19 at 13:43
  • Solved the issue by https://stackoverflow.com/questions/51060596/ld-library-not-found-for-lstdc-6 . Though there is another problem occurring but that some header file missing issue. – Anuran Barman Jul 17 '19 at 13:50

0 Answers0