In reply to cgales:
May be I did not explain the question well. The header is there and the implementation is working fine when I give the static size to the array arguments. The problem arises when the import declaration has dynamic array argument.
The argument that is passed to the DPI is defined to be of a certain size prior to calling the DPI. This seems not OK to the tool and hence the segmentation fault.
How to approach this scenario where the size of the array argument is known only during run-time? The DPI implementation in C has pointer argument. sth like:
void my_function(int *arr).