Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Boost headers with Jetbrains Appcode

Tags:

c++

boost

appcode

I have the Boost libraries installed on my Macbook via MacPorts and was wondering how to configure AppCode to recognize the headers. I tried right clicking on the project -> Add Frameworks and Libraries -> Other... -> browse to /opt/local/include -> Choose but this doesn't seem to add Boost to the list.

Has anyone successfully gotten Boost to work with AppCode?

like image 808
thed0ctor Avatar asked Dec 26 '22 23:12

thed0ctor


1 Answers

In case anyone else stumbles upon this via google:

There are three steps involved:

  1. Right click on the project and choose Add Frameworks and Libraries, followed by Other, and browse for all of the dylibs. Since I installed boost via brew, the dylibs were located under /usr/local/Cellar/boost/1.53.0/lib/. Make sure that you select all of them, so that under the new Frameworks folder in your navigation window, a list of all of the boost libraries appear.

    boost libs included

  2. Right click on the project and choose Project Settings. Scroll to Search Paths and add the path to your boost include directory under Header Search Paths. For me it was located under /usr/local/Cellar/boost/1.53.0/include. Make sure that Recursive is unchecked, or you will get compile errors if you are using std!!!

  3. Proceed to add the boost lib dir (that you browsed to in step 1) under Library Search Paths. After steps 2 & 3, your search paths may look something like:

    search paths

Thats it! You are now ready to use boost headers like so:

#include <boost/lexical_cast.hpp>

Just make sure to build in 64-bit mode, since that's what the boost libraries are compiled as (might be different for the macports build).

like image 171
WhatAWorld Avatar answered Dec 29 '22 02:12

WhatAWorld