Do you have this in your boards/Make.defs: ARCHCXXFLAGS += -D__NuttX__ -nostdinc++ Since there are many complex setting to make C++ library work on NuttX, but this setting spread in different Make.defs, I plan to enhance the experience in the next couple weeks(actually, all is done in our internal development branch): 1.Centralize the setting to arch/Toolchain.defs, so all boards will support libc++/uClibc++ automatically. 2.Upgrade to the latest uClibc++(already upstream) and libc++ without the special NuttX hack 3.Modify Makefile to automatically download the package from the official release(uClibc++ already upstream) 4.Enable all deconfig related to uClibc++/libc++ in the daily build system
> -----Original Message----- > From: Matt DeWall <mdew...@gmail.com> > Sent: Wednesday, August 12, 2020 10:53 AM > To: dev@nuttx.apache.org > Subject: cpp cxx help - No thread API > > Hi devs! I'm getting started on NuttX and love the project. Looking to port > my cpp project to NuttX. > > I'm having trouble compiling the CPP version of the hello world using the > existing documentation. I'm able to build nuttx just fine and > flash my device using the C version of Hello World. > > The error during CXX building is "No thread API" > > > *Background:* > > I'm following the (latest?) directions here: > > https://github.com/apache/incubator-nuttx/ > > I made my own docker image based on this Dockerfile which I understand nuttx > is using for some part of ci/cid/testing: > > https://github.com/apache/incubator-nuttx-testing/blob/master/docker/linux/Dockerfile > > Running the following commands: > > git clone https://github.com/apache/incubator-nuttx.git nuttx git clone > https://github.com/apache/incubator-nuttx-apps.git apps > > Then I configure for my own board (stm32f103rbt6) ./configure.sh > nucleo-f103rb/nsh > > After "make menuconfig" and configuring the C hello world app, I'm able to > build and flash my board and run "hello" just fine. > > This leads me to believe my toolchain is good to go. > > > *Installing libcxx:* > > So moving on the c++ docs found here: > https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=139629545 > but they may be outdated? > > Running: > > git clone https://bitbucket.org/acassis/libcxx > cd libcxx > ./install /nuttx/nuttx > > "Installing LLVM/libcxx in the NuttX source treeInstallation succeeded" > > I skipped the other two lines in that guide because they seem to clone a > different and older nuttx clone from Alan's repo. > > > *Trying to implement c++:* > > Going over to make menuconfig and enabling the following options (and > whatever comes with them) > > Libary Routines->Have C++ Compiler > > Libary Routines->Build LLVM libc++ > > Applications->Hello World C++ example > > When I go to build I get a "No thread API"... > > make[2]: Entering directory '/nuttx/apps/examples/helloxx'In file included > from /nuttx/nuttx/include/libcxx/cstdio:99,from > ./helloxx_main.cxx:42:/nuttx/nuttx/include/libcxx/__config:845:4: error: > #error "No thread API"845 | # error "No thread API" > > I've only seen a 3 year old post where some person was using their own > toolchain, so I'm not clear on how to proceed. > > I think I need to include some extra things in my Make.defs but I'm usually > working at a higher layer, I'm a medium-level linux person > and have next to zero experience developing c/c++ apps on linux, but I"ve > written plenty of apps on Windows. > > Really appreciate any help or insight you can provide, thanks! > > Matt