<?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[I exported a testlib.dylib with golang, why can’t I reference this dynamic library under qt.]]></title><description><![CDATA[<p dir="auto">I exported a testlib.dylib with golang, why can’t I reference this dynamic library under qt.<br />
I use a simple c code to reference this library without any problem.<br />
Thanks!</p>
<pre><code>:-1: error: library not found for -ltestlib
</code></pre>
<p dir="auto"><a href="http://app.pro" target="_blank" rel="noopener noreferrer nofollow ugc">app.pro</a></p>
<pre><code>macx {
    LIBS += -L$$PWD/libs/macos/ -ltestlib
    INCLUDEPATH += $$PWD/libs/macos/
}
</code></pre>
<p dir="auto">in $$PWD/libs/macos:</p>
<pre><code>-rw-r--r--  1 sen  admin   2.1M 10 14 16:14 testlib.dylib
-rw-r--r--  1 sen  admin   1.6K 10 14 17:53 testlib.h
</code></pre>
]]></description><link>https://forum.qt.io/topic/131123/i-exported-a-testlib-dylib-with-golang-why-can-t-i-reference-this-dynamic-library-under-qt</link><generator>RSS for Node</generator><lastBuildDate>Sat, 06 Jun 2026 01:42:58 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/131123.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Oct 2021 09:56:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to I exported a testlib.dylib with golang, why can’t I reference this dynamic library under qt. on Thu, 14 Oct 2021 20:28:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> It is indeed a lib naming problem. After changing to libtest.dylib, it should be like this:<br />
LIBS += -L$$PWD/libs/macos/ -ltest.</p>
]]></description><link>https://forum.qt.io/post/685167</link><guid isPermaLink="true">https://forum.qt.io/post/685167</guid><dc:creator><![CDATA[senmx]]></dc:creator><pubDate>Thu, 14 Oct 2021 20:28:54 GMT</pubDate></item><item><title><![CDATA[Reply to I exported a testlib.dylib with golang, why can’t I reference this dynamic library under qt. on Thu, 14 Oct 2021 11:53:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a><br />
if i look at: <a href="https://www.mimec.org/blog/qt-and-zip-files" target="_blank" rel="noopener noreferrer nofollow ugc">qt-and-zip-files</a><br />
it should be:<br />
LIBS += -L$$PWD/libs/macos/ -ltest</p>
<p dir="auto">the .pro i use for asoundlib on linux:</p>
<pre><code>linux {

 INCLUDEPATH += $$MidiClient/Linux
        
    HEADERS  += $$MidiClient/Linux/ALSA/MidiClientAPI.h 
    
    SOURCES  += $$MidiClient/Linux/ALSA/MidiClientAPI.cpp 

	LIBS += -lasound
        
}

and in the .h
</code></pre>
<p dir="auto">#ifndef LINUXMIDIAPI_H<br />
#define LINUXMIDIAPI_H</p>
<p dir="auto">#include "MidiAPI.h"<br />
#include &lt;alsa/asoundlib.h&gt;</p>
<pre><code>

</code></pre>
]]></description><link>https://forum.qt.io/post/685093</link><guid isPermaLink="true">https://forum.qt.io/post/685093</guid><dc:creator><![CDATA[mpergand]]></dc:creator><pubDate>Thu, 14 Oct 2021 11:53:02 GMT</pubDate></item><item><title><![CDATA[Reply to I exported a testlib.dylib with golang, why can’t I reference this dynamic library under qt. on Thu, 14 Oct 2021 10:57:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/senmx">@<bdi>senmx</bdi></a> said in <a href="/post/685074">I exported a testlib.dylib with golang, why can’t I reference this dynamic library under qt.</a>:</p>
<blockquote>
<p dir="auto">LIBS += -L$$PWD/libs/macos/ -ltestlib</p>
</blockquote>
<p dir="auto">The error message says that linker can't find the lib. Check the path you pass to -L (you can check compile log to see what path exactly is passed).<br />
I'm not sure how this is handled on MacOS, but on Linux linker expects this naming convention for libs: <a href="http://libLIBNAME.so" target="_blank" rel="noopener noreferrer nofollow ugc">libLIBNAME.so</a>. That means: the file name should start with "lib".</p>
]]></description><link>https://forum.qt.io/post/685080</link><guid isPermaLink="true">https://forum.qt.io/post/685080</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 14 Oct 2021 10:57:37 GMT</pubDate></item></channel></rss>