<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Raspberry Pico C/C++ SDK - Set up C++23 capable toolchain</title><link>/technologies/embedded/b/blog/posts/raspberry-pico-c-c-sdk---set-up-c-23-capable-toolchain</link><description>The Pico C/C++ SDK 1.5, when installed with the windows installer, comes with GCC version 10.3.1. That version supports C++ up to C++2a. Any GCC with version &amp;gt; 10 supports C++23.In this little post, I install GCC 13.3, build my project with i...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Raspberry Pico C/C++ SDK - Set up C++23 capable toolchain</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/raspberry-pico-c-c-sdk---set-up-c-23-capable-toolchain</link><pubDate>Sat, 03 Aug 2024 14:07:06 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:56c2c8ce-068c-4afe-943a-7cc42bcc6194</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;The github&amp;nbsp;repository that I use for the project I used above, validates if your (my&amp;nbsp;[emoticon:c4563cd7d5574777a71c318021cbbcc8]) code builds, when a pull request is made for the develop or main branch:&amp;nbsp;[mention:fd8811585d4a425bb3b0816cf2887d20:f7d226abd59f475c9d224a79e3f0ec07]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This verification runs on GitHub hosted virtual machines.&lt;/p&gt;
&lt;p&gt;The GitHub action installed the default version of the GCC cross-compile toolchain for the Linux server that the action happens to run on:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:182477b5-0af5-4ebd-9b9c-4cc8bf165693:type=text&amp;text=%20%20%20%20%20%20-%20name%3A%20Install%20dependencies%0D%0A%20%20%20%20%20%20%20%20run%3A%20%7C%0D%0A%20%20%20%20%20%20%20%20%20%20sudo%20apt-get%20install%20cmake%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20sudo%20apt%20install%20gcc-arm-none-eabi%0D%0A%20%20%20%20%20%20%20%20%20%20%20%2Fusr%2Fbin%2Farm-none-eabi-gcc%20--version]&lt;/p&gt;
&lt;p&gt;At this moment, that&amp;#39;s version 10.3. Not high enough to compile C++23 constructs.&lt;/p&gt;
&lt;p&gt;I adapted the build file to download and install&amp;nbsp;the most recent version of the toolchain:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:2073dc3b-5856-4253-beb6-e0ee903e1df2:type=text&amp;text=%20%20%20%20%20%20-%20name%3A%20Install%20dependencies%0D%0A%20%20%20%20%20%20%20%20run%3A%20%7C%0D%0A%20%20%20%20%20%20%20%20%20%20sudo%20apt-get%20install%20cmake%0D%0A%20%20%20%20%20%20%20%20%20%20curl%20-Lo%20gcc-arm-none-eabi.tar.xz%20%22https%3A%2F%2Fdeveloper.arm.com%2F-%2Fmedia%2FFiles%2Fdownloads%2Fgnu%2F13.3.rel1%2Fbinrel%2Farm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz%22%0D%0A%20%20%20%20%20%20%20%20%20%20sudo%20mkdir%20%2Fopt%2Fgcc-arm-none-eabi%0D%0A%20%20%20%20%20%20%20%20%20%20sudo%20tar%20xf%20gcc-arm-none-eabi.tar.xz%20--strip-components%3D1%20-C%20%2Fopt%2Fgcc-arm-none-eabi%0D%0A%20%20%20%20%20%20%20%20%20%20echo%20%27export%20PATH%3D%24PATH%3A%2Fopt%2Fgcc-arm-none-eabi%2Fbin%27%20%7C%20sudo%20tee%20-a%20%2Fetc%2Fprofile.d%2Fgcc-arm-none-eabi.sh%0D%0A%20%20%20%20%20%20%20%20%20%20export%20PATH%3D%24PATH%3A%2Fopt%2Fgcc-arm-none-eabi%2Fbin%0D%0A%20%20%20%20%20%20%20%20%20%20export%20PICO_TOOLCHAIN_PATH%3D%2Fopt%2Fgcc-arm-none-eabi%2Fbin%0D%0A%20%20%20%20%20%20%20%20%20%20source%20%2Fetc%2Fprofile%0D%0A%20%20%20%20%20%20%20%20%20%20arm-none-eabi-c%2B%2B%20--version%0D%0A%20%20%20%20%20%20%20%20%20%20]&lt;/p&gt;
&lt;p&gt;I then adapted the build section to find the toolchain:&lt;/p&gt;
&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:6e6ec0a9-3d1f-401d-8f66-e0778a69477f:type=text&amp;text=-%20name%3A%20Build%20Project%0D%0A%20%20working-directory%3A%20%24%7B%7Bgithub.workspace%7D%7D%2Fpico_gps_teseo%0D%0A%20%20shell%3A%20bash%0D%0A%20%20run%3A%20%7C%0D%0A%20%20%20%20mkdir%20build%0D%0A%20%20%20%20cd%20build%0D%0A%20%20%20%20cmake%20..%20-G%20%22Unix%20Makefiles%22%20-DCMAKE_EXPORT_COMPILE_COMMANDS%3ABOOL%3DTRUE%20-DCMAKE_C_COMPILER%3AFILEPATH%3D%2Fopt%2Fgcc-arm-none-eabi%2Fbin%2Farm...]&lt;/p&gt;
&lt;p&gt;It works:&lt;/p&gt;
&lt;div data-index="173"&gt;
&lt;div class="js-check-step-line CheckStep-line d-flex log-line-plain"&gt;
&lt;div data-index="121"&gt;
&lt;div data-index="11"&gt;
&lt;pre class="js-check-step-line CheckStep-line d-flex log-line-plain"&gt;&lt;span class="CheckStep-line-content d-inline-block flex-auto ml-3 js-check-line-content"&gt;&lt;span class=""&gt;PICO compiler is pico_arm_gcc&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="js-check-step-line CheckStep-line d-flex log-line-plain"&gt;-- The C compiler identification is GNU 13.3.1&lt;/pre&gt;
&lt;pre class="js-check-step-line CheckStep-line d-flex log-line-plain"&gt;-- The CXX compiler identification is GNU 13.3.1&lt;/pre&gt;
&lt;/div&gt;
&lt;pre class="js-check-step-line CheckStep-line d-flex log-line-plain"&gt;&lt;span class="CheckStep-line-content d-inline-block flex-auto ml-3 js-check-line-content"&gt;&lt;span class=""&gt;[ 50%] Linking CXX executable pico_gps_teseo_reply_response.elf&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;[ 50%] Built target pico_gps_teseo_reply_response&lt;br /&gt;...&lt;br /&gt;[ 92%] Linking CXX executable pico_gps_teseo_nmea_parse.elf&lt;br /&gt;[ 92%] Built target pico_gps_teseo_nmea_parse&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div data-index="174"&gt;
&lt;div class="js-check-step-line CheckStep-line d-flex log-line-plain"&gt;&lt;span class="CheckStep-line-content d-inline-block flex-auto ml-3 js-check-line-content"&gt;&lt;span class=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="js-check-step-line CheckStep-line d-flex log-line-plain"&gt;&lt;span class="CheckStep-line-content d-inline-block flex-auto ml-3 js-check-line-content"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;img src="https://community.element14.com/aggbug?PostID=28227&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>