<?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[opencv无法使用image show，工程可以正常构建生成可执行文件]]></title><description><![CDATA[<p dir="auto">cv::imshow("image", image);<br />
opencv无法使用image show，工程可以正常构建生成可执行文件，安装gtk无效。<img src="/assets/uploads/files/1729169860816-ea4c1d28-d85a-48ea-a7eb-3579095c82b4-image.png" alt="ea4c1d28-d85a-48ea-a7eb-3579095c82b4-image.png" class=" img-fluid img-markdown" /> ，运行时报错The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'</p>
<p dir="auto">配置信息<br />
et_project("Rasterizer")</p>
<p dir="auto">add_rules("mode.debug", "mode.release")</p>
<p dir="auto">add_requires("opencv",{configs={with_gtk = true}})<br />
add_requires("eigen")</p>
<p dir="auto">set_languages("cxx17")</p>
<p dir="auto">if is_os("windows") then<br />
add_defines("_CRT_SECURE_NO_WARNINGS")<br />
add_cxflags("/utf-8")<br />
end</p>
<p dir="auto">target("Rasterizer")<br />
set_kind("binary")<br />
add_packages("opencv", "eigen")<br />
add_files("<em>.cpp")<br />
add_headerfiles("</em>.hpp")<br />
set_rundir("$(projectdir)")</p>
]]></description><link>http://forum.d2learn.org/topic/19/opencv无法使用image-show-工程可以正常构建生成可执行文件</link><generator>RSS for Node</generator><lastBuildDate>Thu, 13 Aug 2026 14:46:28 GMT</lastBuildDate><atom:link href="http://forum.d2learn.org/topic/19.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Oct 2024 13:01:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to opencv无法使用image show，工程可以正常构建生成可执行文件 on Fri, 15 Nov 2024 08:05:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="http://forum.d2learn.org/uid/8">@Vilote</a> 在 <a href="/post/49">opencv无法使用image show，工程可以正常构建生成可执行文件</a> 中说：</p>
<blockquote>
<p dir="auto">implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'</p>
</blockquote>
<p dir="auto">上面 {不使用系统库} 遇到的问题可能和xmake包管理器的gtk包名问题有关系, 最近两天修复了</p>
<p dir="auto"><a href="https://github.com/xmake-io/xmake-repo/pull/5748" rel="nofollow ugc">https://github.com/xmake-io/xmake-repo/pull/5748</a></p>
<p dir="auto">可以用下面的命令更新包索引</p>
<pre><code>xrepo clean 
xrepo update-repo -f
</code></pre>
]]></description><link>http://forum.d2learn.org/post/114</link><guid isPermaLink="true">http://forum.d2learn.org/post/114</guid><dc:creator><![CDATA[sunrisepeak]]></dc:creator><pubDate>Fri, 15 Nov 2024 08:05:21 GMT</pubDate></item><item><title><![CDATA[Reply to opencv无法使用image show，工程可以正常构建生成可执行文件 on Thu, 17 Oct 2024 15:38:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="http://forum.d2learn.org/uid/1">@sunrisepeak</a></p>
<p dir="auto"><img src="/assets/uploads/files/1729179493279-1fffcb6d-cf39-4241-b01a-1779bca9883c-image.png" alt="1fffcb6d-cf39-4241-b01a-1779bca9883c-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://forum.d2learn.org/post/57</link><guid isPermaLink="true">http://forum.d2learn.org/post/57</guid><dc:creator><![CDATA[sunrisepeak]]></dc:creator><pubDate>Thu, 17 Oct 2024 15:38:16 GMT</pubDate></item><item><title><![CDATA[Reply to opencv无法使用image show，工程可以正常构建生成可执行文件 on Thu, 17 Oct 2024 15:32:58 GMT]]></title><description><![CDATA[<p dir="auto">一个 xmake 使用opencv显示图片的最小示例</p>
<p dir="auto"><a href="https://github.com/Sunrisepeak/HelloWorld/tree/main/demos/xmake-opencv" rel="nofollow ugc">https://github.com/Sunrisepeak/HelloWorld/tree/main/demos/xmake-opencv</a></p>
]]></description><link>http://forum.d2learn.org/post/55</link><guid isPermaLink="true">http://forum.d2learn.org/post/55</guid><dc:creator><![CDATA[sunrisepeak]]></dc:creator><pubDate>Thu, 17 Oct 2024 15:32:58 GMT</pubDate></item><item><title><![CDATA[Reply to opencv无法使用image show，工程可以正常构建生成可执行文件 on Thu, 17 Oct 2024 14:41:40 GMT]]></title><description><![CDATA[<p dir="auto">应该最开始opencv构建的时候没有使用gtk, 你可以删除已经安装的opencv然后重新构建安装</p>
<pre><code class="language-bash">xmake require --uninstall opencv
xmake f -c
xmake
</code></pre>
<p dir="auto">或者直接删除也可以, 一般编译构建好的包/库在<code>~/.xmake/packages</code>的对应目录</p>
]]></description><link>http://forum.d2learn.org/post/54</link><guid isPermaLink="true">http://forum.d2learn.org/post/54</guid><dc:creator><![CDATA[sunrisepeak]]></dc:creator><pubDate>Thu, 17 Oct 2024 14:41:40 GMT</pubDate></item></channel></rss>