Hello,
I can compile this code with gcc (-lm)
but not with clang
test.c:8:22: warning: implicit declaration of function 'CMPLX' is invalid in C99
[-Wimplicit-function-declaration]
double complex z = CMPLX (1., 2.) ;
^
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)
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <complex.h>
int main () {
double complex z = CMPLX (1., 2.) ;
}
I could not find any option of clang which let me compile it without this error.
===========================================================================
Patrick DUPRÉ | | email: pdupre(a)gmx.com
Laboratoire interdisciplinaire Carnot de Bourgogne
9 Avenue Alain Savary, BP 47870, 21078 DIJON Cedex FRANCE
Tel: +33 (0)380395988 | | Room# D114A
===========================================================================
Show replies by date