简体   繁体   中英

Issues linking boost libraries with Xcode 6.1.1 on Yosemite mac

I'm using Yosemite and latest version of Xcode.

I've followed the instructions on the Boost website (for UNIX variants), I've tried brew install. I've tried a gist from github.

I've spent a huge amount of time trying to find information about the installation and the XCode set up, yet have not been able to get the libraries to link.

I've tried absolute paths, moving the boost folders around. <> and "" around my include statements. I have made sure command line tools are installed.

I ran the bootstrap.sh script, then invoked b2. Boost is saved in usr/local

I want to use sockets to pass data between to programmes on the same system, implementing something along these line: http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/example/cpp03/local/stream_server.cpp

Using the code as is, I'm getting errors that Xcode can't find the hpp files and I've tried replacing the <> with "", as per one of the error messages, the other being that it can't locate the files.

Below are screenshots showing what I have done to try and configure Xcode. Perhaps I have not linked in the correct places in Xcode, or perhaps I have linked to the wrong places?

与图书馆连结

库搜索路径

提升位置

I seem to have fixed it. After trying installs with homebrew, macports and manually (and then deleted all the files everywhere in usr/local between these installs), but it was hard to find everything that needed changing in the backend of Xcode, which I admit to still finding a little confusing at times.

So Header search paths still contained the homebrew cellar as part of the long pathname, so I changed this bit /usr/include User Header Path. User Search Paths I had as /usr/local/lib according to some instructions I'd found searching for a solution. I've now changed it to /usr/local/lib

After these changes, my errors have finally disappeared! Fingers crossed I've got it right now

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