My application was compiling fine on XCode 8.3, but does not compile on XCode 9. The error I am getting is "declaration conflicts with target of using declaration already in scope" related to the following header file /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:719:46: note: target of using declaration.
What I have finally narrowed it down to is XCode 8.3 did not have math.h at the above location. The math.h in this location has LLVM information in the header. In 8.3 it is finding math.h here: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/math.h, which has Apple copywrite information. The two header files are very different. XCode 9 has headers in both locations with the Apple one being in MacOSX10.13.sdk/usr/include/math.h.
I am specifying -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk which should set the system include path. However looking at opensnoop on both 8.3 and 9.0 it is always looking for math.h in the Toolchains (/Applications/Xcode.app/Contents/Developer/Toolchains/...) directory first. I have read the documentation on the include search path and still am not clear what is giving the Toolchains directory priority.
So now for my question:
Should the toolchains directory have priority over the system include path? If not, how can I fix it?
Thank you,
Kris Berg