<?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[OpenMP]]></title><description><![CDATA[<p>Hallöchen<br />
Ich wollte mir mal OpenMP anschauen, scheitere allerdings schon beim Linken :D. und zwar hab ich ein ganz einfaches Programm:</p>
<pre><code class="language-cpp">#include &lt;omp.h&gt;
#include &lt;iostream&gt;
using namespace std;

int main()
{
    #pragma omp parallel
    {
        cout &lt;&lt; &quot;Aloha!&quot; &lt;&lt; endl;
        cout &lt;&lt; &quot;Aloha!&quot; &lt;&lt; endl;
    }
}
</code></pre>
<p>welches ich mit MinGW-GCC tdm-4.3.2 kompiliere:</p>
<pre><code>mingw32-g++.exe -Wall  -O2  -fopenmp -c D:\Projects\OpenMP1\main.cpp -o obj\Release\main.o
mingw32-g++.exe -o bin\Release\OpenMP1.exe obj\Release\main.o   -s -fopenmp
</code></pre>
<p>g++ beschwert sich über undefined references zu PThread - funktionen.<br />
z.B:</p>
<pre><code>c:/mingw/bin/../lib/gcc/mingw32/4.3.2/libgomp.a(parallel.o):parallel.c:(.text+0xe): undefined reference to `__imp__pthread_getspecific'
c:/mingw/bin/../lib/gcc/mingw32/4.3.2/libgomp.a(parallel.o):parallel.c:(.text+0x46): undefined reference to `__imp__pthread_getspecific'
</code></pre>
<p>Insgesamt 39 Fehler.</p>
<p>hab versucht beim linken -lpthread hinzuzufügen, hat aber nichts bewirkt. Im internet finde ich nichts dazu, Was hab ich hier verpasst? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Edit: Problem gelöst durch besseres suchen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> -&gt; <a href="http://article.gmane.org/gmane.comp.gnu.mingw.user/23409" rel="nofollow">http://article.gmane.org/gmane.comp.gnu.mingw.user/23409</a></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/226722/openmp</link><generator>RSS for Node</generator><lastBuildDate>Wed, 30 Sep 2026 16:37:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/226722.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Nov 2008 09:32:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to OpenMP on Wed, 05 Nov 2008 09:42:09 GMT]]></title><description><![CDATA[<p>Hallöchen<br />
Ich wollte mir mal OpenMP anschauen, scheitere allerdings schon beim Linken :D. und zwar hab ich ein ganz einfaches Programm:</p>
<pre><code class="language-cpp">#include &lt;omp.h&gt;
#include &lt;iostream&gt;
using namespace std;

int main()
{
    #pragma omp parallel
    {
        cout &lt;&lt; &quot;Aloha!&quot; &lt;&lt; endl;
        cout &lt;&lt; &quot;Aloha!&quot; &lt;&lt; endl;
    }
}
</code></pre>
<p>welches ich mit MinGW-GCC tdm-4.3.2 kompiliere:</p>
<pre><code>mingw32-g++.exe -Wall  -O2  -fopenmp -c D:\Projects\OpenMP1\main.cpp -o obj\Release\main.o
mingw32-g++.exe -o bin\Release\OpenMP1.exe obj\Release\main.o   -s -fopenmp
</code></pre>
<p>g++ beschwert sich über undefined references zu PThread - funktionen.<br />
z.B:</p>
<pre><code>c:/mingw/bin/../lib/gcc/mingw32/4.3.2/libgomp.a(parallel.o):parallel.c:(.text+0xe): undefined reference to `__imp__pthread_getspecific'
c:/mingw/bin/../lib/gcc/mingw32/4.3.2/libgomp.a(parallel.o):parallel.c:(.text+0x46): undefined reference to `__imp__pthread_getspecific'
</code></pre>
<p>Insgesamt 39 Fehler.</p>
<p>hab versucht beim linken -lpthread hinzuzufügen, hat aber nichts bewirkt. Im internet finde ich nichts dazu, Was hab ich hier verpasst? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Edit: Problem gelöst durch besseres suchen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> -&gt; <a href="http://article.gmane.org/gmane.comp.gnu.mingw.user/23409" rel="nofollow">http://article.gmane.org/gmane.comp.gnu.mingw.user/23409</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1610430</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1610430</guid><dc:creator><![CDATA[Azrael* il Meraz]]></dc:creator><pubDate>Wed, 05 Nov 2008 09:42:09 GMT</pubDate></item></channel></rss>