简体   繁体   中英

gcc local include path

I have a directory structure (for a clang++/g++ project) that looks like this:

src/
util/

In src/ we find .cc and .h files. Here we build a library (mylib.a) and our main binaries.

In util/ we have some .cc files that build utilities that, for various reasons, ought not to be in src/ .

But this means that files in util/ have include lines that look like

#include "../src/myheader.h"

instead of

#include "myheader.h"

This despite my trying commandline options (to g++) like -iquote ../src .

Any suggestions what commandline options to make the second, more simple, include lines work?

假设您从顶级项目目录运行g ++,请尝试以下操作:

g++ -I./src <... rest of command ...>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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