Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
854 views
in Technique[技术] by (71.8m points)

c++ - include<apis/api1/api.h> throws No such file or directory

#include<apis/api1/api.h> 

throws No such file or directory i even tried moving api.h and api.cc to the main project directory and using

#include<api.h> 

does the same thing even though it is in the exact same directory that the other classes use i tried adding /apis/api1 to the compiler search path that just crashes the compiler can someone tell me what to type into the compilers compilation line

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
#include <api.h>

is the way you include a system header. (That is, the header for a library installed on your system.) It does not search in the directory of the source file or in directories specified in -I command line arguments.

#include "api.h"

is the way you include your own headers. (But it will also search library header locations if it doesn't find the header locally.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...