Hi all,
I have a project in which I am using gengetopt to parse the command line arguments.
From this project I create an executable and a library to be added to a mac os x application that I am developing.
It happens that the definition of 'struct option’ in the ggo.c file generated is conflicting with the mac os x sdk since the sdk has the getopt.h that also defines 'struct option’
Bellow you can see the errors:
/Users/joaosantinha/CODE/pk/pk/build/test_joao/BinarizeImageProp3/pkBinarizeImage_ggo.c:504:8: Redefinition of 'option'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/getopt.h:54:8: Previous definition is here
/Users/joaosantinha/CODE/pk/pk/build/test_joao/BinarizeImageProp3/pkBinarizeImage_ggo.c:789:40: Definition of 'struct option' must be imported from module 'Darwin.getopt' before it is required
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/getopt.h:54:8: Previous definition is here
Do you know any solution to this issue?
I am not sure if this would solve it but I notice that the ‘struct getopt_data’ was changed to ’struct custom_getopt_data’. Would it be possible to do the same for the ‘struct option” so it would be possible to import and use gengetopt in an application created with a mac os x sdk?
If needed I can create a simplified version of all the code and share it.
Best regards,
Joao