jrtplib 和 jthread 帮助
当尝试在我的简单项目上使用 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
放在哪里?请帮忙...
I have some link error problems when trying to compile using jrtplib and jthread on my simple project. The errors are:
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
and here is my main program:
// 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;
}
For your information, I do not import any header file from those libraries into my project. I use additional include libraries in the project setting and put `"..\jlib\jthread-1.2.1\src";"..\jlib\jrtplib3.8.2\src"
(this is the folder where all the headers are stored). How do I fix this? Where should i put jrtplib.lib
and jthread.lib
? Please help...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否在项目链接器选项下添加了 jrtplib.lib 和 jthread.lib ?
您可以在项目属性页的
“配置属性 -> 链接器 -> 输入 -> 其他依赖项”下执行此操作,并确保包含 lib 文件的目录已添加到您的库路径中:在项目上属性
“链接器->常规->附加库目录”
或全局VS设置下(不适用于VC2010)
“工具->选项”“项目和解决方案->VC++目录->库文件”
在 VC2010 下,您必须编辑项目的属性表。
Have you added jrtplib.lib and jthread.lib under your project linker options?
You can do this on the project property page under
"Configuration properties->Linker->Input->Additional Dependencies" and make sure that the directory that contains the lib files has been added to your library path: Either on the project properties
"Linker->General->Additional Library Directories"
or under the global VS settings (Doesn't apply to VC2010)
"Tools->Options" "Projects and Solutions->VC++ Directories->Library Files"
Under VC2010 you'll have to edit the property sheet of the project.
我发现回答有点晚了,而且我对 Windows 不太熟悉(我更像是 Linux 用户),但前几天我在 Windows 上尝试过 JRTPLIB,在编译示例时遇到了同样的问题在发布模式下,库在调试模式下(我看到你使用调试模式)。希望它能有所帮助。
I see that it's a bit late to answer and I'm not so expert on Windows (I'm more a Linux user), but some day ago I've tried JRTPLIB on Windows and I had the same problem when I compiled the example in release mode and the lib in debug mode (I see that you use the debug mode). Hope it can help.