简体   繁体   English

Visual Studio 2019 x64 上的 FLTK,“无法打开包含文件:'dirent.h':没有这样的文件或目录

[英]FLTK on Visual Studio 2019 x64, "Cannot open include file: 'dirent.h': No such file or directory

I am using the FLTK library in Visual Studio Community 2019 and building my application for x86 works fine.我在 Visual Studio Community 2019 中使用 FLTK 库并为 x86 构建我的应用程序工作正常。 Now, I would like to build it for x64.现在,我想为 x64 构建它。 However, I am getting the error "Cannot open include file: 'dirent.h': No such file or directory.".但是,我收到错误“无法打开包含文件:'dirent.h':没有这样的文件或目录。”。

The error occurs in the file, named 'filename.H'.错误发生在名为“filename.H”的文件中。 This header file comes with the FLTK library.这个 header 文件随 FLTK 库一起提供。

Has anyone an idea how I could fix this problem?有谁知道我该如何解决这个问题?

Update:更新:

The dirent.h library is not recognized, because its an C POSIX library, as described in the link here below.无法识别 dirent.h 库,因为它是一个 C POSIX 库,如下面的链接中所述。 However, the question still remains, namely, how can I fix this problem?但是,问题仍然存在,即我该如何解决这个问题?

<dirent.h> in visual studio 2010 or 2008 <dirent.h> 在 Visual Studio 2010 或 2008 中

The link above refers to a link with an alternative dirent.h file.上面的链接是指带有替代 dirent.h 文件的链接。 I've tried to include this file in my project, however, now another errors occur.我试图将此文件包含在我的项目中,但是,现在又发生了另一个错误。 These errors occur in the file Fl_Native_File_Chooser.H.这些错误发生在文件 Fl_Native_File_Chooser.H 中。 The type specifiers fl_OPENFILENAMEW and fl_BROWSEINFOW are unknown in this file.此文件中的类型说明符 fl_OPENFILENAMEW 和 fl_BROWSEINFOW 未知。

On Windows, dirent.h should not be included in the FLTK code.在 Windows 上,dirent.h 不应包含在 FLTK 代码中。 Even though it is 64 bit, WIN32 must be defined when using the FLTK libraries ( https://www.fltk.org/doc-1.3/preface.html ).即使是 64 位,使用 FLTK 库时也必须定义 WIN32( https://www.fltk.org/doc-1.3/preface.html )。 Your problem will probably be solved if you define WIN32 at the beginning of your code or if you add WIN32 in your Visual Studio project properties - C/C++ - Preprocessor - Preprocessor Definitions, in x64 platform.如果您在代码开头定义 WIN32 或在 x64 平台中的 Visual Studio 项目属性 - C/C++ - 预处理器 - 预处理器定义中添加 WIN32,您的问题可能会得到解决。

The way I would create an x64 solution is我创建 x64 解决方案的方式是

  1. Open ide\VisualC2010\fltk.sln打开ide\VisualC2010\fltk.sln
  2. If you are using another version of Visual Studio, let it convert.如果您使用的是其他版本的 Visual Studio,请让它转换。
  3. Change the solution configuration to Debug (somehow Visual Studio always defaults to Debug Cairo)将解决方案配置更改为 Debug(不知何故,Visual Studio 始终默认为 Debug Cairo)
  4. Click on solution platforms and select Configuration Manager点击解决方案平台和 select配置管理器
  5. When the Configuration Manager appears, under Active solution platforms select New当配置管理器出现时,在活动解决方案平台下 select
  6. When the next dialog appears, under type or select new platforms select x64当出现下一个对话框时,在输入或 select 新平台select x64
  7. Click on the OKs etc to close the windows单击确定等关闭 windows
  8. Now change the solution platform to x64 and start the build.现在将解决方案平台更改为 x64 并开始构建。

You shouldn't get any dirent.h errors.你不应该得到任何 dirent.h 错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不能在Visual Studio 2005中#include <dirent.h> - Cannot #include<dirent.h> in Visual Studio 2005 Visual Studio 2010或2008中的<dirent.h> - <dirent.h> in visual studio 2010 or 2008 Microsoft Visual Studio Community 2019:致命错误 C1083:无法打开包含文件:'corecrt.h':没有这样的文件或目录 - Microsoft Visual Studio Community 2019: fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory Visual Studio 2013迁移:无法打开包含文件:&#39;dxerr8.h&#39;:没有此类文件或目录 - Visual studio 2013 Migration : Cannot open include file: 'dxerr8.h': No such file or directory 无法在Visual Studio 2010中打开包含文件&#39;stdlib.h&#39; - Cannot open include file 'stdlib.h' in Visual Studio 2010 Visual Studio无法打开包含文件;不能打开包含文件。 没有相应的文件和目录 - Visual Studio Cannot open include file; No such file or directory 无法打开包含文件:&#39;io.h&#39;:没有这样的文件或目录,Python 3.7.5,Windows 8.1,VS v 2019 - Cannot open include file: 'io.h': No such file or directory, Python 3.7.5, Windows 8.1, VS v 2019 Visual Studio 2013:致命错误C1083:无法打开包含文件:&#39;winsock2.h&#39;:没有此类文件或目录 - Visual Studio 2013: fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory Visual Studio 2017:无法打开包含文件&#39;d3dx9.h&#39;.exe应用程序使用的静态库中没有此类文件或目录 - Visual studio 2017: Cannot open include file 'd3dx9.h' no such file or directory in a static library used by .exe application 使用 mongocxx 驱动程序的 Visual Studio 2019 x64 应用程序 - Visual Studio 2019 x64 app using mongocxx driver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM