我下了jrtplib-3.7.0, 并用它自带的例子试验,
头文件的问题已经解决, 也放入了jmutex.h,
但还是报了如下的错误:
example1.obj : error LNK2001: unresolved external symbol "public: __thiscall RTPSessionParams::RTPSessionParams(void) " (??0RTPSessionParams@@QAE@XZ)
example1.obj : error LNK2001: unresolved external symbol __imp__ntohl@4
example1.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall RTPSession::~RTPSession(void) " (??1RTPSession@@UAE@XZ)
example1.obj : error LNK2001: unresolved external symbol __imp__inet_addr@4
example1.obj : error LNK2001: unresolved external symbol "public: __thiscall RTPSession::RTPSession(class RTPMemoryManager *) " (??0RTPSession@@QAE@PAVRTPMemoryManager@@@Z)
example1.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8
example1.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall RTPIPv4Address::IsFromSameHost(class RTPAddress const *)const " (?IsFromSameHost@RTPIPv4Address@@UBE_NPBVRTPAddress@@@Z)
example1.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall RTPIPv4Address::IsSameAddress(class RTPAddress const *)const " (?IsSameAddress@RTPIPv4Address@@UBE_NPBVRTPAddress@@@Z)
example1.obj : error LNK2001: unresolved external symbol "public: virtual class RTPAddress * __thiscall RTPIPv4Address::CreateCopy(class RTPMemoryManager *)const " (?CreateCopy@RTPIPv4Address@@UBEPAVRTPAddress@@PAVRTPMemoryManager@@@Z)
Debug/example1.exe : fatal error LNK1120: 21 unresolved externals
Error executing link.exe.
按理说不应该啊, 还请高人帮忙!!!!!!!!!!!!!
------解决方案--------------------------------------------------------
#include <winsock2.h>
#pragma comment (lib, "ws2_32.lib ")
------解决方案--------------------------------------------------------
/MDd
#pragma comment (lib, "ws2_32.lib ")
------解决方案--------------------------------------------------------
1、下载jrtplib 3.5.2,要注意有时下载后,其中有些头文件是空的,如果这样的话,可以用相近版本的头文件来代替,或者到其它地方重新下载
2、编译jthread工程,并生成jthread.lib库文件
3、将jmutex.h和jthread.h和生成的jthread.lib复制到jrtplib工程中,并导入库文件
4、将jrtplib工程中所有的#include <jmutex.h> 改成#include "jmutex.h "
#include <jthread.h> 改成#include "jthread.h "
5、jrtplib工程编译设置:(category选项设置为 Code generation)将user run-time library设置为MultiThreaded DLL
6、生成jrtplib.lib
example1的编译
1、新建一个控制台应用程序,将example1.cpp文件导入,并将example1.cpp中用的的jrtplib工程中所有的头文件也导入。
2、将生成的jrtplib.lib和jthread.lib复制到工程所在目录并导入。
3、导入ws2_32.lib
4、编译设置如上一篇所述,也就是设置为多线程DLL。
5、编译运行程序