<?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[Unable to build qtdeclarative (cross-compiling Qt5 for Raspberry Pi zero W): Error ‘PATH_MAX’ was not declared in this scope]]></title><description><![CDATA[<p dir="auto">I have successfully cross-compiled qtbase for Raspberry Pi 0 W (by following <a href="https://wiki.qt.io/RaspberryPi2EGLFS" target="_blank" rel="noopener noreferrer nofollow ugc">https://wiki.qt.io/RaspberryPi2EGLFS</a>) , but I'm unable to build the sub-module QtDeclarative for adding QML support. With Qt5.15.0 I'm getting the following error :</p>
<pre><code>/qtdeclarative/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp:86:14: error: ‘PATH_MAX’ was not declared in this scope
     char buf[PATH_MAX];
</code></pre>
<p dir="auto">What am I doing wrong ?</p>
]]></description><link>https://forum.qt.io/topic/118090/unable-to-build-qtdeclarative-cross-compiling-qt5-for-raspberry-pi-zero-w-error-path_max-was-not-declared-in-this-scope</link><generator>RSS for Node</generator><lastBuildDate>Sun, 17 May 2026 09:04:54 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/118090.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Aug 2020 12:58:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Unable to build qtdeclarative (cross-compiling Qt5 for Raspberry Pi zero W): Error ‘PATH_MAX’ was not declared in this scope on Sat, 03 Oct 2020 12:14:17 GMT]]></title><description><![CDATA[<p dir="auto">I ran into the same problem using GCC 8.3 as a cross compiler with the latest (as of 3-10-2020) raspbian. I guess that previously PATH_MAX was leaked by another header, hiding this bug. I fixed it by simply replacing the macro PATH_MAX with a constant (1024). That should be plenty of space to hold the 20 or so bytes that are copied into <code>buf</code>, which isn't a real path anyway.</p>
<pre><code>diff --git a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
index d59fdcd675..56cd753bb5 100644
--- a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
+++ b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
@@ -74,7 +74,7 @@ static int memfdForUsage(size_t bytes, OSAllocator::Usage usage)
         break;
     }
 
-    char buf[PATH_MAX];
+    char buf[1024 /* PATH_MAX */];
     strcpy(buf, type);
     strcat(buf, "QtQml");
</code></pre>
<p dir="auto">The actual fix is to either include linux/limits.h or fix memfdForUsage() to not allocate such a huge stack buffer for no reason at all.</p>
]]></description><link>https://forum.qt.io/post/620500</link><guid isPermaLink="true">https://forum.qt.io/post/620500</guid><dc:creator><![CDATA[Lord_Naikon]]></dc:creator><pubDate>Sat, 03 Oct 2020 12:14:17 GMT</pubDate></item><item><title><![CDATA[Reply to Unable to build qtdeclarative (cross-compiling Qt5 for Raspberry Pi zero W): Error ‘PATH_MAX’ was not declared in this scope on Sun, 16 Aug 2020 23:24:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/glamis">@<bdi>glamis</bdi></a> I'm not sure why PATH_MAX isn't found in your source code, but this post should help you understand what it is: <a href="https://stackoverflow.com/questions/9449241/where-is-path-max-defined-in-linux" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/9449241/where-is-path-max-defined-in-linux</a></p>
]]></description><link>https://forum.qt.io/post/612609</link><guid isPermaLink="true">https://forum.qt.io/post/612609</guid><dc:creator><![CDATA[JKSH]]></dc:creator><pubDate>Sun, 16 Aug 2020 23:24:22 GMT</pubDate></item></channel></rss>