当前位置: 动力学知识库 > 问答 > 编程问答 >

linux - C++ cross-platform include dash

问题描述:

i'm working on a little c++ cross platform project, using glfw and glew.

I wrote the original code on windows, where you include e.g. glfw like this

#include <GLFW\glfw3.h>

When i tried to ccompile on linux it went wrong because linux uses the "/" and not the

"\" like windows, so i had to replace them all.

Is there a simple solution to this simple problem?

Thanks in advance!

网友答案:

According to the accepted answer to a similar question, just always use forward slash (/) for include paths.

This question should also help.

网友答案:

Yes, use forward slashes no matter what OS you are developing on.

Backslashes are IMHO an abomination.

Also you might consider using something like CMake to build your code on both platforms.

分享给朋友:
您可能感兴趣的文章:
随机阅读: