简体   繁体   中英

Recognizing Installed C++ library in XCode

I've downloaded and installed google-sparse_has_map with

./configure 
make
make install

As instructed, without a problem, but when I included it in XCode, like this:

#include <google/sparse_hash_map>

I receive the following error:

Google/sparse_hash_map: No such file or directory.

It is installed in /usr/local/include/

how do I show this directory to XCode?

Take a look at my graphic below:

设置

You need to tell Xcode where the library and the include files are. Add paths to the "Header Search Paths" and "Library Search Paths" of your project settings.

You need to tell your project where to find the include folder

"/I /usr/local/include/" or "-I /usr/local/include/"

Of course it depends on where the folder is relative to the project directory.

From http://forums.macrumors.com/showthread.php?t=227636 the XCode compiler options can be found by doing the following:

 Select the name of your project from the Groups and Files list. Click the Get Info button in the project window toolbar. An information panel for the project will open. Click the Build tab in the information panel. Choose GNU C/C++ Compiler from the Collection pop-up menu. 

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