jcursiolf edited a comment on issue #5530:
URL: 
https://github.com/apache/incubator-nuttx/issues/5530#issuecomment-1045143012


   Now to the next error:
   
   ```sh
   In file included from 
/path/to/hellocpp/nuttx-export-10.2.0/include/libcxx/cstddef:44,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/libcxx/initializer_list:46,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/libcxx/algorithm:649,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/libcxx/__string:57,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/libcxx/string_view:179,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/libcxx/string:511,
                    from /path/to/hellocpp/src/HelloWorld.cpp:4:
   /usr/lib/gcc/arm-none-eabi/9.2.1/include/stddef.h:426:3: error: conflicting 
declaration 'typedef struct max_align_t max_align_t'
     426 | } max_align_t;
         |   ^~~~~~~~~~~
   In file included from 
/path/to/hellocpp/nuttx-export-10.2.0/include/string.h:30,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/strings.h:30,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/sched.h:33,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/nuttx/sched.h:33,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/stdio.h:35,
                    from 
/path/to/hellocpp/nuttx-export-10.2.0/include/libcxx/cstdio:99,
                    from /path/to/hellocpp/src/HelloWorld.cpp:3:
   /path/to/hellocpp/nuttx-export-10.2.0/include/stddef.h:83:3: note: previous 
declaration as 'typedef struct max_align_t max_align_t'
      83 | } max_align_t;
         |   ^~~~~~~~~~~
   ```
   The `error: conflicting declaration 'typedef struct max_align_t 
max_align_t'` appears to come from _/include/libxx/cstddef_ lines 43-45:
   ```cpp
   // Don't include our own <stddef.h>; we don't want to declare ::nullptr_t.
   #include_next <stddef.h>
   #include <__nullptr>
   ```
   
   The `#include_next` causes the compiler to use its own _stddef.h_ instead of 
NuttX's while _/include/strings.h_. Changing line 44 to `#include <stddef.h>` 
fixes this specific error. Still, as this comes from an external lib, I once 
again do not believe that this is the most correct approach. Any advice in how 
to update the guide is helpful.
   
   Onto the next....
   
   ```sh
   make
   Scanning dependencies of target hellocpp
   [ 33%] Building CXX object src/CMakeFiles/hellocpp.dir/HelloWorld.cpp.obj
   [ 66%] Building CXX object src/CMakeFiles/hellocpp.dir/main.cpp.obj
   [100%] Linking CXX executable hellocpp
   /usr/bin/arm-none-eabi-ld: cannot find -lsupc++
   make[2]: *** [src/CMakeFiles/hellocpp.dir/build.make:99: src/hellocpp] Error 
1
   make[1]: *** [CMakeFiles/Makefile2:94: src/CMakeFiles/hellocpp.dir/all] 
Error 2
   make: *** [Makefile:84: all] Error 2
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to