POSIX标题(来自MinGW项目)在Visual Studio 2013中 [英] POSIX Headers (from MinGW project) in Visual Studio 2013
问题描述
(继续:从代码移植: :Block to Visual Studio 2010 - 如果它违反StackExchange的格式规则,我会将其删除)
(Continues from: Porting from Code::Blocks to Visual Studio 2010 - I'll remove this if it's against StackExchange's formatting rules)
来源 项目,其最初使用 MinGW 和 GCC TDM-1 4.7.2 (不支持较新版本) em> Visual Studio 2013 (注意:上述问题从2010年更改为2013年)。该代码使用1998 ISO C ++标准,并使用各种其他实用程序,例如 SDL2 ,OpenGL , Zlib , Lua
I'm trying to port an open source Code::Blocks project, which originally uses MinGW and GCC TDM-1 4.7.2 (does not support newer versions), to Visual Studio 2013 (NOTE: I switched from 2010 to 2013 for the question above). The code uses 1998 ISO C++ standard and uses various additional utilities like SDL2, OpenGL, Zlib, Lua, and others.
主要的问题是,该项目包含一些VS没有的库;
所以我想问,如果有人知道这些是Unix-only库,包括在我忽略的项目中的实用程序的库,或者我的VS安装是无论什么原因缺乏的库,主要是如果他们可以修复,替换为VS等同物或从某处下载,而没有大量移植/编辑代码本身。
The main problem is, the project includes some libraries which VS does not have; so I wanted to ask if anybody knows if these are Unix-only libraries, libraries from a utility included in the project which I overlooked or libraries my VS installation is for whatever reason lacking, and mainly if they can be fixed, replaced with VS equivalents or downloaded from somewhere without massively porting/editing the code itself first.
特别是,在当前构建尝试(我没有扫描所有的项目源文件以查找其他错误)缺少的库是:
In particular, at the current build attempt (I have not scanned through all of the project source files to look for other errors) the missing libraries are:
- unistd.h / li>
- cpuid.h
- sys / time.h
- unistd.h(*)
- cpuid.h
- sys/time.h
(*) EDIT :我看了一下, strong> unistd.h 可以替换为io.h或使用原始Unix库的自定义子集,因此我也将尝试这些选项。
(*)EDIT: I've looked a bit around and I found unistd.h can be possibly replaced with io.h or with a custom subset of the original Unix library, so I'll also try these options.
EDIT2 :显然,它们都是Unix(POSIX)库,根据我的理解,
EDIT2: Apparently, they're all Unix (POSIX) libraries which, from what I understand, are fundamentally incompatible with the MSVC compiler, even if forcefully included into the project.
我也试图将Visual Studio项目设置为使用MinGW作为一个自定义的编译器,但不仅是我不能得到它的正常工作,我已经阅读VS不能从 gcc 编译二进制文件的调试信息,这是两个主要原因之一想要移植到VS。
I've also tried to set the Visual Studio project to use MinGW as a custom compiler, but not only I can't get it to work properly, I've read that VS can not parse debug information from GCC-compiled binaries, which is one of the two major reasons I wanted to port to VS in the first place.
我也读过这个插件叫做 VisualGDB ;有人知道吗? VS是否可以编译和调试MinGW程序?
I've also read about this plugin called VisualGDB; does anybody know about it? Does it make possible for VS to compile and debug MinGW programs?
推荐答案
是的,我尝试了 扩展程序,它几乎解决了所有问题。 MSVC和MinGW讨厌彼此的嘲讽,我真的不能做很多。
Yeah, I tried the VisualGDB extension and it pretty much solves all the issues. MSVC and MinGW hate the crap out of each other and I really couldn't do much about it.
这篇关于POSIX标题(来自MinGW项目)在Visual Studio 2013中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!