包括从Windows到Linux的标题路径更改 [英] Include header path change from Windows to Linux

查看:116
本文介绍了包括从Windows到Linux的标题路径更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将使用C ++编写的应用程序从Windows移植到Linux。我有一个问题的头文件路径。 Windows使用 \ ,Linux使用 / 。我发现在每个源和头文件中更改这是麻烦的。是否有一些工作?

I'm porting an application written in C++ from Windows to Linux. I have a problem with the header files path. Windows uses \ and Linux uses /. I am finding it cumbersome to change this in each and every source and header file. Is there some work around?

推荐答案

在#include路径中始终使用正斜杠。编译器的工作是将路径映射到底层操作系统支持的任何斜杠/目录方案。

Always use forward slashes in #include paths. It is the compiler's job to map the path to whatever slash/directory scheme the underlying OS supports.

这篇关于包括从Windows到Linux的标题路径更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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