Pcl: Mojave Xcode 10.1; pcl 1.8 make: cmath: no member named isinf

Created on 7 Nov 2018  Β·  48Comments  Β·  Source: PointCloudLibrary/pcl

Hi,

I want to build and install PCL 1.8 on MacOS Mojave with Xcode 10.1.

The cmake configuration is done. But make tells me this:

In file included from /usr/local/include/boost/type_traits.hpp:93:
In file included from /usr/local/include/boost/type_traits/is_complex.hpp:12:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/complex:246:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:313:9: error: 
      no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:314:9: error: 
      no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: error: 
      no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/math.h:749:12: note: 
      'finite' declared here
extern int finite(double)
           ^
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/src/point_types.cpp:37:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/point_types.h:44:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/register_point_struct.h:65:
In file included from /usr/local/include/boost/type_traits.hpp:93:
In file included from /usr/local/include/boost/type_traits/is_complex.hpp:12:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/complex:246:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:316:9: error: 
      no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:317:9: error: 
      no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:318:9: error: 
      no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:319:7: error: 
      no member named 'isgreater' in the global namespace; did you mean
      '::std::greater'?
using ::isgreater;
      ^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:720:29: note: 
      '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
                            ^
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/src/point_types.cpp:37:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/point_types.h:44:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/register_point_struct.h:65:
In file included from /usr/local/include/boost/type_traits.hpp:93:
In file included from /usr/local/include/boost/type_traits/is_complex.hpp:12:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/complex:246:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:320:7: error: 
      no member named 'isgreaterequal' in the global namespace; did you mean
      '::std::greater_equal'?
using ::isgreaterequal;
      ^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/functional:749:29: note: 
      '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
                            ^
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/src/point_types.cpp:37:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/point_types.h:44:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/register_point_struct.h:65:
In file included from /usr/local/include/boost/type_traits.hpp:93:
In file included from /usr/local/include/boost/type_traits/is_complex.hpp:12:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/complex:246:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:321:9: error: 
      no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:322:9: error: 
      no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:323:9: error: 
      no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:324:9: error: 
      no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:325:9: error: 
      no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/src/point_types.cpp:37:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/point_types.h:344:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/impl/point_types.hpp:46:
In file included from /opt/local/include/eigen3/Eigen/Core:352:
/opt/local/include/eigen3/Eigen/src/Core/MathFunctions.h:736:16: error: no
      member named 'isfinite' in namespace 'std'; did you mean 'finite'?
    using std::isfinite;
          ~~~~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cmath:315:9: note: 
      'finite' declared here
using ::isfinite;
        ^
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/src/point_types.cpp:37:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/point_types.h:344:
In file included from /Users/yuminsun/software/pcl-pcl-1.8.1/common/include/pcl/impl/point_types.hpp:46:
In file included from /opt/local/include/eigen3/Eigen/Core:352:
/opt/local/include/eigen3/Eigen/src/Core/MathFunctions.h:751:16: error: no
      member named 'isinf' in namespace 'std'
    using std::isinf;
          ~~~~~^
/opt/local/include/eigen3/Eigen/src/Core/MathFunctions.h:766:16: error: no
      member named 'isnan' in namespace 'std'
    using std::isnan;
          ~~~~~^
16 errors generated.
make[2]: *** [common/CMakeFiles/pcl_common.dir/src/point_types.cpp.o] Error 1
make[1]: *** [common/CMakeFiles/pcl_common.dir/all] Error 2
make: *** [all] Error 2

How could I solve this? Thank you.

macos

Most helpful comment

I encounter this problem too.

Problem

The system uses a wrong toolchain path.

The ysystem should uses "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/..." rather than
"/Library/Developer/CommandLineTools/usr/bin/..."

Solution

Here is the simple solution:

Simply reset the default command line tools path.

sudo xcode-select -r

Using the following command to check the path

clang++ -v

