<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[c++ thread runtime error relocating (symbol not found)]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">I'm trying to use the thread library from the c++11 std library  (#include &lt;thread&gt;) . I am cross compiling on my linux machine which compiles fine with no errors  or warnings.  Once I transfer it to the Omega2+ (0.2.2 b200), I immediately get a runtime error.  Using the ldd command I get this from the cross compiled version:</p>
<pre><code>root@Omega-####:~/# ldd thread_test_01_CC_OO                                                                                                                                                                                                         
        /lib/ld-musl-mipsel-sf.so.1 (0x55a9e000)                                                                                                                                                                                                             
        libstdc++.so.6 =&gt; /usr/lib/libstdc++.so.6 (0x77598000)                                                                                                                                                                                               
        libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x77574000)                                                                                                                                                                                                     
        libc.so =&gt; /lib/ld-musl-mipsel-sf.so.1 (0x55a9e000)           
        Error relocating thread_test_01_CC_OO: _ZNSt6thread6_StateD2Ev: symbol not found                                                                                                                                                                             
        Error relocating thread_test_01_CC_OO: _ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE: symbol not found                                                                                                               
       Error relocating thread_test_01_CC_OO: _ZTINSt6thread6_StateE: symbol not found                                                                                                                                                                              
       Error relocating thread_test_01_CC_OO: _ZTINSt6thread6_StateE: symbol not found                                                                                                                                                                              
       Error relocating thread_test_01_CC_OO: _ZTINSt6thread6_StateE: symbol not found                                                                                                                                                                              
       Error relocating thread_test_01_CC_OO: _ZTINSt6thread6_StateE: symbol not found  
</code></pre>
<p dir="auto">However, if I compile this code directly on the Omega, the code works completely fine, running the same command (ldd) as above lists the same dependencies except without any errors.  I've checked my library versions as best I can, I've even started to copy the libraries from the Omega into my cross-compile staging directory but get the same results.  Can anyone point me in the direction of how to solve this issue?  Thank you!</p>
<pre><code>// CPP program to demonstrate multithreading
// using three different callables.
#include &lt;iostream&gt;
#include &lt;thread&gt;
using namespace std;

// A dummy function
void foo(int Z)
{
    for (int i = 0; i &lt; Z; i++) {
        cout &lt;&lt; "Thread using function"
               " pointer as callable\n";
    }
}

// A callable object
class thread_obj {
public:
    void operator()(int x)
    {
        for (int i = 0; i &lt; x; i++)
            cout &lt;&lt; "Thread using function"
                  " object as  callable\n";
    }
};

int main()
{
    cout &lt;&lt; "Threads 1 and 2 and 3 "
         "operating independently" &lt;&lt; endl;

    // This thread is launched by using
    // function pointer as callable
    thread th1(foo, 3);

    // This thread is launched by using
    // function object as callable
    thread th2(thread_obj(), 3);

    // Define a Lambda Expression
    auto f = [](int x) {
        for (int i = 0; i &lt; x; i++)
            cout &lt;&lt; "Thread using lambda"
             " expression as callable\n";
    };

    // This thread is launched by using
    // lamda expression as callable
    thread th3(f, 3);

    // Wait for the threads to finish
    // Wait for thread t1 to finish
    th1.join();

    // Wait for thread t2 to finish
    th2.join();

    // Wait for thread t3 to finish
    th3.join();

    return 0;
}
</code></pre>
]]></description><link>http://community.onion.io/topic/3669/c-thread-runtime-error-relocating-symbol-not-found</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 03:32:57 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/3669.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 Jul 2019 00:16:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to c++ thread runtime error relocating (symbol not found) on Tue, 23 Jul 2019 00:28:35 GMT]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">I'm trying to use the thread library from the c++11 std library  (#include &lt;thread&gt;) . I am cross compiling on my linux machine which compiles fine with no errors  or warnings.  Once I transfer it to the Omega2+ (0.2.2 b200), I immediately get a runtime error.  Using the ldd command I get this from the cross compiled version:</p>
<pre><code>root@Omega-####:~/# ldd thread_test_01_CC_OO                                                                                                                                                                                                         
        /lib/ld-musl-mipsel-sf.so.1 (0x55a9e000)                                                                                                                                                                                                             
        libstdc++.so.6 =&gt; /usr/lib/libstdc++.so.6 (0x77598000)                                                                                                                                                                                               
        libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x77574000)                                                                                                                                                                                                     
        libc.so =&gt; /lib/ld-musl-mipsel-sf.so.1 (0x55a9e000)           
        Error relocating thread_test_01_CC_OO: _ZNSt6thread6_StateD2Ev: symbol not found                                                                                                                                                                             
        Error relocating thread_test_01_CC_OO: _ZNSt6thread15_M_start_threadESt10unique_ptrINS_6_StateESt14default_deleteIS1_EEPFvvE: symbol not found                                                                                                               
       Error relocating thread_test_01_CC_OO: _ZTINSt6thread6_StateE: symbol not found                                                                                                                                                                              
       Error relocating thread_test_01_CC_OO: _ZTINSt6thread6_StateE: symbol not found                                                                                                                                                                              
       Error relocating thread_test_01_CC_OO: _ZTINSt6thread6_StateE: symbol not found                                                                                                                                                                              
       Error relocating thread_test_01_CC_OO: _ZTINSt6thread6_StateE: symbol not found  
