Catalina C++: Using headers yield error: no member named 'signbit' in the global namespace

前端 未结 11 941
不思量自难忘°
不思量自难忘° 2020-11-30 06:36

After upgrading to Catalina from Mojave, Setuping: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk in the env.

I\

11条回答
  •  甜味超标
    2020-11-30 06:59

    @mkl 's solution helps to fix the similar issue on my side. Thanks.

    Issue and solution on my side

    I got the same issue to compile a project on basis of PCL. The solution is to set CommandLineTools SDK CMAKE_OSX_SYSROOT.

    I tried @mkl's solution to do it in CMakeLists.txt, it doesn't work. So that I can only set it by cmake .. -DCMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk"

    Another thing to mention: there are two versions of command line SDKs 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.

    Discussion of the similar issue in PCL's repo: https://github.com/PointCloudLibrary/pcl/issues/2601#issuecomment-621889211

    Difference between SDKs

    I don't know much about cmake and SDKs in c++. The difference I noticed in cmake building log from different SDKs as following:

    /Library/Developer/CommandLineTools/SDKs/MacOSX:

    -- Found OpenGL: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework
    

    /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk

    -- Found OpenGL: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework
    

    On default:

    -- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework
    

    Seems like the issue happens on SDK choice for Opengl.

    How to do it in CMakeLists.txt?

    Appreciated it if anyone could advice.

提交回复
热议问题