#output will be something like this
# Apple clang version 11.0.0 (clang-1100.0.33.12)
# Target: x86_64-apple-darwin19.0.0
# Thread model: posix
# InstalledDir: 
# /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

All 48 comments

This feels like something external to pcl. The errors are coming from third party headers we include.

We just released 1.9.0 yesterday and I can ensure you it compiles on OS X using make. So it might be worth to just give it a try.

1.9 also does not work on my Mac. I don't think this is external, because all dependencies I installed run successful on other projects. This error only comes when I build pcl-projects.

I upload my cmake and make log information here. Please help.

log.txt

Compared to my setup, the only major difference I see is that I have AppleClang 10.0.0.10001044 and you have AppleClang 10.0.0.10001145. I'm not sure if the stdc++ library the new command line tools shipped changed something.

I just noticed this in your log. It is weird and I'm not really sure what is going on. Multiple installations?

-- Checking for module 'eigen3'
--   Found eigen3, version 3.3.5
-- Found Eigen: /opt/local/include/eigen3  
-- Eigen found (include: /opt/local/include/eigen3, version: 3.3.4)

Other than that we have the same libraries and versions.

It seems like Mojave toolchain update should be responsible for this issue. But I have no idea how to solve this.

@claudiofantacci Are you by any chance on Mojave already?

I fix the build from 0% to now 69% by install vtk8. The update of Mojave causes the old vtk not compatible anymore.

Now the problem is generated from similar issue of uuid random generator

I have Boost 1.67, the newst version is 1.68.

I don't think install 1.68 will help, because according to the answers from issue 2284 and 2338, it seems like it is a OS raleted problem because the random generator use (whatever) OS stuff. Now OS is updated, I think PCL should take care this issue now.

In file included from /Users/MYPC/software/pcl-pcl-1.8.1/outofcore/tools/outofcore_process.cpp:53:
In file included from /Users/MYPC/software/pcl-pcl-1.8.1/outofcore/include/pcl/outofcore/outofcore_impl.h:50:
/Users/MYPC/software/pcl-pcl-1.8.1/outofcore/include/pcl/outofcore/impl/octree_disk_container.hpp:77:74: error: 
      no matching constructor for initialization of
      'boost::uuids::random_generator' (aka
      'boost::uuids::random_generator_pure')
  ...OutofcoreOctreeDiskContainer<PointT>::uuid_gen_ (&rand_gen_);
                                           ^          ~~~~~~~~~~
