<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>day33 &amp;mdash; Gerrit Niezen</title>
    <link>https://gerritniezen.com/tag:day33</link>
    <description>Maker of open-source software and hardware.</description>
    <pubDate>Mon, 20 Apr 2026 04:32:32 +0000</pubDate>
    <image>
      <url>https://i.snap.as/aMPXpIot.png</url>
      <title>day33 &amp;mdash; Gerrit Niezen</title>
      <link>https://gerritniezen.com/tag:day33</link>
    </image>
    <item>
      <title>More adventures with libmtp</title>
      <link>https://gerritniezen.com/more-adventures-with-libmtp?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[So even though I managed to get libmtp compiled under Windows, I can&#39;t get it to work with Node.js. I&#39;ve decided to take the same approach as what I did with ffmpeg&#39;s libavutil library, and cross-compile it under Linux instead.&#xA;&#xA;To do this, I needed mingw64 on my Linux machine:&#xA;&#xA;sudo apt-get install mingw-w64&#xA;sudo apt-get install mingw-w64-tools&#xA;&#xA;It doesn&#39;t look like libusb has been pre-compiled for mingw64 on Linux, so I had to do the following:&#xA;&#xA;git clone https://github.com/libusb/libusb.git&#xA; git checkout v1.0.23&#xA;./autogen.sh&#xA;./configure --host=x8664-w64-mingw32&#xA;make&#xA;DESTDIR=$HOME/Code/mingw64/ make install&#xA;&#xA;This installs the libusb library (compiled for Windows) under $HOME/Code/mingw64/. Then I had to configure libmtp to use our Windows libusb build:&#xA;&#xA;PKGCONFIGPATH=$HOME/Code/mingw64/usr/local/lib/pkgconfig  ./configure --host=x8664-w64-mingw32&#xA;make&#xA;&#xA;Again I had to fix unicode.c to get it working. I should submit this work as  a PR to libmtp.&#xA;&#xA;Next step: Try to get this working in as a native Node.js addon.&#xA;&#xA;For reference:&#xA;http://www.tinc-vpn.org/examples/cross-compiling-64-bit-windows-binary/&#xA;&#xA;---&#xA;I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.&#xA;&#xA;#100DaysToOffload #day33 #libmtp&#xA;&#xA;iComment on this post/i&#xD;&#xA;div id=&#34;cusdis_thread&#34;/div]]&gt;</description>
      <content:encoded><![CDATA[<p>So even though I managed to <a href="https://gerritniezen.com/attempting-to-get-libmtp-compiled-on-windows">get libmtp compiled under Windows</a>, I can&#39;t get it to work with Node.js. I&#39;ve decided to take the same approach as what I did with ffmpeg&#39;s libavutil library, and <a href="https://gerritniezen.com/using-libavutils-lzo-algorithm-in-node-js-part-5">cross-compile it under Linux</a> instead.</p>

<p>To do this, I needed mingw64 on my Linux machine:</p>

<pre><code class="language-sh">sudo apt-get install mingw-w64
sudo apt-get install mingw-w64-tools
</code></pre>

<p>It doesn&#39;t look like libusb has been pre-compiled for mingw64 on Linux, so I had to do the following:</p>

<pre><code class="language-sh">git clone https://github.com/libusb/libusb.git
 git checkout v1.0.23
./autogen.sh
./configure --host=x86_64-w64-mingw32
make
DESTDIR=$HOME/Code/mingw64/ make install
</code></pre>

<p>This installs the libusb library (compiled for Windows) under <code>$HOME/Code/mingw64/</code>. Then I had to configure libmtp to use our Windows libusb build:</p>

<pre><code class="language-sh">PKG_CONFIG_PATH=$HOME/Code/mingw64/usr/local/lib/pkgconfig  ./configure --host=x86_64-w64-mingw32
make
</code></pre>

<p>Again I had to fix <code>unicode.c</code> to get it working. I should submit <a href="https://gerritniezen.com/attempting-to-get-libmtp-compiled-on-windows">this work</a> as  a PR to libmtp.</p>

<p>Next step: Try to get this working in as a native Node.js addon.</p>

<p>For reference:
<a href="http://www.tinc-vpn.org/examples/cross-compiling-64-bit-windows-binary/">http://www.tinc-vpn.org/examples/cross-compiling-64-bit-windows-binary/</a></p>

<hr/>

<p>I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting <a href="https://100daystooffload.com">https://100daystooffload.com</a>.</p>

<p><a href="https://gerritniezen.com/tag:100DaysToOffload" class="hashtag"><span>#</span><span class="p-category">100DaysToOffload</span></a> <a href="https://gerritniezen.com/tag:day33" class="hashtag"><span>#</span><span class="p-category">day33</span></a> <a href="https://gerritniezen.com/tag:libmtp" class="hashtag"><span>#</span><span class="p-category">libmtp</span></a></p>

<p><i>Comment on this post</i>
<div id="cusdis_thread" id="cusdis_thread"></div></p>
]]></content:encoded>
      <guid>https://gerritniezen.com/more-adventures-with-libmtp</guid>
      <pubDate>Thu, 28 May 2020 15:23:01 +0000</pubDate>
    </item>
  </channel>
</rss>