JRTPLIB/标头包含问题
我在 Visual Studio2010 中编译 JRTPLIB c++ win32 版本时遇到一些问题。(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 文件是:
MAIN.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 个重新定义错误。
我不确定如何解决这个问题,并且在图书馆主页本身或互联网上找不到任何信息。还有其他人遇到过这个问题吗?
干杯
I'm having some problems with JRTPLIB c++ win32 version, compiling in visual studio2010.(http://research.edm.uhasselt.be/~jori/page/index.php?n=CS.Jrtplib). I've emailed the author but have yet to received a reply. The problem I am experiencing is this:
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
The two .h files I have are these:
MAIN.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"
So I reason that I need to #include windows.h in jrtlibtest.h for it to recognise WIN32 to be defined (so it does not include unix .h files) but that in turn gives me about 100 redifinition errors.
I am unsure how to solve this problem and I can't find any information on the library homepage itself or on the internet. Has anyone else encountered this problem?
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我还没有看到 JRTPLIB c++ lib,但根据您提供的信息(“rtpconfig_unix.h”无法打开),它似乎正在采用unix端口的默认文件?在 JRTPLIB 文件夹中查找类似配置文件的内容并运行它(在 cygwin 上为 ./config 或其他)。这应该会生成 Windows 配置文件,您可以将其 #include 到您的代码中。
祝你好运!!
编辑:
您收到错误的事实:
意味着:在您的 rtpconfig.h 中,未启用 WIN32 宏:
这就是为什么它说无法打开 rtpconfig_unix.h 文件。
您是否尝试直接在 rtpconfig.h 中#defining win32 宏? (或者在您的项目设置中执行此操作)。
I have not seen JRTPLIB c++ lib, but based on information that you provided ('rtpconfig_unix.h'can not be opened), it seems that it is taking default file for unix port? Look for something like a config file in the JRTPLIB folder and run it (./config on cygwin or something). That should generate the windows config files that you would be able to #include in your code.
Good luck!!
EDIT:
The fact that you are getting the error:
means: in your rtpconfig.h, the WIN32 macro is not enabled:
And thatś why it says it cant open rtpconfig_unix.h file.
Did you try #defining win32 macro in rtpconfig.h directly? (or do it in your project settings).
在您的项目中包含 ws2_32.lib。有同样的问题。
(如果您已经包含了 wsock32.lib 和 Winsock.h 头文件,请删除它以避免冲突)
Include ws2_32.lib in your project. Had the same problem.
(And remove if you already include it, wsock32.lib and winsock.h header file to avoid colissions)
重新定义错误是什么?
如果它们来自winsock,从包含中删除winsock2.h 可能会有所帮助。
What are the redefinition errors?
If they are from winsock, removing winsock2.h from your includes might help.