Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Header Search Path and Library Search Path?

This question is with context to iPhone -

What is the difference between Header Search Paths and Library Search Paths ?

like image 262
Vaibhav Tekam Avatar asked Jul 12 '12 11:07

Vaibhav Tekam


People also ask

How do I add a header search path?

Double-click on the Header Search Path and click on the + to add the path to the include header files. Add the path to sdk/include in the approriate Bifrost SDK version, and set the path to recursive. Add the path to the library files in a similar way.

Where does Ld look for libraries?

The -L dir option adds the dir directory path to the library search list. The linker searches for libraries first in any directories specified by the -L options and then in the standard directories. This option is useful only if it is placed preceding the –l library options to which it applies.

Where does gcc look for header files?

GCC looks for headers requested with #include " file " first in the directory containing the current file, then in the directories as specified by -iquote options, then in the same places it would have looked for a header requested with angle brackets. For example, if /usr/include/sys/stat.


2 Answers

HEADER_SEARCH_PATHS vs LIBRARY_SEARCH_PATHS

  • Header Search Paths(HEADER_SEARCH_PATHS) - It is pre-compile time check that can throws Module not found. There are locations of the public headers(.h), simply tell Xcode where they are.

  • Library Search Path(LIBRARY_SEARCH_PATHS) - It is compile time check that can throws Library not found for. There are locations of the libraries(executables), simply tell Xcode where they are to use it for linking. Sensitive to whitespace

like image 191
yoAlex5 Avatar answered Sep 27 '22 22:09

yoAlex5


Header search path is where the compiler will look for header files (i.e. the ".h" files you include from your class implementations.

Library search path is where the linker will look for compiled object files (or archive files containing those compiled object files) that are referenced from within the code being compiled and linked.

like image 24
Tim Dean Avatar answered Sep 28 '22 00:09

Tim Dean