0

我在使用 JRTPLIB c++ win32 版本时遇到了一些问题,在 Visual Studio2010 中编译。(http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jrtplib)。我已经给作者发了邮件,但还没有收到回复。我遇到的问题是这样的:

error C1083: Cannot open include file: 'rtpconfig_unix.h': No such file or directory    c:\users\johan-bar\desktop\developer tools\3rd party software\jrtplib-3.8.1\src\rtpconfig.h  

我拥有的两个 .h 文件是:

主.h:

enter code here
#include <WinSock2.h>
#include <Windows.h>
#include <WindowsX.h>
#include <stdlib.h>
#include <string>
#include <Richedit.h>
#include "jrtlibtest.h"
#include "resource.h"

jrtlibtest.h:

#include "rtpsession.h"  

所以我认为我需要在 jrtlibtest.h 中 #include windows.h 才能识别要定义的 WIN32(因此它不包括 unix .h 文件),但这反过来又给了我大约 100 个重新定义错误。

我不确定如何解决这个问题,我在图书馆主页本身或互联网上都找不到任何信息。有没有其他人遇到过这个问题?

干杯

4

3 回答 3

2

我还没有看到 JRTPLIB c++ lib,但是根据您提供的信息('rtpconfig_unix.h' 无法打开),它似乎正在为 unix 端口使用默认文件?在 JRTPLIB 文件夹中查找类似配置文件的内容并运行它(cygwin 上的 ./config 等)。这应该生成您可以在代码中#include 的 Windows 配置文件。

祝你好运!!

编辑:

您收到错误的事实:

error C1083: Cannot open include file: 'rtpconfig_unix.h': 

表示:在您的 rtpconfig.h 中,未启用 WIN32 宏:

#ifndef RTPCONFIG_H

#define RTPCONFIG_H

#if (defined(WIN32) || defined(_WIN32_WCE))
#include "rtpconfig_win.h"
#else
#include "rtpconfig_unix.h"
#endif // WIN32

//#define RTPDEBUG

#endif // RTPCONFIG_H

这就是为什么它说它无法打开 rtpconfig_unix.h 文件。

您是否直接在 rtpconfig.h 中尝试了#defining win32 宏?(或在您的项目设置中进行)。

于 2011-01-09T13:43:33.630 回答
1

在您的项目中包含 ws2_32.lib。有同样的问题。

(如果您已经包含它,则删除 wsock32.lib 和 winsock.h 头文件以避免冲突)

于 2011-06-20T10:59:26.743 回答
0

什么是重定义错误?

如果它们来自 winsock,则从包含中删除 winsock2.h 可能会有所帮助。

于 2011-01-09T19:40:54.907 回答