[mcstas-users] question about array-lib.c and .h
Santiago Gómez
sgomez at cab.cnea.gov.ar
Thu Mar 12 18:44:40 CET 2020
Hello, when I compile the example instrument templateSANS.instr with
mcstas 2.6 and gcc 4.4.7 I get this issue
PSD_monitor.comp:76: error: redefinition of typedef 'DArray1d'
PSD_monitor.comp:60: note: previous declaration of 'DArray1d' was here
PSD_monitor.comp:77: error: redefinition of typedef 'DArray2d'
PSD_monitor.comp:64: note: previous declaration of 'DArray2d' was here
PSD_monitor.comp:78: error: redefinition of typedef 'DArray3d'
PSD_monitor.comp:68: note: previous declaration of 'DArray3d' was here
This example compiles well with other gcc compiler (version 4.8.3).
I see at the mcstas pre-compiled file templateSANS.c that the next
typedef definitions appear twice, so this is the redefinition error for
compiler gcc 4.4.7.
typedef double* DArray1d;
typedef double** DArray2d;
typedef double*** DArray3d;
I simply commented those typedef definitions at array-lib. c, because
they are already present in the array-lib. h, and it works ok, at least
I have checked the output values from both compilers and the match ok.
Should I check other things to keep this solution to use compiler 4.4.7?
(this compiler is in a cluster and it is difficult to change version)
With best regards,
Santiago
--
Santiago Miguel Gómez
Departamento de Física de Reactores y Radiaciones
Centro Atómico Bariloche
Int.: 5971
"Si queremos un mundo de paz y de justicia hay que poner decididamente
la inteligencia al servicio del amor." Antoine de Saint-Exupery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20200312/b24cb9ee/attachment.html>
More information about the mcstas-users
mailing list