<?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[Plugin error while loading in application uisng cmake]]></title><description><![CDATA[<p dir="auto">hai i am trying crete a simple plugin using CMakeList.txt in windows. but i ma facing an error i tried so many ways but i am not getting how to resolved this error please hepl me to resolve this.</p>
<pre><code>cmake_minimum_required(VERSION 3.16)

project(WComponents VERSION 0.1 LANGUAGES CXX)

set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(QT_QML_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR})

find_package(Qt6 6.2 COMPONENTS Core Quick REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Core )

# qt_add_library(WComponents STATIC)
qt_add_qml_module(WComponents
    URI "com.WComponents"
    CLASS_NAME WComponentsPlugin
    PLUGIN_TARGET WComponentsPlugin
    VERSION 1.0
    QML_FILES CustomBtn.qml
    SOURCES
    WComponents_plugin.cpp
    WComponents_plugin.h
    WAction.h
    WAction.cpp
)

set_target_properties(WComponents PROPERTIES
    MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

target_compile_definitions(WComponents
    PRIVATE $&lt;$&lt;OR:$&lt;CONFIG:Debug&gt;,$&lt;CONFIG:RelWithDebInfo&gt;&gt;:QT_QML_DEBUG&gt;)
target_link_libraries(WComponents
    PRIVATE
    Qt6::Quick
    Qt6::Core
)
target_link_libraries(WComponents PRIVATE Qt6::Core)
# target_link_libraries(WComponents PRIVATE Qt6::Core)

target_include_directories(WComponents PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

</code></pre>
<p dir="auto">this is my plugin cmake .<br />
i am not added anything in application cmake but in main.cpp i am loading using</p>
<pre><code>enine.addImportPath("D:\\rangaWorkspace\\WComponentsLoader")
</code></pre>
<p dir="auto">and in my main.qml i am iporting like this</p>
<pre><code>import com.WComponents 1.0
or
import com.WComponents

</code></pre>
<p dir="auto">but when i launch my application i am getting below error</p>
<pre><code>QQmlApplicationEngine failed to load component
qrc:/qt/qml/WComponentsLoader/Main.qml:2:1: Cannot load library D:\rangaWorkspace\WComponentsLoader\com\WComponents\WComponentsPlugin.dll: The specified module could not be found.
</code></pre>
<p dir="auto">please help me to resolve this error.<br />
ThankYou.</p>
]]></description><link>https://forum.qt.io/topic/163218/plugin-error-while-loading-in-application-uisng-cmake</link><generator>RSS for Node</generator><lastBuildDate>Tue, 29 Sep 2026 19:19:15 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/163218.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Sep 2025 01:56:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Plugin error while loading in application uisng cmake on Fri, 12 Sep 2025 05:09:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/rangantha-b-v">@<bdi>Rangantha-B-V</bdi></a> No need to ask same question twice (<a href="https://forum.qt.io/topic/163207/qml-plugin-load-error/4?_=1757653705393">https://forum.qt.io/topic/163207/qml-plugin-load-error/4?_=1757653705393</a>).<br />
In that other thread - did you react to the comment from <a class="plugin-mentions-user plugin-mentions-a" href="/user/jksh">@<bdi>JKSH</bdi></a> ?</p>
]]></description><link>https://forum.qt.io/post/831489</link><guid isPermaLink="true">https://forum.qt.io/post/831489</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Fri, 12 Sep 2025 05:09:32 GMT</pubDate></item></channel></rss>