aviralgarg05 commented on PR #18374:
URL: https://github.com/apache/nuttx/pull/18374#issuecomment-3957382647

   - The originally reported failure (`std::abs/std::acos/...` not declared 
from `<math.h>`) is no longer present after this patch.
   - The build still stops later in my local macOS simulator-host setup due to 
a different, unrelated header/type conflict (`div_t`, `ldiv_t`, `putenv`, 
`dev_t`, `mode_t`) between Darwin and NuttX libc declarations.
   
   ### Full log (before patch)
   
   ```text
   CXX:  cxxtest_main.cxx 
   g++-15 -c "-g" -fomit-frame-pointer -fprofile-arcs -ftest-coverage 
-fno-inline -fno-common -fvisibility=hidden -ffunction-sections -fdata-sections 
-Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas -std="gnu++17" 
-fno-exceptions -fcheck-new -fno-rtti -fno-pic -isystem 
/Users/aviralgarg/Everything/nuttx/include/cxx -isystem 
/Users/aviralgarg/Everything/nuttx/include -D__NuttX__ -DNDEBUG -U_AIX -U_WIN32 
-U__APPLE__ -U__FreeBSD__ -U__NetBSD__ -U__linux__ -U__sun__ -U__unix__ 
-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__  -I 
"/Users/aviralgarg/Everything/apps/include"  -Dmain=cxxtest_main  
cxxtest_main.cxx -o  
cxxtest_main.cxx.Users.aviralgarg.Everything.apps.testing.cxx.cxxtest.o
   In file included from cxxtest_main.cxx:11:
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:38:12: error: 'abs' 
has not been declared in 'std'
      38 | using std::abs;
         |            ^~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:39:12: error: 'acos' 
has not been declared in 'std'
      39 | using std::acos;
         |            ^~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:40:12: error: 'asin' 
has not been declared in 'std'
      40 | using std::asin;
         |            ^~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:41:12: error: 'atan' 
has not been declared in 'std'
      41 | using std::atan;
         |            ^~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:42:12: error: 'atan2' 
has not been declared in 'std'
      42 | using std::atan2;
         |            ^~~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:43:12: error: 'cos' 
has not been declared in 'std'
      43 | using std::cos;
         |            ^~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:44:12: error: 'sin' 
has not been declared in 'std'
      44 | using std::sin;
         |            ^~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:45:12: error: 'tan' 
has not been declared in 'std'
      45 | using std::tan;
         |            ^~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:46:12: error: 'cosh' 
has not been declared in 'std'
      46 | using std::cosh;
         |            ^~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:47:12: error: 'sinh' 
has not been declared in 'std'
      47 | using std::sinh;
         |            ^~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:48:12: error: 'tanh' 
has not been declared in 'std'
      48 | using std::tanh;
         |            ^~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:49:12: error: 'exp' 
has not been declared in 'std'
      49 | using std::exp;
         |            ^~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:50:12: error: 'frexp' 
has not been declared in 'std'
      50 | using std::frexp;
         |            ^~~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:51:12: error: 'ldexp' 
has not been declared in 'std'
      51 | using std::ldexp;
         |            ^~~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:52:12: error: 'log' 
has not been declared in 'std'
      52 | using std::log;
         |            ^~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:53:12: error: 'log10' 
has not been declared in 'std'
      53 | using std::log10;
         |            ^~~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:54:12: error: 'modf' 
has not been declared in 'std'
      54 | using std::modf;
         |            ^~~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:55:12: error: 'pow' 
has not been declared in 'std'
      55 | using std::pow;
         |            ^~~
   /opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:56:12: error: 'sqrt' 
has not been declared in 'std'
      56 | using std::sqrt;
         |            ^~~~
   ... (full log omitted here for brevity when pasted, but attach the raw file 
content)
   make: *** 
[cxxtest_main.cxx.Users.aviralgarg.Everything.apps.testing.cxx.cxxtest.o] Error 
1
   ```
   
   ### Full log (after patch)
   
   ```text
   CXX:  cxxtest_main.cxx 
   g++-15 -c "-g" -fomit-frame-pointer -fprofile-arcs -ftest-coverage 
-fno-inline -fno-common -fvisibility=hidden -ffunction-sections -fdata-sections 
-Wall -Wshadow -Wundef -Wno-attributes -Wno-unknown-pragmas -std="gnu++17" 
-fno-exceptions -fcheck-new -fno-rtti -fno-pic -isystem 
/Users/aviralgarg/Everything/nuttx/include/cxx -isystem 
/Users/aviralgarg/Everything/nuttx/include -D__NuttX__ -DNDEBUG -U_AIX -U_WIN32 
-U__APPLE__ -U__FreeBSD__ -U__NetBSD__ -U__linux__ -U__sun__ -U__unix__ 
-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__  -I 
"/Users/aviralgarg/Everything/apps/include"  -Dmain=cxxtest_main  
cxxtest_main.cxx -o  
cxxtest_main.cxx.Users.aviralgarg.Everything.apps.testing.cxx.cxxtest.o
   In file included from 
/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/stdlib.h:58,
                    from 
/opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/bits/std_abs.h:44,
                    from 
/opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/cmath:59,
                    from 
/Users/aviralgarg/Everything/nuttx/include/cxx/cmath:38,
                    from 
/opt/homebrew/Cellar/gcc/15.2.0/include/c++/15/math.h:36,
                    from cxxtest_main.cxx:11:
   
/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/_stdlib.h:105:3:
 error: conflicting declaration 'typedef struct div_t div_t'
     105 | } div_t;
         |   ^~~~~
   ... (remaining Darwin/NuttX type conflicts)
   make: *** 
[cxxtest_main.cxx.Users.aviralgarg.Everything.apps.testing.cxx.cxxtest.o] Error 
1
   ```
   


-- 
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