Note that there are some explanatory texts on larger screens.

plurals
  1. POLinker error with Boost Threads in C++ in Xcode
    primarykey
    data
    text
    <p>I have been trying to get a simple c++ program running that was given to me as an example of multi-thread programming. I know it runs on another machine with boost installed, but I am trying to run it in Xcode, and this is giving me some problems. </p> <p>First I tried to run it with my existing version of boost. However I was getting many errors and after doing some research, found that I needed to update my boost version from 1.47 to 1.52 to fix a few known threading bugs contained in 1.47. </p> <p>That fixed many of my errors, but was still throwing a few. SO I found out that I had to patch 1.52 using the patch found here: <a href="https://svn.boost.org/trac/boost/attachment/ticket/7671/libcpp_c11_numeric_limits.patch" rel="nofollow noreferrer">https://svn.boost.org/trac/boost/attachment/ticket/7671/libcpp_c11_numeric_limits.patch</a></p> <p>After all that, I am still getting a linker error saying "Library not found for -lboost_thread"</p> <p>Right now in Xcode, I have the following project settings: Under search paths, I have the header and library search paths set to "usr/local/include/" - - Under linking I have other linker flags set to "-lboost_thread"</p> <p>I have both a lboost_thread.a and a lboost_thread.dylib located in usr/local/lib/. How do I make xCode find this, as It seems that should fix my problem.</p> <p>Also if it helps here is the code I am running:</p> <pre><code>#include &lt;iostream&gt; #include &lt;boost/thread.hpp&gt; using namespace std; void printNum(char c, int num) { for(int i = 0; i &lt; num; i++) { cout &lt;&lt; c &lt;&lt; i &lt;&lt; endl; } } int main() { cout &lt;&lt; "Boost threads!" &lt;&lt; endl; boost::thread t(printNum, 'b', 100); printNum('a', 100); cout &lt;&lt; "Good bye!" &lt;&lt; endl; } </code></pre> <p>Image of Error: <img src="https://i.stack.imgur.com/ZbOdV.png" alt="Error"></p> <p>Image showing the file in it's location: <img src="https://i.stack.imgur.com/hCcc5.png" alt="libboost_thread.a"></p> <p>Image showing my build settings: <img src="https://i.stack.imgur.com/debJp.png" alt="xCode build settings"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload