jrtplib-3.1.0 vs.net,如何编译
jrtplib3.1.0是编译通过.
然后我新建立了一个window的控制台项目.(空项目),然后加入example1.cpp.
lib加入jrtplib.lib和wsock32.lib.
结果link的时候出现错误.
问题点数:50、回复次数:7Top
1 楼Crazy_ing(亚变态)回复于 2004-12-02 09:47:22 得分 0
testJRTP error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(char const *)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBD@Z) 已经在 example1.obj 中定义
testJRTP error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::~basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) 已经在 example1.obj 中定义
testJRTP error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z) 已经在 libcpd.lib(ios.obj) 中定义
testJRTP error LNK2005: "public: char const * __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::c_str(void)const " (?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ) 已经在 example1.obj 中定义
testJRTP error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > & (__cdecl*)(class std::basic_ostream<char,struct std::char_traits<char> > &))" (??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z) 已经在 example1.obj 中定义
testJRTP error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??6std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z) 已经在 example1.obj 中定义
testJRTP error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::endl(class std::basic_ostream<char,struct std::char_traits<char> > &)" (?endl@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z) 已经在 example1.obj 中定义
testJRTP error LNK2005: _strncpy 已经在 LIBCD.lib(strncpy.obj) 中定义
testJRTP error LNK2005: "public: virtual __thiscall exception::~exception(void)" (??1exception@@UAE@XZ) 已经在 LIBCD.lib(stdexcpt.obj) 中定义
testJRTP error LNK2005: "public: __thiscall exception::exception(void)" (??0exception@@QAE@XZ) 已经在 LIBCD.lib(stdexcpt.obj) 中定义
testJRTP error LNK2005: "public: __thiscall exception::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z) 已经在 LIBCD.lib(stdexcpt.obj) 中定义
testJRTP error LNK2005: _sprintf 已经在 LIBCD.lib(sprintf.obj) 中定义
testJRTP error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) 已经在 LIBCD.lib(typinfo.obj) 中定义
testJRTP error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) 已经在 LIBCD.lib(typinfo.obj) 中定义
testJRTP warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;使用 /NODEFAULTLIB:library
testJRTP error LNK2001: 无法解析的外部符号 "public: __thiscall JMutex::~JMutex(void)" (??1JMutex@@QAE@XZ)
testJRTP error LNK2001: 无法解析的外部符号 "public: __thiscall JMutex::~JMutex(void)" (??1JMutex@@QAE@XZ)
testJRTP error LNK2001: 无法解析的外部符号 "public: __thiscall JMutex::~JMutex(void)" (??1JMutex@@QAE@XZ)
testJRTP error LNK2019: 无法解析的外部符号 "public: __thiscall JMutex::JMutex(void)" (??0JMutex@@QAE@XZ) ,该符号在函数 "public: __thiscall RTPSession::RTPSession(enum RTPTransmitter::TransmissionProtocol)" (??0RTPSession@@QAE@W4TransmissionProtocol@RTPTransmitter@@@Z) 中被引用
testJRTP error LNK2001: 无法解析的外部符号 "public: __thiscall JMutex::JMutex(void)" (??0JMutex@@QAE@XZ)
testJRTP error LNK2001: 无法解析的外部符号 "public: __thiscall JMutex::JMutex(void)" (??0JMutex@@QAE@XZ)
testJRTP error LNK2019: 无法解析的外部符号 "public: int __thiscall JMutex::Init(void)" (?Init@JMutex@@QAEHXZ) ,该符号在函数 "public: int __thiscall RTPSession::Create(class RTPSessionParams const &,class RTPTransmissionParams const *)" (?Create@RTPSession@@QAEHABVRTPSessionParams@@PBVRTPTransmissionParams@@@Z) 中被引用
testJRTP error LNK2001: 无法解析的外部符号 "public: int __thiscall JMutex::Init(void)" (?Init@JMutex@@QAEHXZ)
testJRTP error LNK2001: 无法解析的外部符号 "public: int __thiscall JMutex::Init(void)" (?Init@JMutex@@QAEHXZ)
testJRTP error LNK2019: 无法解析的外部符号 "public: int __thiscall JMutex::Unlock(void)" (?Unlock@JMutex@@QAEHXZ) ,该符号在函数 "public: unsigned long __thiscall RTPSession::GetLocalSSRC(void)" (?GetLocalSSRC@RTPSession@@QAEKXZ) 中被引用
testJRTP error LNK2001: 无法解析的外部符号 "public: int __thiscall JMutex::Unlock(void)" (?Unlock@JMutex@@QAEHXZ)
testJRTP error LNK2019: 无法解析的外部符号 "public: int __thiscall JMutex::Unlock(void)" (?Unlock@JMutex@@QAEHXZ) ,该符号在函数 "public: virtual int __thiscall RTPUDPv4Transmitter::Create(unsigned int,class RTPTransmissionParams const *)" (?Create@RTPUDPv4Transmitter@@UAEHIPBVRTPTransmissionParams@@@Z) 中被引用
testJRTP error LNK2019: 无法解析的外部符号 "public: int __thiscall JMutex::Lock(void)" (?Lock@JMutex@@QAEHXZ) ,该符号在函数 "public: unsigned long __thiscall RTPSession::GetLocalSSRC(void)" (?GetLocalSSRC@RTPSession@@QAEKXZ) 中被引用
testJRTP error LNK2001: 无法解析的外部符号 "public: int __thiscall JMutex::Lock(void)" (?Lock@JMutex@@QAEHXZ)
testJRTP error LNK2001: 无法解析的外部符号 "public: int __thiscall JMutex::Lock(void)" (?Lock@JMutex@@QAEHXZ)
testJRTP error LNK2001: 无法解析的外部符号 "public: virtual __thiscall JThread::~JThread(void)" (??1JThread@@UAE@XZ)
testJRTP error LNK2019: 无法解析的外部符号 "public: __thiscall JThread::JThread(void)" (??0JThread@@QAE@XZ) ,该符号在函数 "public: __thiscall RTPPollThread::RTPPollThread(class RTPSession &,class RTCPScheduler &)" (??0RTPPollThread@@QAE@AAVRTPSession@@AAVRTCPScheduler@@@Z) 中被引用
testJRTP error LNK2019: 无法解析的外部符号 "public: int __thiscall JThread::Start(void)" (?Start@JThread@@QAEHXZ) ,该符号在函数 "public: int __thiscall RTPPollThread::Start(class RTPTransmitter *)" (?Start@RTPPollThread@@QAEHPAVRTPTransmitter@@@Z) 中被引用
testJRTP error LNK2019: 无法解析的外部符号 "public: bool __thiscall JThread::IsRunning(void)" (?IsRunning@JThread@@QAE_NXZ) ,该符号在函数 "public: int __thiscall RTPPollThread::Start(class RTPTransmitter *)" (?Start@RTPPollThread@@QAEHPAVRTPTransmitter@@@Z) 中被引用
testJRTP error LNK2019: 无法解析的外部符号 "public: int __thiscall JThread::Kill(void)" (?Kill@JThread@@QAEHXZ) ,该符号在函数 "public: void __thiscall RTPPollThread::Stop(void)" (?Stop@RTPPollThread@@QAEXXZ) 中被引用
testJRTP error LNK2019: 无法解析的外部符号 "protected: void __thiscall JThread::ThreadStarted(void)" (?ThreadStarted@JThread@@IAEXXZ) ,该符号在函数 "private: virtual void * __thiscall RTPPollThread::Thread(void)" (?Thread@RTPPollThread@@EAEPAXXZ) 中被引用
testJRTP fatal error LNK1120: 11 个无法解析的外部命令
Top
2 楼oyljerry(【勇敢的心】→ ㊣提拉米苏√㊣)回复于 2004-12-02 12:05:46 得分 25
库冲突,/NODEFAULTLIB:library
还有一些函数没有定义,缺少相关的lib文件
Top
3 楼Crazy_ing(亚变态)回复于 2004-12-02 15:11:50 得分 0
库已经加上了.Top
4 楼Crazy_ing(亚变态)回复于 2004-12-06 16:43:52 得分 0
我顶.....Top
5 楼cdskycom()回复于 2004-12-08 18:53:43 得分 25
再帮你顶,我也是这个问题,到现在都不知道怎么办Top
6 楼arrowrain(向上飞扬)回复于 2005-03-02 13:54:16 得分 0
我也有这个问题
1。还有在编jrtplib-3.1.0的时候,只包含了jthread-1.1.1的include目录,没有加入lib目录(lib目录下没有jthread.lib,在debug目录下)也就是根本没有用jthread-1.1.1的jthread.lib只用了它的头文件,jrtplib-3.1.0也能编过,只是有一堆warnings.不解???????????
2。这个warning要不要管
d:\RTP3.0lib\jrtplib-3.1.0\src\rtpsession.cpp(73) : warning C4355: “this” : 用于基成员初始值设定项列表
3。还有一个问题(用jrtplib-2.x.x时)
#include<windows.h>
#include"rtpsession.h"
class A
{
RTPSession session;
HANDLE m_hReadEvent;
.....等等(要用到windows.h)
}
所有用到的winsock2的函数全部重复定义
可能因为 rtpsession.h 包含的其他头文件有 winsock2.h
windows.h中也有 我winsock2.h
就这一点我认为jrtplib头文件包含关系复杂,所有头文件都暴露出来
而这些头文件又包含标准库的头文件,引起标准库中的函数重复定义
如果用win32 console
只是#include"rtpsession.h"
加在main()前,不用自己的类,就没问题
或#include"rtpsession.h"加到.cpp中
还要在#include"a.h"前才没问题
很ft!!!这样RTPSession session就不能作为class A 的成员变量Top
7 楼arrowrain(向上飞扬)回复于 2005-03-02 16:57:03 得分 0
vs2003 通过
1.要加入..\jrtplib-3.1.0\Debug\jrtplib.lib Ws2_32.lib ..\jthread-1.1.1\Debug\jthread.lib
2.要加入jrtplib-3.1.0 和 jthread-1.1.1 头文件
3.jrtplib-3.1.0 多线程调试 DLL (/MDd)
你的工程也要用 多线程调试 DLL (/MDd)
4.要创建有stdafx.h的工程(很郁闷 why???????????)预编译头指令????
5.不能忽略所有默认的库
(这一点一般没什么问题,但是像我要写directshow filter 的人就惨了)
结果:
正在删除项目“MyTest”(配置“Debug|Win32”)的中间文件和输出文件。
正在编译...
stdafx.cpp
正在编译...
MyTest.cpp
d:\MyTest\jrtplib-3.1.0\src\rtpsessionparams.h(49) : warning C4267: “=” : 从“size_t”转换到“int”,可能丢失数据
正在链接...
LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;使用 /NODEFAULTLIB:library
LINK : warning LNK4098: 默认库“LIBCD”与其他库的使用冲突;使用 /NODEFAULTLIB:library
生成日志保存在“file://d:\MyTest\MyTest\Debug\BuildLog.htm”中
MyTest - 0 错误,3 警告
在vc6.0 sp6 中 好像还要
VC产生的workspace的debug setting,默认有个GZ选项,Catch Release-Build Errors in Debug Build,编译的时候会说error LNK2001: unresolved external symbol __chkesp,去掉就好了。
这个是别人搞得,好像也可以不知道为什么Top




