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

查看:11
本文介绍了包括从 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天全站免登陆