简体   繁体   English

包含其他目录中的C ++无效

[英]C++ including from the other directory doesn't work

Yes, I know there's like 100000000 questions like this on this site. 是的,我知道这个网站上有大约1亿个这样的问题。 I spent 2 hours lurking SO to find out what am I doing wrong. 我花了2个小时潜伏着SO,以找出我做错了什么。 This is my projects directory tree: 这是我的项目目录树:

在此处输入图片说明

main.cpp starts with this: main.cpp从以下开始:

#include <iostream>
#include "XD.hpp"

( lib/XD.hpp or <XD> doesn't work as well) lib/XD.hpp<XD>不能正常工作)

I tried many other combination, I even did -I/home/frynio/Desktop/projects/sdizo1/lib , but it still doesn't work. 我尝试了许多其他组合,甚至使用了-I/home/frynio/Desktop/projects/sdizo1/lib ,但仍然无法使用。 Do you guys see what am I doing wrong here? 你们看到我在做什么错吗?

I know this will be massively downvoted, but I'd rather spend time working on my project rather than trying to figure out this thing. 我知道这将被否决,但是我宁愿花时间在我的项目上,而不是试图弄清楚这件事。

它应该看起来像这样

#include "../lib/XD.hpp"

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM