Generated ggo.c conflict with getopt.h from mac os x sdk
joao santinha <[email protected]> Fri, 22 Jan 2016 14:54:53 +0100
| Newsgroups | gmane.comp.gnu.gengetopt.general |
|---|---|
| Message-ID | <[email protected]> |
--===============3199250674525476550== Content-Type: multipart/alternative; boundary="Apple-Mail=_3661AAC7-406B-4CDB-8208-6A01BC326BD9" --Apple-Mail=_3661AAC7-406B-4CDB-8208-6A01BC326BD9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi all, I have a project in which I am using gengetopt to parse the command line = arguments. =46rom 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=E2=80=99 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=E2=80=99 Bellow you can see the errors: = /Users/joaosantinha/CODE/pk/pk/build/test_joao/BinarizeImageProp3/pkBinari= zeImage_ggo.c:504:8: Redefinition of 'option' = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Devel= oper/SDKs/MacOSX10.11.sdk/usr/include/getopt.h:54:8: Previous definition = is here = /Users/joaosantinha/CODE/pk/pk/build/test_joao/BinarizeImageProp3/pkBinari= zeImage_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/Devel= oper/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 =E2=80=98struct= getopt_data=E2=80=99 was changed to =E2=80=99struct = custom_getopt_data=E2=80=99. Would it be possible to do the same for the = =E2=80=98struct option=E2=80=9D 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= --Apple-Mail=_3661AAC7-406B-4CDB-8208-6A01BC326BD9 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D""><span style=3D"font-family: HelveticaNeue;" class=3D"">Hi = all,</span><div style=3D"font-family: HelveticaNeue;" class=3D""><br = class=3D""></div><div style=3D"font-family: HelveticaNeue;" class=3D"">I = have a project in which I am using gengetopt to parse the command line = arguments.</div><div style=3D"font-family: HelveticaNeue;" class=3D""><br = class=3D""></div><div style=3D"font-family: HelveticaNeue;" = class=3D"">=46rom this project I create an executable and a library to = be added to a mac os x application that I am developing.</div><div = style=3D"font-family: HelveticaNeue;" class=3D""><br class=3D""></div><div= style=3D"font-family: HelveticaNeue;" class=3D"">It happens that the = definition of 'struct option=E2=80=99 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=E2=80=99</div><div style=3D"font-family: = HelveticaNeue;" class=3D""><br class=3D""></div><div style=3D"font-family:= HelveticaNeue;" class=3D""><div class=3D"">Bellow you can see the = errors:</div><div class=3D""><div = class=3D"">/Users/joaosantinha/CODE/pk/pk/build/test_joao/BinarizeImagePro= p3/pkBinarizeImage_ggo.c:504:8: Redefinition of 'option'</div><div = class=3D"">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.pla= tform/Developer/SDKs/MacOSX10.11.sdk/usr/include/getopt.h:54:8: Previous = definition is here</div><div = class=3D"">/Users/joaosantinha/CODE/pk/pk/build/test_joao/BinarizeImagePro= p3/pkBinarizeImage_ggo.c:789:40: Definition of 'struct option' must be = imported from module 'Darwin.getopt' before it is required</div><div = class=3D"">/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.pla= tform/Developer/SDKs/MacOSX10.11.sdk/usr/include/getopt.h:54:8: Previous = definition is here</div></div></div><div style=3D"font-family: = HelveticaNeue;" class=3D""><br class=3D""></div><div style=3D"font-family:= HelveticaNeue;" class=3D"">Do you know any solution to this = issue?</div><div style=3D"font-family: HelveticaNeue;" class=3D"">I am = not sure if this would solve it but I notice that the =E2=80=98struct = getopt_data=E2=80=99 was changed to =E2=80=99struct = custom_getopt_data=E2=80=99. Would it be possible to do the same for the = =E2=80=98struct option=E2=80=9D so it would be possible to import and = use gengetopt in an application created with a mac os x sdk?</div><div = style=3D"font-family: HelveticaNeue;" class=3D""><br class=3D""></div><div= style=3D"font-family: HelveticaNeue;" class=3D"">If needed I can create = a simplified version of all the code and share it.</div><div = style=3D"font-family: HelveticaNeue;" class=3D""><br class=3D""></div><div= style=3D"font-family: HelveticaNeue;" class=3D"">Best = regards,</div><div style=3D"font-family: HelveticaNeue;" = class=3D"">Joao</div></body></html>= --Apple-Mail=_3661AAC7-406B-4CDB-8208-6A01BC326BD9-- --===============3199250674525476550== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Help-gengetopt mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-gengetopt --===============3199250674525476550==--