在我的简单项目中尝试使用jrtplib和jthread进行编译时,我遇到了一些链接错误问题。错误是:
Error 4 fatal error LNK1120: 3 unresolved externals C:\Users\Chicko\Desktop\tryout\Debug\tryout.exe
Error 1 error LNK2019: unresolved external symbol "public: virtual __thiscall RTPSession::~RTPSession(void)" (??1RTPSession@@UAE@XZ) referenced in function _wmain tryout.obj
Error 2 error LNK2019: unresolved external symbol "public: __thiscall RTPSessionParams::RTPSessionParams(void)" (??0RTPSessionParams@@QAE@XZ) referenced in function _wmain tryout.obj
Error 3 error LNK2019: unresolved external symbol "public: __thiscall RTPSession::RTPSession(class RTPRandom *,class RTPMemoryManager *)" (??0RTPSession@@QAE@PAVRTPRandom@@PAVRTPMemoryManager@@@Z) referenced in function _wmain tryout.obj
这是我的主要计划:
// tryout.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <rtpsession.h> //Confused to put "" or <>
#include <rtpsessionparams.h>
#include <rtpudpv4transmitter.h>
int _tmain(int argc, _TCHAR* argv[])
{
RTPSession session;
RTPSessionParams sessionparams;
RTPUDPv4TransmissionParams transparams;
sessionparams.SetOwnTimestampUnit(1.0/8000.0);
transparams.SetPortbase(8000);
return 0;
}
为了您的信息,我不会将这些库中的任何头文件导入到我的项目中。我在项目设置中使用了其他包含库并放置`"..\jlib\jthread-1.2.1\src";"..\jlib\jrtplib3.8.2\src"
(这是存储所有标头的文件夹)。我该如何解决?我应该在哪里放jrtplib.lib
和jthread.lib
?请帮忙......
答案 0 :(得分:0)
您是否在项目链接器选项下添加了jrtplib.lib和jthread.lib?
您可以在
下的项目属性页面上执行此操作“配置属性 - &gt;链接器 - &gt;输入 - >附加依赖项”并确保包含lib文件的目录已添加到库路径中:在项目属性上
“链接器 - &gt;常规 - &gt;其他库目录”
或全局VS设置下(不适用于VC2010)
“工具 - &gt;选项”“项目和解决方案 - &gt; VC ++目录 - &gt;库文件”
在VC2010下,您必须编辑项目的属性表。
答案 1 :(得分:0)
我看到回答有点晚了,我在Windows上并不是那么专家(我更像是Linux用户),但是前一天我在Windows上尝试过JRTPLIB,当我遇到同样的问题时在发布模式下编译示例,在调试模式下编译lib(我看到您使用调试模式)。希望它可以提供帮助。