Re: [discuss-webrtc] Re: Inherit from talk_base::RefCountInterface -> talk/base/refcount.h:61: undefined reference to...

194 views
Skip to first unread message

Alexandre GOUAILLARD

unread,
Nov 26, 2013, 12:09:02 PM11/26/13
to discuss...@googlegroups.com
hi francois,

Not sure if that will help but the original code you have two things happening:
- the constructor of talk_base::RefCountedObject<Conductor>  is called through "new" and gets  the address of "client" and "and" as parameters
- the constructor of "conductor" is called

in your code you only call one pointer and assign it directly (see the "=" instead of the parenthesis syntax).

Additionally, this error means it did not find a constructor for your object of type PeerConnectionDedicated:
""undefined reference to `PeerConnectionDedicated::PeerConnectionDedicated()'""



On Tue, Nov 26, 2013 at 12:45 AM, Francois Temasys <regn...@temasys.com.sg> wrote:
Sorry in my implementation I'm doing:
talk_base::scoped_refptr<PeerConnectionDedicated> tmpPeer = new talk_base::RefCountedObject<PeerConnectionDedicated>();


On Tuesday, November 26, 2013 4:43:03 PM UTC+8, Francois Temasys wrote:
Hi,

I'm trying to work on a project similar to the peerconnection_client/server project.

I have made a class quite similar to the "conductor" class that inherits from: public webrtc::PeerConnectionObserver AND public webrtc::CreateSessionDescriptionObserver
I have understood because CreateSessionDescriptionObserver inherits from talk_base::RefCountInterface I need to use a special creation for the object. For example in the main conductor

talk_base::scoped_refptr<Conductor> conductor(new talk_base::RefCountedObject<Conductor>(&client, &wnd));

In my implementation I'm doing:
talk_base::scoped_refptr<PeerConnectionDedicated> tmpPeer = new talk_base::RefCountedObject<PeerConnectionDedicated>(target_id,_serverUrl,this);

But in this case my project doesn't compile for the linking:
Conductor.cpp.o: In function `talk_base::RefCountedObject<PeerConnectionDedicated>::RefCountedObject()':
/talk/base/refcount.h:49: undefined reference to `PeerConnectionDedicated::PeerConnectionDedicated()'


CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o:(.data.rel.ro._ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE[_ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE]+0x10): undefined reference to `PeerConnectionDedicated::OnError()'
CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o:(.data.rel.ro._ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE[_ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE]+0x28): undefined reference to `PeerConnectionDedicated::OnAddStream(webrtc::MediaStreamInterface*)'
CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o:(.data.rel.ro._ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE[_ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE]+0x30): undefined reference to `PeerConnectionDedicated::OnRemoveStream(webrtc::MediaStreamInterface*)'
CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o:(.data.rel.ro._ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE[_ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE]+0x58): undefined reference to `PeerConnectionDedicated::OnIceCandidate(webrtc::IceCandidateInterface const*)'
CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o:(.data.rel.ro._ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE[_ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE]+0x80): undefined reference to `PeerConnectionDedicated::OnSuccess(webrtc::SessionDescriptionInterface*)'
CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o:(.data.rel.ro._ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE[_ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE]+0x88): undefined reference to `PeerConnectionDedicated::OnFailure(std::string const&)'
CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o:(.data.rel.ro._ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE[_ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE]+0xd0): undefined reference to `non-virtual thunk to PeerConnectionDedicated::OnSuccess(webrtc::SessionDescriptionInterface*)'
CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o:(.data.rel.ro._ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE[_ZTVN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE]+0xd8): undefined reference to `non-virtual thunk to PeerConnectionDedicated::OnFailure(std::string const&)'
CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o:(.data.rel.ro._ZTIN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE[_ZTIN9talk_base16RefCountedObjectI23PeerConnectionDedicatedEE]+0x10): undefined reference to `typeinfo for PeerConnectionDedicated'
CMakeFiles/appRTCdesk.dir/Source/Conductor.cpp.o: In function `talk_base::RefCountedObject<PeerConnectionDedicated>::~RefCountedObject()':
/home/game/CBProjects/fullSRC/mylibjingleSRC/talk/base/refcount.h:88: undefined reference to `PeerConnectionDedicated::~PeerConnectionDedicated()'




I don't understand this error, why does the refcount can't find the constructor (it is public)? 



--
 
---
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages