Patrick Dupre writes:
1 warning generated.
/usr/bin/ld: /tmp/test-52cb2b.o: in function `main':
test.c:(.text+0x1b): undefined reference to `CMPLX'
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
Since the compiler produces a .o but the linker fails, either 'CMPLX'
is a typo, or it's a macro. So ... in my <complex.h> I have this:
#if defined __USE_ISOC11 && __GNUC_PREREQ (4, 7)
/* Macros to expand into expression of specified complex type. */
# define CMPLX(x, y) __builtin_complex ((double) (x), (double) (y))
# define CMPLXF(x, y) __builtin_complex ((float) (x), (float) (y))
# define CMPLXL(x, y) __builtin_complex ((long double) (x), (long double) (y))
#endif
which looks awf'ly GNU-specific.