How can Codeblocks find my header files even without adding any search paths

℡╲_俬逩灬. 提交于 2019-12-10 22:34:30

问题


I'm learning to use OpenCV (and C++) in Codeblocks. What confuses me, however, is that when I start to include header files from OpenCV in my main.cpp file, Codeblocks automatically suggests to me the files as shown in the image below.

I have not included any search paths to project build options, so how is this possible that Codeblocks can find the files? Is there some other variable working here that I'm unaware of?

Note that I'm a beginner with both Codeblocks and OpenCV and that I only have a little experience with C++.

Thank you


回答1:


Of course when you install an IDE like code::blocks by default, it knows about standard path for library on your OS.

On my OS -> Ubuntu that is /usr/include

It only searches on a standard path, except you add one. If you install your library by command-line, it goes to the standard place, if you installed manually, then it depends on your option you added to installation. I can not see you screen-shot but it has access to /usr/include by default.

For more detail on Linux and OpenCV

And here is a screen-shot of codeblock on Ubuntu that I added some 3rd-party library


NOTE:
if you install any libraries by command-line, just use it.
But if you have installed them manually, you need to add 2 things to codeblock.
1. First is your path for header file
2. Second is your path for linker

And you see it in screen-shot that say: Search Directory

First is for header and second is for linker



来源:https://stackoverflow.com/questions/44798890/how-can-codeblocks-find-my-header-files-even-without-adding-any-search-paths

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!