WebRTC build error on Mac

225 views
Skip to first unread message

henry xing

unread,
May 11, 2017, 3:05:27 AM5/11/17
to discuss-webrtc
Hi,
     I am newbie using webrtc. When I build the Webrtc, I got a linking problem.
     The build command is below:
     ninja -C out/Default
     The build error context:

     ninja: Entering directory `out/Default'
[263/2512] LINK ./genmacro
FAILED: genmacro
TOOL_VERSION=1494398103 ../../build/toolchain/mac/linker_driver.py ../../third_party/llvm-build/Release+Asserts/bin/clang++  -stdlib=libc++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.9 -Wl,-ObjC -Wl,-pie -Werror -o "./genmacro" -Wl,-filelist,"./genmacro.rsp"
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Traceback (most recent call last):
  File "../../build/toolchain/mac/linker_driver.py", line 229, in <module>
    Main(sys.argv)
  File "../../build/toolchain/mac/linker_driver.py", line 79, in Main
    subprocess.check_call(compiler_driver_args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['../../third_party/llvm-build/Release+Asserts/bin/clang++', '-stdlib=libc++', '-arch', 'x86_64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk', '-mmacosx-version-min=10.9', '-Wl,-ObjC', '-Wl,-pie', '-Werror', '-o', './genmacro', '-Wl,-filelist,./genmacro.rsp']' returned non-zero exit status 1
    
     The c++ lib is installed in my system. What's the problem?
     Thanks for you help.
Henry.

Henrik Kjellander

unread,
May 16, 2017, 4:35:40 PM5/16/17
to discuss-webrtc
Please share the details about what OS version and Xcode version you have together with the command line you used to run GN to produce the ninja files in out/Default.

And which WebRTC version you're building, is this an up-to-date master branch?

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/259bd117-b198-4839-9772-0c35dcde364a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Henrik Kjellander

unread,
May 16, 2017, 4:36:09 PM5/16/17
to discuss-webrtc, kjell...@webrtc.org

henry xing

unread,
Jun 15, 2017, 4:17:07 AM6/15/17
to discuss-webrtc
Xcode 8.3.1
Build version 8E1000a

OSX Version: 10.12 macOS Sierra

Command line to generate ninja file: gn gen out/Default

在 2017年5月17日星期三 UTC+8上午4:35:40,Henrik Kjellander写道:
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.

Henrik Kjellander

unread,
Jun 15, 2017, 7:18:08 AM6/15/17
to discuss-webrtc
I suspect you may have another version of ld or another toolchain related executable in your PATH.
Please share your PATH and let us know if you have anything installed with MacPorts or Homebrew. 

henry xing

unread,
Jun 15, 2017, 11:32:45 PM6/15/17
to discuss-webrtc
Yes,That's the problem.
I reset the PATH variable, then the ld tool path change to /usr/bin/ld, which the path is /opt/local/bin/ld before.
Now I'm glad that I can build webrtc sucessfully.
Thank you Henrik. Thanks.

在 2017年6月15日星期四 UTC+8下午7:18:08,Henrik Kjellander写道:
Reply all
Reply to author
Forward
0 new messages