You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/02/19 13:41:48 UTC

[GitHub] [incubator-nuttx] flavioipiranga commented on issue #5530: libxx "C++ Example using CMake" guide "No thread API" error

flavioipiranga commented on issue #5530:
URL: https://github.com/apache/incubator-nuttx/issues/5530#issuecomment-1046021255


   I made some changes based at what you mentioned and the discussion at the link.
   
   First I added the #define __NuttX__ at the CMakeLists.txt here:
   `set(AC_DEFINES "${AC_DEFINES} -D__NuttX__ -DCONFIG_WCHAR_BUILTIN")`
   
   This solve the question about: error: #error "No thread API".
   
   After this I have an error about the lsupc++ lib. Looking at NuttX repository for this lib, I found out there is a config LIBSUPCXX to enable this lib.
   
   So I enabled this config using: 
   `make menuconfig`
   
   With this config enabled I ran:
   `./tools/configure.sh stm32f4discovery:testlibcxx`
   `make export`
   
   Following the steps mentioned at the example guide, new error appeared:
   `arm-none-eabi-objcopy: '/home/fiaj/nuttxspace/hellocpp/build/hellocpp.elf': No such file`
   
   I don't know why hellocpp.elf is generated inside src folder, but after copying from src to build folder I have the following result:
   
   ```
   [ 33%] Linking CXX executable hellocpp
   [100%] Built target hellocpp
   ```
   
   The final result at build folder:
   ```
   /nuttxspace/hellocpp/build$ ls
   CMakeCache.txt  CMakeFiles  cmake_install.cmake  hellocpp.bin  hellocpp.elf  Makefile  src
   
   ```


-- 
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-unsubscribe@nuttx.apache.org

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