Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webrtc::StatsCollector::GetReport missing #9

Open
amitu opened this issue May 18, 2015 · 4 comments
Open

webrtc::StatsCollector::GetReport missing #9

amitu opened this issue May 18, 2015 · 4 comments

Comments

@amitu
Copy link

amitu commented May 18, 2015

I am getting this error when I am building it using cgo.

Undefined symbols for architecture x86_64:
  "webrtc::StatsCollector::GetReport(std::string const&, std::string const&, webrtc::StatsCollector::TrackDirection)", referenced from:
      webrtc::StatsCollector::GetOrCreateReport(std::string const&, std::string const&, webrtc::StatsCollector::TrackDirection) in libjingle_peerconnection.statscollector.o

I am quite confused. I see GetReport being declared and called, but can not find where is it defined.

Here is a bit more details in log:

# github.com/amitu/webrtc
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix
 "/Applications/Xcode-6.1.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.10.0 -o $WORK/github.com/amitu/webrtc/_obj/_cgo_.o $WORK/github.com/amitu/webrtc/_obj/_cgo_main.o $WORK/github.com/amitu/webrtc/_obj/_cgo_export.o $WORK/github.com/amitu/webrtc/_obj/webrtc.cgo2.o $WORK/github.com/amitu/webrtc/_obj/webrtc.cc.o -lobjc -framework Cocoa -framework Security -framework IOKit -framework AppKit -framework QTKit ../t/../libwebrtc/out/Release/libjingle_media.a ../t/../libwebrtc/out/Release/libjingle_p2p.a ../t/../libwebrtc/out/Release/libjingle_peerconnection.a ../t/../libwebrtc/out/Release/librtc_p2p.a ../t/../libwebrtc/out/Release/librtc_base.a ../t/../libwebrtc/out/Release/librtc_base_approved.a ../t/../libwebrtc/out/Release/libusrsctplib.a ../t/../libwebrtc/out/Release/libsrtp.a ../t/../libwebrtc/out/Release/libboringssl.a ../t/../libwebrtc/out/Release/libexpat.a ../t/../libwebrtc/out/Release/libfield_trial_default.a ../t/../libwebrtc/out/Release/libjsoncpp.a ../t/../libwebrtc/out/Release/libmetrics_default.a ../t/../libwebrtc/out/Release/librtc_xmllite.a ../t/../libwebrtc/out/Release/librtc_xmpp.a ../t/../libwebrtc/out/Release/libsystem_wrappers.a ../t/../libwebrtc/out/Release/libusrsctplib.a ../t/../libwebrtc/out/Release/libwebrtc_common.a ../t/../libwebrtc/out/Release/obj/talk/app/webrtc/libjingle_peerconnection.statscollector.o -lstdc++ -lSystem /Applications/Xcode-6.1.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
  "webrtc::StatsCollector::GetReport(std::string const&, std::string const&, webrtc::StatsCollector::TrackDirection)", referenced from:
      webrtc::StatsCollector::GetOrCreateReport(std::string const&, std::string const&, webrtc::StatsCollector::TrackDirection) in libjingle_peerconnection.statscollector.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
@pigeek
Copy link

pigeek commented Jul 15, 2015

@amitu Have you found a solution to the reported issue?

I have the same issue when I am trying to compile and link libwebrtc as a part of nodejs source. I have tried to add node-webrtc source to be compiled as a native module in nodejs. It passed the compilation, however it fails in a link phase with the following errors (just a few of them):

Undefined symbols for architecture x86_64:
  "webrtc::StatsCollector::GetReport(std::string const&, std::string const&, webrtc::StatsCollector::TrackDirection)", referenced from:
      webrtc::StatsCollector::GetOrCreateReport(std::string const&, std::string const&, webrtc::StatsCollector::TrackDirection) in libjingle_peerconnection.a(libjingle_peerconnection.statscollector.o)
  "cricket::BaseChannel::AddRecvStream(cricket::StreamParams const&)", referenced from:
      webrtc::WebRtcSession::AddSctpDataStream(int) in libjingle_peerconnection.a(libjingle_peerconnection.webrtcsession.o)
  "cricket::BaseChannel::AddSendStream(cricket::StreamParams const&)", referenced from:
      webrtc::WebRtcSession::AddSctpDataStream(int) in libjingle_peerconnection.a(libjingle_peerconnection.webrtcsession.o)
  "cricket::BaseChannel::RemoveRecvStream(unsigned int)", referenced from:
      webrtc::WebRtcSession::RemoveSctpDataStream(int) in libjingle_peerconnection.a(libjingle_peerconnection.webrtcsession.o)
  "cricket::BaseChannel::RemoveSendStream(unsigned int)", referenced from:
      webrtc::WebRtcSession::RemoveSctpDataStream(int) in libjingle_peerconnection.a(libjingle_peerconnection.webrtcsession.o)

I checked how it’s done in node_webrtc and it looks that it’s using ‘-undefined dynamic_lookup’ switch. However, when I tried to add this switch, link was successful, but then on the first attempt to execute the program I got the following error:

dyld: Symbol not found: __ZN7cricket22kMediaProtocolDtlsSctpE
  Referenced from: path/to/node
  Expected in: dynamic lookup

@gtlbupt
Copy link

gtlbupt commented Jul 16, 2015

Mac OS X change clang c++ standard lib from libstdc++ to libc++. When you compile node-webrtc with -stdlib=libstdc++ or -stdlib=libc++, clang may generate different function signature. This is part of my binding.gyp file , may be help.
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.6',
'OTHER_CFLAGS': [
'-std=c++11',
'-stdlib=libstdc++',
'-fexceptions',
'-pipe',
'-fno-ident',
'-fdata-sections',
'-ffunction-sections',
'-fPIC',
'-fpermissive',
]
},

@pigeek
Copy link

pigeek commented Jul 17, 2015

@gtlbupt Thanks for the suggestion, but it didn't help.

Actually what I don't understand is why it passes link when it's compiled as a part of node-webrtc and it doesn't when it's included in nodejs source. I am using exactly the same .cc sources from node-wrtc moved into nodejs environment and I have copied all the flags/defines from binding.gyp.

Another issue is the original question by @amitu: where GetReport is defined? Since I don't see it defined in the code, I would expect it to fail in both cases (as a part of node-wrtc and as a part of nodejs). Looks like I am missing something.

@pigeek
Copy link

pigeek commented Jul 29, 2015

I am still not sure why it didn't work on Mac, but on Linux I was able to pass the link with the following directive

'-Wl,--unresolved-symbols=ignore-in-object-files'

It looks that the missing symbols are not really in use, so probably the clean way is to stub them. But for now it works well as it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants