Linker error while subclassing public cricket::VideoCapturer

434 views
Skip to first unread message

Zinar

unread,
Oct 8, 2015, 4:27:34 PM10/8/15
to discuss-webrtc
Hi,
I am working on C++ library for video calling. For that I created a NoIDeaVideo subclass of cricket::VideoCapturer. I implemented all the required virtual functions  but for some reason I am getting linker error as : 

 "typeinfo for cricket::VideoCapturer", referenced from:
      typeinfo for videocapture:: NoIDeaVideo in videoCapture.o
ld: symbol(s) not found for architecture arm64



You can refer my code below:

class NoIDeaVideo :
    public cricket::VideoCapturer
    {
    public:
        NoIDeaVideo();
        virtual ~NoIDeaVideo();

        cricket::CaptureState Start(const cricket::VideoFormat& capture_format) override;
        virtual void Stop() override;
        virtual bool IsRunning() override;
        virtual bool GetPreferredFourccs(std::vector<uint32>* fourccs) override;
        virtual bool GetBestCaptureFormat(const cricket::VideoFormat& desired, cricket::VideoFormat* best_format) override;
        virtual bool IsScreencast() const override;
//        void OnMessage(rtc::Message* msg){}

    private:
        RTC_DISALLOW_COPY_AND_ASSIGN(NoIDeaVideo);
        void SignalFrameCapturedOnStartThread(const cricket::CapturedFrame* frame);
        rtc::Thread*  m_Thd; //video capture thread
    };

Please let me know If you want more information about the same. 
Thank you. 

Alexandre GOUAILLARD

unread,
Oct 8, 2015, 5:06:13 PM10/8/15
to discuss...@googlegroups.com
the link error is an architecture mismatch.
you are compiling the current file for arm64, and possibly linking against a lib previously compiled for another architecture.

--

---
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-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/bda772e3-7c88-4fd8-86c8-3273665bb279%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
President - CoSMo Software Consulting, Singapore
------------------------------------------------------------------------------------

Zinar

unread,
Oct 8, 2015, 5:21:10 PM10/8/15
to discuss-webrtc
Hi Alex,

I already compiled for every architecture, you can check below. 

lipo -info WebRTC_Debug_V10081.a 

Architectures in the fat file: WebRTC_Debug_V10081.a are: armv7 i386 x86_64 arm64



I also checked lib functions and they are showing me videocapture functions too. 


0000000000004320 S __ZN7cricket13VideoCapturer16GetApplyRotationEv

                 U __ZN7cricket13VideoCapturer16SetApplyRotationEb

00000000000034f0 S __ZN7cricket13VideoCapturer16SetCaptureFormatEPKNS_11VideoFormatE

                 U __ZN7cricket13VideoCapturer19SetSupportedFormatsERKNSt3__16vectorINS_11VideoFormatENS1_9allocatorIS3_EEEE

                 U __ZN7cricket13VideoCapturer20GetBestCaptureFormatERKNS_11VideoFormatEPS1_

                 U __ZN7cricket13VideoCapturer20MuteToBlackThenPauseEb

0000000000002e60 S __ZN7cricket13VideoCapturer24set_enable_video_adapterEb

                 U __ZN7cricket13VideoCapturer5PauseEb

0000000000002e00 S __ZN7cricket13VideoCapturer5SetIdERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE

                 U __ZN7cricket13VideoCapturer7RestartERKNS_11VideoFormatE

                 U __ZN7cricket13VideoCapturer9OnMessageEPN3rtc7MessageE

                 U __ZN7cricket13VideoCapturerC2Ev

0000000000002af0 S __ZN7cricket13VideoCapturerD2Ev




Máté Labádi

unread,
Oct 15, 2015, 4:20:08 PM10/15/15
to discuss-webrtc
Hi, 

when I saw last time this typeinfo link error, the RTTI (Real Time Type Info) feature was missing from my compiler settings.
You should probably enable it when compiling the NoIDeaVideo class.

See this xcode reference for details.

--
Mate


On Thursday, October 8, 2015 at 10:27:34 PM UTC+2, Zinar wrote:
Hi,
I am working on C++ library for video calling. For that I created a NoIDeaVideo subclass of cricket::VideoCapturer. I implemented all the required virtual functions  but for some reason I am getting linker error as : 

 "typeinfo for cricket::VideoCapturer", referenced from:
      typeinfo for videocapture:: NoIDeaVideo in videoCapture.o
ld: symbol(s) not found for architecture arm64


frank.mu...@gmail.com

unread,
Feb 2, 2016, 3:33:22 PM2/2/16
to discuss-webrtc
Hi,

I'm having the same problem with subclassing of cricket::VideoCapturer. My code compiles and runs without errors on Windows, but when I compile the same (Qt based) project on OS X I get the same errors:

Undefined symbols for architecture x86_64:

"typeinfo for cricket::VideoCapturer", referenced from:

typeinfo for remoting::protocol::WebrtcVideoCapturerAdapter in libsessions_core.a(webrtc_video_capturer_adapter.o)

"typeinfo for sigslot::multi_threaded_local", referenced from:

typeinfo for sigslot::_signal_base<sigslot::multi_threaded_local> in libsessions_core.a(webrtc_video_capturer_adapter.o)

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)


I tried to compile my code with RTTI (qmake CONFIG += rtti) and also recompiled librtc_base.a and libjingle_media.a with 

          'xcode_settings': {
            'GCC_ENABLE_CPP_RTTI': 'YES', 
          },
 
in the base.gyp and libjingle.gyp files. Nothing did help so far.

Are there any differences on the Windows and Mac WebRTC configuration that could cause the problem?

Thank you!

Frank
Reply all
Reply to author
Forward
0 new messages