<?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[QLibrary: isLoaded() not matching!]]></title><description><![CDATA[<p dir="auto">Here is a simple example of my main C++ application that loads my custom shared library called "mylib.so.1.0.0" that is placed in the same folder of the main application.<br />
The wired thing is that: In the console output it said that the <code>mylib</code> was not loaded, but it can call and execute the <code>run()</code> function that is inside the shared library.</p>
<pre><code>    QLibrary mylib("./mylib");

    std::cout &lt;&lt; "Is Loaded: " &lt;&lt; mylib.isLoaded() &lt;&lt; std::endl;
    std::cout &lt;&lt; mylib.errorString().toStdString() &lt;&lt; std::endl;

    typedef void (*func_run)(void);

    func_run run = (func_run) mylib.resolve("run");

    if (run == NULL) {
        std::cerr &lt;&lt; "[API ERROR]: Unable to load the run() function!" &lt;&lt; std::endl;
        exit(1);
    }

    run(); // WORKS GOOD!
</code></pre>
<p dir="auto">Console Output:</p>
<pre><code>Is Loaded: 0   // &lt;-- WHY?
Unknown error
Shared Library: Inside the RUN() function 
</code></pre>
<p dir="auto">My System:</p>
<ul>
<li>Ubuntu 20.04 x64</li>
<li>CMake 3.16.3</li>
<li>g++ 9.3</li>
<li>Qt 5.15.1</li>
</ul>
]]></description><link>https://forum.qt.io/topic/119883/qlibrary-isloaded-not-matching</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 01:28:00 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/119883.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Oct 2020 01:46:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QLibrary: isLoaded() not matching! on Tue, 13 Oct 2020 01:49:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fem_dev">@<bdi>fem_dev</bdi></a> I solve...To get a right result of <code>isLoaded()</code> you must call <code>load()</code> before it!</p>
]]></description><link>https://forum.qt.io/post/621911</link><guid isPermaLink="true">https://forum.qt.io/post/621911</guid><dc:creator><![CDATA[fem_dev]]></dc:creator><pubDate>Tue, 13 Oct 2020 01:49:32 GMT</pubDate></item><item><title><![CDATA[Reply to QLibrary: isLoaded() not matching! on Tue, 13 Oct 2020 02:08:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fem_dev">@<bdi>fem_dev</bdi></a></p>
<blockquote>
<p dir="auto">To get a right result of <code>isLoaded()</code> you must call <code>load()</code> before it!</p>
</blockquote>
<p dir="auto">I think that's not true, the result of <code>isLoaded()</code> is right during the whole time.<br />
When you haven't called <code>load()</code>, it <strong>is</strong> not loaded, so <code>isLoaded()</code> should return false.</p>
]]></description><link>https://forum.qt.io/post/621913</link><guid isPermaLink="true">https://forum.qt.io/post/621913</guid><dc:creator><![CDATA[Bonnie]]></dc:creator><pubDate>Tue, 13 Oct 2020 02:08:00 GMT</pubDate></item><item><title><![CDATA[Reply to QLibrary: isLoaded() not matching! on Tue, 13 Oct 2020 01:49:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/fem_dev">@<bdi>fem_dev</bdi></a> I solve...To get a right result of <code>isLoaded()</code> you must call <code>load()</code> before it!</p>
]]></description><link>https://forum.qt.io/post/621911</link><guid isPermaLink="true">https://forum.qt.io/post/621911</guid><dc:creator><![CDATA[fem_dev]]></dc:creator><pubDate>Tue, 13 Oct 2020 01:49:32 GMT</pubDate></item></channel></rss>