c1083 sdl/sdl.h,但您知道文件名中不应使用斜杠 [英] c1083 sdl/sdl.h but as you know there shouldn't be slash in file name

查看:82
本文介绍了c1083 sdl/sdl.h,但您知道文件名中不应使用斜杠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我编译某些项目的途中,该项目来自sf.net,
Visual Studio 2008说无法打开包含文件:"SDL/SDL.h":没有这样的文件或目录
但您可能知道,文件名中不应包含字符"/".

我下载了VC8的SDL开发库,并解压缩并将包含文件复制到VC include文件夹,与lib文件相同
但还是没用.

解决方案

如果您有

#include "SDL/SDL.h"


源文件中的指令,则应将其替换为适当的指令(在Windows中,它可能是"SDL\SDL.h",因为"\"是路径中的分隔符).
:)


请注意, Visual C ++ 能够处理 POSIX文件名(当/出现时,它会自动将/替换为\#include指令中使用);我在系统上尝试过,在#include指令中可以同时使用\/作为路径分隔符.
我认为您遇到的问题是由于 Visual C ++ 无法找到文件夹 SDL 导致的.从工具菜单中选择选项,然后移至 VC ++目录,并将包含 SDL 的文件夹添加到包含路径.例如,如果要包含的文件是C:\My_Path\SDL\SDL.H,将路径C:\My_Path添加到包含路径,则指令#incude "SDL/SDL.H"应该可以正常工作.


on my way to compile some project, which is from sf.net,
Visual Studio 2008 says cannot open the include file: ''SDL/SDL.h'': no such file or directory
but as you may know, there shouldn''t be character ''/'' in file name.

I download SDL Development Libraries for VC8 and unzip and copy include files to VC include folder, same as lib files
but it still didnt work.
could somebody let me know what I have to do next?

解决方案

If you have a

#include "SDL/SDL.h"


directive in the source files then you should replace it with the appropriate one (on Windows it is probably "SDL\SDL.h", since ''\'' it is the separator in paths).
:)


Note that Visual C++ is able to deal with POSIX filenames (it automatically replace / with \ when used in #include directives); I tried on my system, and in #include directives you could use both \ and / as path separators.
I think the problem you are experiencing is due to the fact that Visual C++ is not able to locate the folder SDL; from the Tools menu select Options then move to VC++ Directories and add the folder that contains SDL to the Include path. For instance if the file you are including is C:\My_Path\SDL\SDL.H add the path C:\My_Path to the Include paths, then the directive #incude "SDL/SDL.H" should work properly.


这篇关于c1083 sdl/sdl.h,但您知道文件名中不应使用斜杠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