Linux jrtplib编译错误解决

来源:互联网 发布:icloud软件下载 编辑:程序博客网 时间:2024/05/28 15:07
 /tmp/ccT7Z5Vh.o: In function `checkerror(int)':
example1.cpp:(.text+0x91): undefined reference to `jrtplib::RTPGetErrorString(int)'
/tmp/ccT7Z5Vh.o: In function `main':
example1.cpp:(.text+0x137): undefined reference to `jrtplib::RTPSession::RTPSession(jrtplib::RTPRandom*, jrtplib::RTPMemoryManager*)'
example1.cpp:(.text+0x2bc): undefined reference to `jrtplib::RTPSessionParams::RTPSessionParams()'
example1.cpp:(.text+0x327): undefined reference to `jrtplib::RTPSession::Create(jrtplib::RTPSessionParams const&, jrtplib::RTPTransmissionParams const*, jrtplib::RTPTransmitter::TransmissionProtocol)'
example1.cpp:(.text+0x367): undefined reference to `jrtplib::RTPSession::AddDestination(jrtplib::RTPAddress const&)'
example1.cpp:(.text+0x3d1): undefined reference to `jrtplib::RTPSession::SendPacket(void const*, unsigned int, unsigned char, bool, unsigned int)'
example1.cpp:(.text+0x3ed): undefined reference to `jrtplib::RTPSession::BeginDataAccess()'
example1.cpp:(.text+0x3fb): undefined reference to `jrtplib::RTPSession::GotoFirstSourceWithData()'
example1.cpp:(.text+0x422): undefined reference to `jrtplib::RTPSession::DeletePacket(jrtplib::RTPPacket*)'
example1.cpp:(.text+0x430): undefined reference to `jrtplib::RTPSession::GetNextPacket()'
example1.cpp:(.text+0x44c): undefined reference to `jrtplib::RTPSession::GotoNextSourceWithData()'
example1.cpp:(.text+0x45e): undefined reference to `jrtplib::RTPSession::EndDataAccess()'
example1.cpp:(.text+0x4d4): undefined reference to `jrtplib::RTPSession::BYEDestroy(jrtplib::RTPTime const&, void const*, unsigned int)'
example1.cpp:(.text+0x59e): undefined reference to `jrtplib::RTPSession::~RTPSession()'
example1.cpp:(.text+0x5c6): undefined reference to `jrtplib::RTPSession::~RTPSession()'
/tmp/ccT7Z5Vh.o: In function `jrtplib::RTPIPv4Address::RTPIPv4Address(unsigned int, unsigned short)':
example1.cpp:(.text._ZN7jrtplib14RTPIPv4AddressC1Ejt[jrtplib::RTPIPv4Address::RTPIPv4Address(unsigned int, unsigned short)]+0x21): undefined reference to `vtable for jrtplib::RTPIPv4Address'
/tmp/ccT7Z5Vh.o: In function `jrtplib::RTPIPv4Address::~RTPIPv4Address()':
example1.cpp:(.text._ZN7jrtplib14RTPIPv4AddressD1Ev[jrtplib::RTPIPv4Address::~RTPIPv4Address()]+0x7): undefined reference to `vtable for jrtplib::RTPIPv4Address'
collect2: ld 返回 1


解决:没有找到静态链接库:编译时加上参数 -l jrtp 就OK了

  eg:  g++ example1.cpp -l jrtp -o example_pc 


0 0