/usr/local/include/boost/uuid/random_generator.hpp:149:7: note: candidate
      constructor (the implicit copy constructor) not viable: no known
      conversion from 'boost::mt19937 *' (aka 'mersenne_twister_engine<unsigned
      int, 32, 624, 397, 31, 2567483615U, 11, 4294967295U, 7, 2636928640U, 15,
      4022730752U, 18, 1812433253> *') to 'const
      boost::uuids::random_generator_pure' for 1st argument
class random_generator_pure
      ^
/usr/local/include/boost/uuid/random_generator.hpp:149:7: note: candidate
      constructor (the implicit default constructor) not viable: requires 0
      arguments, but 1 was provided
1 error generated.
make[2]: *** [outofcore/tools/CMakeFiles/pcl_outofcore_process.dir/outofcore_process.cpp.o] Error 1
make[1]: *** [outofcore/tools/CMakeFiles/pcl_outofcore_process.dir/all] Error 2
make: *** [all] Error 2

@waschbaer00 please be considerate to others and don't post the same issue to three different threads. One is enough!

@waschbaer00 please be considerate to others and don't post the same issue to three different threads. One is enough!

You mean keep posting on similar issue rather open a new one? Ok, I see. Sorry.

Well you should decide what's more appropriate. Sometimes you bump into a problem and there is already an issue that describes precisely this problem. Then it makes sense to post there. Sometimes you bump into a problem that is related, but not exactly the same. Then it makes sense to create a new issue (and include a reference to the related one). But there is really no need to post to two different existing threads and open a new issue at the same time. Me and other ~400 people who watch this repository received 3 emails with the same content.

@claudiofantacci Are you by any chance on Mojave already?

Not yet! (Until CUDA will support it, I can't update.)
I'm not able to test this issue 😞

Above problems fixed by install the most recent version pcl 1.9 and vtk8.

(Though tons of warnings from visualization module about virtual functions.)

Thanks for checking and reporting back the results.

(Though tons of warnings from visualization module about virtual functions.)

No worries. We should be fixing those once before the next release.

Above problems fixed by install the most recent version pcl 1.9 and vtk8.

(Though tons of warnings from visualization module about virtual functions.)

I also encountered this problem, but it was not solved after upgrading to PCL 1.9.1. Could you give me some Suggestions?

I have the same problem and using PCL 1.91 and vtk8 did not help!

I said I updated VTK to version 8

I am already using vtk version 8:
screenshot 2018-12-19 at 09 59 38

Install vtk master and pcl master which fixed the issue for me. vtk 8.1.2 + pcl 9.1.2 were not working for me.

I also encountered this problem, but it was not solved after upgrading to PCL 1.9.1; Upgrading to vtk 8 didn't solve the problem either .. any news on this subject maybe ?

Did you install pcl from homebrew?

yes, and it was working before on 1.8 (I recently moved to Mojave, too)

I probably mixed up the version numbers in the latest comment, but just try to compile master (using brew --HEAD)

Alright, I will try that. Will pcl --HEAD install vtk --HEAD automatically or should I need to update VTK too?

I guess you'll need to install vtk with --HEAD separately

ok I think vtk --HEAD was the actual culprit.
Below the exact versions I have on my machine and that work, so that other people having this error might compare :

$ brew info vtk pcl
vtk: stable 8.1.2 (bottled), HEAD
Toolkit for 3D computer graphics, image processing, and visualization
https://www.vtk.org/
/usr/local/Cellar/vtk/HEAD-7d834f2_2 (4,054 files, 134.3MB) *
  Built from source on 2019-01-23 at 10:53:00
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/vtk.rb
==> Dependencies
Build: cmake βœ”
Required: boost βœ”, fontconfig βœ”, hdf5 βœ”, jpeg βœ”, libpng βœ”, libtiff βœ”, netcdf βœ”, pyqt βœ”, python βœ”, qt βœ”
==> Options
--HEAD
    Install HEAD version

pcl: stable 1.9.1 (bottled), HEAD
Library for 2D/3D image and point cloud processing
http://www.pointclouds.org/
/usr/local/Cellar/pcl/1.9.1_1 (1,173 files, 149MB) *
  Poured from bottle on 2019-01-23 at 11:28:01
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pcl.rb
==> Dependencies
Build: cmake βœ”, pkg-config βœ”
Required: boost βœ”, cminpack βœ”, eigen βœ”, flann βœ”, glew βœ”, libusb βœ”, qhull βœ”, vtk βœ”
==> Options
--HEAD
    Install HEAD version

Thanks @stsundermann

I ran into the exact same problem now on Mac OS X 10.14.4 with XCode 10.2.
I installed the versions of pcl and vtk through homebrew as suggested by @tchapi (pcl 1.9.1 and vtk 8.1.2), but I am getting the exact same errors as @waschbaer00...

Anybody ran into the same kinds of problems and have any further suggestions?

vtk: stable 8.1.2 (bottled), HEAD
Toolkit for 3D computer graphics, image processing, and visualization
https://www.vtk.org/
/usr/local/Cellar/vtk/8.1.2_3 (3,526 files, 121.6MB) *
  Poured from bottle on 2019-04-14 at 22:03:49
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/vtk.rb
==> Dependencies
Build: cmake βœ”
Required: boost βœ”, fontconfig βœ”, hdf5 βœ”, jpeg βœ”, libpng βœ”, libtiff βœ”, netcdf βœ”, pyqt βœ”, python βœ”, qt βœ”
pcl: stable 1.9.1 (bottled), HEAD
Library for 2D/3D image and point cloud processing
http://www.pointclouds.org/
/usr/local/Cellar/pcl/1.9.1_3.reinstall (1,173 files, 149.9MB) *
  Poured from bottle on 2019-04-14 at 22:05:27
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/pcl.rb
==> Dependencies
Build: cmake βœ”, pkg-config βœ”
Required: boost βœ”, cminpack βœ”, eigen βœ”, flann βœ”, glew βœ”, libusb βœ”, qhull βœ”, vtk βœ”
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:96:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/complex:246:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:313:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:314:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/math.h:749:12: note: 'finite' declared here
extern int finite(double)
           ^
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/main.cpp:1:
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/../include/main.h:7:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:96:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/complex:246:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:316:9: error: no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:317:9: error: no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:318:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:319:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
      ^~
/Library/Developer/CommandLineTools/usr/include/c++/v1/functional:720:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
                            ^
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/main.cpp:1:
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/../include/main.h:7:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:96:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/complex:246:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:320:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
      ^~
/Library/Developer/CommandLineTools/usr/include/c++/v1/functional:749:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
                            ^
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/main.cpp:1:
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/../include/main.h:7:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:96:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/complex:246:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:321:9: error: no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:322:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:323:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:324:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:325:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/main.cpp:1:
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/../include/main.h:7:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:371:
/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:719:16: error: no member named 'isfinite' in namespace 'std'; did you mean 'finite'?
    using std::isfinite;
          ~~~~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cmath:315:9: note: 'finite' declared here
using ::isfinite;
        ^
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/main.cpp:1:
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/../include/main.h:7:
In file included from /usr/local/include/eigen3/Eigen/Dense:1:
In file included from /usr/local/include/eigen3/Eigen/Core:371:
/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:734:16: error: no member named 'isinf' in namespace 'std'
    using std::isinf;
          ~~~~~^
/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:749:16: error: no member named 'isnan' in namespace 'std'
    using std::isnan;
          ~~~~~^
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/main.cpp:1:
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/../include/main.h:11:
In file included from /usr/local/include/libpcutil/pcvisualizer:1:
In file included from /usr/local/include/libpcutil/pcvisualizer.h:8:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/pcl_visualizer.h:48:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/common/actor_map.h:40:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/point_cloud_handlers.h:41:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/point_cloud_geometry_handlers.h:50:
In file included from /usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkFloatArray.h:29:
In file included from /usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkAOSDataArrayTemplate.h:35:
In file included from /usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkGenericDataArray.h:72:
/usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h:40:13: error: expected member name or ';' after declaration specifiers
static bool isnan(T x)
~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/math.h:165:7: note: expanded from macro 'isnan'
    ( sizeof(x) == sizeof(float)  ? __inline_isnanf((float)(x))          \
      ^
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/main.cpp:1:
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/../include/main.h:11:
In file included from /usr/local/include/libpcutil/pcvisualizer:1:
In file included from /usr/local/include/libpcutil/pcvisualizer.h:8:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/pcl_visualizer.h:48:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/common/actor_map.h:40:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/point_cloud_handlers.h:41:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/point_cloud_geometry_handlers.h:50:
In file included from /usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkFloatArray.h:29:
In file included from /usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkAOSDataArrayTemplate.h:35:
In file included from /usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkGenericDataArray.h:72:
/usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h:40:13: error: expected ')'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/math.h:165:7: note: expanded from macro 'isnan'
    ( sizeof(x) == sizeof(float)  ? __inline_isnanf((float)(x))          \
      ^
/usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h:40:13: note: to match this '('
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/math.h:165:5: note: expanded from macro 'isnan'
    ( sizeof(x) == sizeof(float)  ? __inline_isnanf((float)(x))          \
    ^
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/main.cpp:1:
In file included from /Users/Matthias/Workspaces/CLion/PointCloudEdgeDetector2/src/../include/main.h:11:
In file included from /usr/local/include/libpcutil/pcvisualizer:1:
In file included from /usr/local/include/libpcutil/pcvisualizer.h:8:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/pcl_visualizer.h:48:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/common/actor_map.h:40:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/point_cloud_handlers.h:41:
In file included from /usr/local/include/pcl-1.9/pcl/visualization/point_cloud_geometry_handlers.h:50:
In file included from /usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkFloatArray.h:29:
In file included from /usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkAOSDataArrayTemplate.h:35:
In file included from /usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkGenericDataArray.h:72:
/usr/local/Cellar/vtk/8.1.2_3/include/vtk-8.1/vtkGenericDataArrayLookupHelper.h:49:15: error: expected member name or ';' after declaration specifiers
  static bool isnan(T)
  ~~~~~~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/math.h:165:7: note: expanded from macro 'isnan'
    ( sizeof(x) == sizeof(float)  ? __inline_isnanf((float)(x))          \
      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

downgrade xcode command line tool to 9.3 will clear this error. Remove installed command line tool and re-install 'Command_Line_Tools_macOS_10.13_for_Xcode_9.3.dmg'.
If you have full xcode installed, you may need to remove it as well.

I too was having problems but all were cleared after deleting Xcode.app. I have the latest command line tools still installed; so for me it was Xcode.app

Thanks for letting me know that. I think you are right. I will try to
update the command line tool.

On Fri, 26 Apr 2019 at 10:10 AM Wade Sheen notifications@github.com wrote:

I too was having problems but all were cleared after deleting Xcode.app. I
have the latest common line tools still installed; so for me it was
Xcode.app

β€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/PointCloudLibrary/pcl/issues/2601#issuecomment-486889884,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIAK4QFEOKRBEKC76WGYBNTPSJJB5ANCNFSM4GCJZ6SQ
.

Is there no other solution? Does anyone know whats causing this? I'm using Xcode as my IDE, would rather not remove it. I also confirmed the issue has to do with Xcode, however I'm still not closer to solving it without removing Xcode. :(

@klintan Supporting both XCode and the Command Line Tools is definitely the desired solution for the maintainer team, but we need help. Most of our osx contributors are currently stuck at OSX High Sierra and the command line tools 9.0.0 because of CUDA requirements for our work and day time jobs. We have no way of generating the failure conditions and fix them.

There are a bunch of osx users which (like you) which have no such requirements and migrated to up-to-date software, but we haven't been lucky to found anyone proficient enough to help us investigate and fix these issues.

@klintan Supporting both XCode and the Command Line Tools is definitely the desired solution for the maintainer team, but we need help. Most of our osx contributors are currently stuck at OSX High Sierra and the command line tools 9.0.0 because of CUDA requirements for our work and day time jobs. We have no way of generating the failure conditions and fix them.

There are a bunch of osx users which (like you) which have no such requirements and migrated to up-to-date software, but we haven't been lucky to found anyone proficient enough to help us investigate and fix these issues.

Sorry it came off like that, wasn't meant to. I never expect anyone else to implement the solution for me (especially when it comes to open source).

I've spent the last couple of week trying to resolve this any other way. Unfortunately I'm fairly new to C++ so I haven't solved it as stated. This was more out of frustration and a cry for help that maybe someone somewhere has a couple of lines of code that solves this (and hasn't said anything).

My problem is not specifically only with PCL (although it's using PCL as a dependency) rather this is an issue with the latest xcode and the cmath library that comes up in a bunch a places.

I appreciate all the hard work you guys put in to provide a really valuable piece of software for anyone to use for free, and if and when I find the solution, if it's somehting that can be solved in code, I'll have a PR for you :)

In this particular issue, I suspect the problem is being caused at Eigen level, because of messages like this

/usr/local/include/eigen3/Eigen/src/Core/MathFunctions.h:734:16: error: no member named 'isinf' in namespace 'std'
    using std::isinf;

At first glance it could mean that MathFunctions.h is failing to include <cmath>. Maybe std::isinf was being made visible indirectly by another header and not anymore.

I had the exact same issue using Xcode 10.3 with command-line tools installed separately.
I tried compiling with the Xcode.app command line tools as well as the stand-alone ones with no luck.
I uninstalled the Xcode app and everything works well now.

I was able to fix this issue without uninstalling XCode, below are two routes using the CMake GUI:

Option 1:
- when using the cmake GUI, entered the directory that the CMakeList was in into the source code slot, and the CMake folder into the binary slot
- when configured an option to use XCode libraries came up, selected that and configured
- all lines were red, then pressed configure again, turned back to normal and generated
- went back to terminal used make and then the app was generated
- used the command open name.app to view results

Option 2:

  • In CMake GUI select same lines as in above
  • Configure
  • Then change CMAKE_OSX_SYSROOT line to:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
    from its default value of /Library/Developer/CommandLineTools/usr/bin/...
  • Compile and then generated. Ran make and open name.app to view results

I encounter this problem too.

Problem

The system uses a wrong toolchain path.

The ysystem should uses "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/..." rather than
"/Library/Developer/CommandLineTools/usr/bin/..."

Solution

Here is the simple solution:

Simply reset the default command line tools path.

sudo xcode-select -r

Using the following command to check the path

clang++ -v

#output will be something like this
# Apple clang version 11.0.0 (clang-1100.0.33.12)
# Target: x86_64-apple-darwin19.0.0
# Thread model: posix
# InstalledDir: 
# /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Above problems fixed by install the most recent version pcl 1.9 and vtk8.

(Though tons of warnings from visualization module about virtual functions.)

Thanks a ton!

I was having a hard time. i was seeing "some" build problems in one of the node projects after it got some updates. then saw suggestions around removing/reinstalling xcode/command line tools to fix that. I don't know what i did there, but i started seeing these missing member errors for cmath (and some others).

It was probably some configuration I suspect as far as I could tell, but i couldn't have fixed it by myself.

I brew installed pcl and vtk one by one based on this suggestion, and the problem is now fixed.

Hello, I receive the same error again on macOS Catalina. I think Apple has a different setup between "Xcode.app" and "CommandLineTools". Switching them may solve the problem

OS: macos10.15.4
Toolchains: XCode 11.4.1
PCL version: 1.9.1, 1.10.x

My Solution

Solution 1

Change your macOS Xcode SDK to the CommandlineTools can solve the problem on macOS10.15. Noted that this solution is a global change. It may affect other programs or project building setup.

#Check the current sdk
xcrun --show-sdk-path

#Change sdk
sudo xcode-select -s /Library/Developer/CommandLineTools          #Using CommandLineTools SDK
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer   #Using XCode.app SDK

Here is the SDK location for your reference
Location of your SDK:
Xcode: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
Commandline: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk

Solution 2

Change the SYSROOT to Command line Tools rather than Xcode.app on your PCL compilation working directory. This affects your current cmake directory only.

cmake .. -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk"

Error Message

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error:
      no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error:
      no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error:
      no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:749:12: note:
      'finite' declared here
extern int finite(double)
           ^
In file included from <...>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:320:9: error:
      no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:321:9: error:
      no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:322:9: error:
      no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:323:9: error:
      no member named 'isgreater' in the global namespace
using ::isgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:324:9: error:
      no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:325:9: error:
      no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:326:9: error:
      no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:327:9: error:
      no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:328:9: error:
      no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:329:9: error:
      no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:335:9: error:
      no member named 'abs' in the global namespace; did you mean 'fabs'?
using ::abs;
      ~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:417:15: note:
      'fabs' declared here
extern double fabs(double);
              ^
In file included from  <...>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:640:26: error:
      no template named 'numeric_limits'
    bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limit...
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:640:60: error:
      no template named 'numeric_limits'
    bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limit...
                                                           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:18: error:
      no template named 'numeric_limits'
    int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>...
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:50: error:
      no template named 'numeric_limits'
    int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>...
                                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:646:17: error:
      no template named 'numeric_limits'
  static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorre...
                ^

You probably changed the SDK the system uses.
I ran into the same issue after I've installed QGLViewer using Xcode. Seems the installing process called something like this Running "xcode-select --reset". This will make the macOS fallback to use the XCode.app SDK which exactly caused this issue.
Run this command in Terminal: xcrun --show-sdk-path to check the current SDK path. If it outputs something containing "Xcode.app", you're using the "WRONG" SDK if you're not intended to build projects using Xcode.
Simply run this command sudo xcode-select -s /Library/Developer/CommandLineTools will resolve this issue.

Hello, I receive the same error again on macOS Catalina. I think Apple has a different setup between "Xcode.app" and "CommandLineTools". Switching them may solve the problem

OS: macos10.15.4
Toolchains: XCode 11.4.1
PCL version: 1.9.1, 1.10.x

My Solution

Solution 1

Change your macOS Xcode SDK to the CommandlineTools can solve the problem on macOS10.15. Noted that this solution is a global change. It may affect other programs or project building setup.

#Check the current sdk
xcrun --show-sdk-path

#Change sdk
sudo xcode-select -s /Library/Developer/CommandLineTools          #Using CommandLineTools SDK
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer   #Using XCode.app SDK

Here is the SDK location for your reference
Location of your SDK:
Xcode: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
Commandline: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk

Solution 2

Change the SYSROOT to Command line Tools rather than Xcode.app on your PCL compilation working directory. This affects your current cmake directory only.

cmake .. -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk"

Error Message

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error:
      no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error:
      no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error:
      no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:749:12: note:
      'finite' declared here
extern int finite(double)
           ^
In file included from <...>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:320:9: error:
      no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:321:9: error:
      no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:322:9: error:
      no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:323:9: error:
      no member named 'isgreater' in the global namespace
using ::isgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:324:9: error:
      no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:325:9: error:
      no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:326:9: error:
      no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:327:9: error:
      no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:328:9: error:
      no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:329:9: error:
      no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:335:9: error:
      no member named 'abs' in the global namespace; did you mean 'fabs'?
using ::abs;
      ~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:417:15: note:
      'fabs' declared here
extern double fabs(double);
              ^
In file included from  <...>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:640:26: error:
      no template named 'numeric_limits'
    bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limit...
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:640:60: error:
      no template named 'numeric_limits'
    bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limit...
                                                           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:18: error:
      no template named 'numeric_limits'
    int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>...
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:50: error:
      no template named 'numeric_limits'
    int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>...
                                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:646:17: error:
      no template named 'numeric_limits'
  static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorre...
                ^

Solution worked for me.

@langeroo 's solution works for me, thanks.

A bit tricky on my side:
There are two version of command line SDK in my MacOS.

~ Β» /Library/Developer/CommandLineTools/SDKs/MacOSX
/Library/Developer/CommandLineTools/SDKs/MacOSX
MacOSX.sdk/       MacOSX10.14.sdk@

xcrun --show-sdk-path gives out the default one, but actually only MacOSX10.14.sdk works on my side.

@langeroo 's solution works for me, thanks.

A bit tricky on my side:
There are two version of command line SDK in my MacOS.

~ Β» /Library/Developer/CommandLineTools/SDKs/MacOSX
/Library/Developer/CommandLineTools/SDKs/MacOSX
MacOSX.sdk/       MacOSX10.14.sdk@

xcrun --show-sdk-path gives out the default one, but actually only MacOSX10.14.sdk works on my side.

Thanks, both the solution and @birdinforest's extra note helped me out.

I used MacOSX10.15.sdk which also works, but what I did is simply remove /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

Hey guys I have osx Catalina and I pulled the master branch from GitHub and got the same errors. followed this chat to fix it but the issue still persists. any suggestions?

Hey guys I have osx Catalina and I pulled the master branch from GitHub and got the same errors. followed this chat to fix it but the issue still persists. any suggestions?

Do you still have full Xcode installed ? As in if possible/you are using some other IDE did you uninstall it?

I tried the following method. I still have Xcode installed and I use vscode to work and I was building on terminal.

Hello, I receive the same error again on macOS Catalina. I think Apple has a different setup between "Xcode.app" and "CommandLineTools". Switching them may solve the problem
OS: macos10.15.4
Toolchains: XCode 11.4.1
PCL version: 1.9.1, 1.10.x

My Solution

Solution 1

Change your macOS Xcode SDK to the CommandlineTools can solve the problem on macOS10.15. Noted that this solution is a global change. It may affect other programs or project building setup.

#Check the current sdk
xcrun --show-sdk-path

#Change sdk
sudo xcode-select -s /Library/Developer/CommandLineTools          #Using CommandLineTools SDK
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer   #Using XCode.app SDK

Here is the SDK location for your reference
Location of your SDK:
Xcode: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
Commandline: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk

Solution 2

Change the SYSROOT to Command line Tools rather than Xcode.app on your PCL compilation working directory. This affects your current cmake directory only.

cmake .. -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk"

Error Message

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error:
      no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error:
      no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error:
      no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
      ~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:749:12: note:
      'finite' declared here
extern int finite(double)
           ^
In file included from <...>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:320:9: error:
      no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:321:9: error:
      no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:322:9: error:
      no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:323:9: error:
      no member named 'isgreater' in the global namespace
using ::isgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:324:9: error:
      no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:325:9: error:
      no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:326:9: error:
      no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:327:9: error:
      no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:328:9: error:
      no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:329:9: error:
      no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:335:9: error:
      no member named 'abs' in the global namespace; did you mean 'fabs'?
using ::abs;
      ~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:417:15: note:
      'fabs' declared here
extern double fabs(double);
              ^
In file included from  <...>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:640:26: error:
      no template named 'numeric_limits'
    bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limit...
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:640:60: error:
      no template named 'numeric_limits'
    bool _FloatBigger = (numeric_limits<_FloatT>::digits > numeric_limit...
                                                           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:18: error:
      no template named 'numeric_limits'
    int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>...
                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:641:50: error:
      no template named 'numeric_limits'
    int _Bits = (numeric_limits<_IntT>::digits - numeric_limits<_FloatT>...
                                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:646:17: error:
      no template named 'numeric_limits'
  static_assert(numeric_limits<_FloatT>::radix == 2, "FloatT has incorre...
                ^

Solution worked for me.

after trying above-mentioned solutions, I was getting the same errors,
my sdk path is

$xcrun --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk

and I am getting the same errors

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace
using ::signbit;

somehow, the sdk of XCode.app is being used, again

@sonu628

I just compiled pcl-1.11.1 on my mac 10.15.6 and no error is found. I try both make and ninja build system .

My mac shows path /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk when runningxcrun --show-sdk-path command. But MacOSX.sdk is linked to MacOSX10.15.sdkat the same level. I don't think there have a big difference between them.

Maybe you can run the change sdk command again, clear ccache or reboot your system.

sudo xcode-select -s /Library/Developer/CommandLineTools

hey @lesterlo
seems it was the CMake cache that was using Xcode.app links libs, removing build folder and rebuilding clean made it successfully build
thanks for the support

Was this page helpful?
0 / 5 - 0 ratings