xsimd icon indicating copy to clipboard operation
xsimd copied to clipboard

problem compiling in Xcode ('C' does not refer to a value)

Open pzoltowski opened this issue 5 years ago • 2 comments

I tried to integrate xsimd with xcode project but I get the following 2 errors in xsimd_scalar.hpp

namespace detail
{
    template <class C>
    inline C sign_complex_scalar_impl(const C& v)
    {
        using value_type = typename C::value_type;
        if (v.real())
        {
            return C(sign(v.real()), value_type(0));      //<---- 'C' does not refer to a value; Too many arguments provided to function-like macro invocation
        }
        else
        {
            return C(sign(v.imag()), value_type(0));    //<---- 'C' does not refer to a value; Too many arguments provided to function-like macro invocation
        }
    }
}

In project settings I used C++14 as C++ Language Dialect ([-std=c++14]). I tried c++17 as well with the same result. I'm using MacOS 10.14.4 (Mojave) with clang:

clang --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
pzomacbook:build patryk$

I did manage to compile using cmake and install without error just cannot compile with Xcode. Are there any other macros or settings that have to be added?

pzoltowski avatar May 16 '19 12:05 pzoltowski

@pzoltowski does your project or one of its dependencies define a macro called C?

SylvainCorlay avatar May 18 '19 10:05 SylvainCorlay

It looks like it would be the case, in which case it would not be related to xsimd.

SylvainCorlay avatar May 18 '19 10:05 SylvainCorlay

No update from OP since 2019 and we significantly updated the code base and we validate on OSX through github CI without noticing this problem => closing.

serge-sans-paille avatar Apr 26 '23 05:04 serge-sans-paille