好吧,我正在尝试使用以下命令编译名为'pcp'的文件共享示例
wolfgang@den-pc:~/tejesh/libjingle-0.6.14/programs$ g++ -g -Wall -DPOSIX
-DEXPAT_RELATIVE_PATH -DFEATURE_ENABLE_SSL -DHAVE_OPENSSL_SSL_H=1 -I ../ pcp_main.cc
../talk/build/dbg/lib/libxmpphelp.a ../talk/build/dbg/lib/libjingle.a ../talk/build
/dbg/lib/libexpat.a ../talk/build/dbg/lib/libsrtp.a -lpthread -lssl
我收到以下'typeinfo'错误...
pcp_main.cc: In member function ‘virtual void
CustomXmppPump::OnStateChange(buzz::XmppEngine::State)’:
pcp_main.cc:348:12: warning: enumeration value ‘STATE_NONE’ not handled in switch
[-Wswitch]
/tmp/ccVe8JUg.o:(.rodata._ZTI14CustomXmppPump[typeinfo for CustomXmppPump]+0x18):
undefined reference to `typeinfo for XmppPump'
/tmp/ccVe8JUg.o:(.rodata._ZTIN7cricket18SessionManagerTaskE[typeinfo for
cricket::SessionManagerTask]+0x8): undefined reference to `typeinfo for buzz::XmppTask'
/tmp/ccVe8JUg.o:(.rodata._ZTIN7cricket15SessionSendTaskE[typeinfo for
cricket::SessionSendTask]+0x8): undefined reference to `typeinfo for buzz::XmppTask'
/tmp/ccVe8JUg.o:(.rodata._ZTI17AutoPortAllocator[typeinfo for AutoPortAllocator]+0x8):
undefined reference to `typeinfo for cricket::HttpPortAllocator'
collect2: ld returned 1 exit status
有人对这个问题有所了解吗?
答案 0 :(得分:1)
如果使用gyp进行编译,则可以更改trunk / talk / libjingle_examples.gyp:
# target pcp
{
'target_name': 'pcp',
'type': 'executable',
'dependencies': [
'libjingle_xmpphelp',
'libjingle.gyp:libjingle',
'libjingle.gyp:libjingle_p2p',
],
'sources': [
'examples/pcp/pcp_main.cc',
],
}, # target pcp
再次运行gclient runhooks并制作。
答案 1 :(得分:0)
此错误可能是由某些虚拟方法没有定义引起的 - 即您已声明但未定义其正文。
可能你没有在编译/链接中包含一些.c / .cpp文件?
答案 2 :(得分:0)
是否设法通过scons成功编译pcp,.........在你的talk /目录中将以下行附加到'libjingle.scons'
talk.App(env, name = "pcp",
posix_libs = [
"crypto",
"ssl",
],
srcs = [
"examples/pcp/pcp_main.cc",
],
libs = [ “顺口溜”, “外籍人士”, “SRTP” “xmpphelp” ] )
然后使用libjingle的README中的指令构建它.. pcp binary将构建在/ talk / build / dbg / staging /目录中..