</code></pre>
<p dir="auto">However, if I compile this code directly on the Omega, the code works completely fine, running the same command (ldd) as above lists the same dependencies except without any errors.  I've checked my library versions as best I can, I've even started to copy the libraries from the Omega into my cross-compile staging directory but get the same results.  Can anyone point me in the direction of how to solve this issue?  Thank you!</p>
<pre><code>// CPP program to demonstrate multithreading
// using three different callables.
#include &lt;iostream&gt;
#include &lt;thread&gt;
using namespace std;

// A dummy function
void foo(int Z)
{
    for (int i = 0; i &lt; Z; i++) {
        cout &lt;&lt; "Thread using function"
               " pointer as callable\n";
    }
}

// A callable object
class thread_obj {
public:
    void operator()(int x)
    {
        for (int i = 0; i &lt; x; i++)
            cout &lt;&lt; "Thread using function"
                  " object as  callable\n";
    }
};

int main()
{
    cout &lt;&lt; "Threads 1 and 2 and 3 "
         "operating independently" &lt;&lt; endl;

    // This thread is launched by using
    // function pointer as callable
    thread th1(foo, 3);

    // This thread is launched by using
    // function object as callable
    thread th2(thread_obj(), 3);

    // Define a Lambda Expression
    auto f = [](int x) {
        for (int i = 0; i &lt; x; i++)
            cout &lt;&lt; "Thread using lambda"
             " expression as callable\n";
    };

    // This thread is launched by using
    // lamda expression as callable
    thread th3(f, 3);

    // Wait for the threads to finish
    // Wait for thread t1 to finish
    th1.join();

    // Wait for thread t2 to finish
    th2.join();

    // Wait for thread t3 to finish
    th3.join();

    return 0;
}
</code></pre>
]]></description><link>http://community.onion.io/post/19823</link><guid isPermaLink="true">http://community.onion.io/post/19823</guid><dc:creator><![CDATA[OSO Bear]]></dc:creator><pubDate>Tue, 23 Jul 2019 00:28:35 GMT</pubDate></item><item><title><![CDATA[Reply to c++ thread runtime error relocating (symbol not found) on Wed, 24 Jul 2019 17:02:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5518">@OSO-Bear</a> my guess would be that you are using dynamic linking and have a version mismatch in your libraries. Try statically linking and if this is successfully take a look at the versions you are compiling and and running against.</p>
]]></description><link>http://community.onion.io/post/19833</link><guid isPermaLink="true">http://community.onion.io/post/19833</guid><dc:creator><![CDATA[crispyoz]]></dc:creator><pubDate>Wed, 24 Jul 2019 17:02:24 GMT</pubDate></item></channel></rss>