trns1997 commented on issue #16775:
URL: https://github.com/apache/nuttx/issues/16775#issuecomment-3159869687

   Hey @Barto22 
   
   Here is hopefully a step-by-step guide to build helloxx example which 
compiles as expected on the stm32f4discovery board (I don’t have hardware to 
test runtime).
   Here’s what I did – hopefully these steps help you get a clean build:
   
   ### 1. Update the board configuration
   
   Replace the contents of 
`boards/arm/stm32/stm32f4discovery/configs/nsh/defconfig` with the following:
   ```
   #
   # This file is autogenerated: PLEASE DO NOT EDIT IT.
   #
   # You can use "make menuconfig" to make any modifications to the installed 
.config file.
   # You can then do "make savedefconfig" to generate a new defconfig file that 
includes your
   # modifications.
   #
   # CONFIG_ARCH_FPU is not set
   # CONFIG_NSH_ARGCAT is not set
   # CONFIG_NSH_CMDOPT_HEXDUMP is not set
   CONFIG_ARCH="arm"
   CONFIG_ARCH_BOARD="stm32f4discovery"
   CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
   CONFIG_ARCH_BUTTONS=y
   CONFIG_ARCH_CHIP="stm32"
   CONFIG_ARCH_CHIP_STM32=y
   CONFIG_ARCH_CHIP_STM32F407VG=y
   CONFIG_ARCH_STACKDUMP=y
   CONFIG_BOARD_LATE_INITIALIZE=y
   CONFIG_BOARD_LOOPSPERMSEC=16717
   CONFIG_BUILTIN=y
   CONFIG_EXAMPLES_HELLO=y
   CONFIG_FS_PROCFS=y
   CONFIG_HAVE_CXX=y
   CONFIG_HOST_WINDOWS=y
   CONFIG_INIT_ENTRYPOINT="nsh_main"
   CONFIG_INTELHEX_BINARY=y
   CONFIG_LINE_MAX=64
   CONFIG_MM_REGIONS=2
   CONFIG_NSH_BUILTIN_APPS=y
   CONFIG_NSH_FILEIOSIZE=512
   CONFIG_NSH_READLINE=y
   CONFIG_PREALLOC_TIMERS=4
   CONFIG_RAM_SIZE=114688
   CONFIG_RAM_START=0x20000000
   CONFIG_RAW_BINARY=y
   CONFIG_RR_INTERVAL=200
   CONFIG_SCHED_WAITPID=y
   CONFIG_START_DAY=6
   CONFIG_START_MONTH=12
   CONFIG_START_YEAR=2011
   CONFIG_STM32_JTAG_SW_ENABLE=y
   CONFIG_STM32_PWR=y
   CONFIG_STM32_SPI1=y
   CONFIG_STM32_USART2=y
   CONFIG_SYSTEM_NSH=y
   CONFIG_USART2_RXBUFSIZE=128
   CONFIG_USART2_SERIAL_CONSOLE=y
   CONFIG_USART2_TXBUFSIZE=128
   CONFIG_CXX_EXCEPTION=y
   CONFIG_CXX_RTTI=y
   CONFIG_CXX_STANDARD="c++17"
   CONFIG_LIBCXXTOOLCHAIN=y
   CONFIG_TESTING_CXXTEST=y
   CONFIG_EXAMPLES_HELLOXX=y
   
   ```
   This config enables the build of the helloxx app and links the toolchain 
builtin library.
   
   ### 2. Build commands
   ```
   make distclean
   ./tools/configure.sh -l stm32f4discovery:nsh
   make -j8
   ```
   
   ### 3. Expected output
   You should see something similar to:
   ```
   ➜  nuttx git:(master) ✗ make -j8
   Create version.h
   LN: platform/board to /home/thomas/nuttxspace/apps/platform/dummy
   Register: hello
   Register: dd
   Register: nsh
   Register: sh
   Register: helloxx
   Register: cxxtest
   CC:  inode/fs_inodebasename.c chip/stm32_gpio.c:44:11: note: '#pragma 
message: CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see 
tools/stm32_pinmap_tool.py'
      44 | #  pragma message "CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated 
migrate board.h see tools/stm32_pinmap_tool.py"
         |           ^~~~~~~
   CC:  dirent/lib_opendir.c In file included from chip/stm32_flash.c:40:
   chip/stm32f20xxf40xx_flash.c:53:4: warning: #warning "Default Flash 
Configuration Used - See Override Flash Size Designator" [-Wcpp]
      53 | #  warning "Default Flash Configuration Used - See Override Flash 
Size Designator"
         |    ^~~~~~~
   LD: nuttx
   arm-none-eabi-ld: warning: /home/thomas/nuttxspace/nuttx/nuttx has a LOAD 
segment with RWX permissions
   Memory region         Used Size  Region Size  %age Used
              flash:      130872 B         1 MB     12.48%
               sram:        5800 B       112 KB      5.06%
   CP: nuttx.hex
   CP: nuttx.bin
   
   ```
   
   ### Notes
   Couple notes though:
   - I built this on Ubuntu 24.04 with gcc 13.3.0. Since you’re using gcc 
14.3.1, some of your issues might be related to that newer toolchain. If 
possible, try building with gcc 13.x to see if it resolves the conflicts.
   - The config above sets C++17 as the standard. If you need C++20 features 
(e.g., std::format, ranges), you’ll need to adjust and test accordingly — I 
haven’t validated that yet.
   
   Can you try these exact steps and see if it resolves your build errors?
   
   And maybe @leducp might have other ideas on this matter, not sure if he had 
the occasion to test out newer gcc versions and recent C++ features on nuttx? 
If i have the time i might test it out one of these days out of curiosity :) .


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to