Re: gengetopt C example
Tong Sun <[email protected]> Thu, 24 Oct 2013 11:27:15 -0700 (PDT)
| Newsgroups | gmane.comp.gnu.gengetopt.general |
|---|---|
| Message-ID | <[email protected]> |
Thanks for your reply,=A0Lorenzo. > please also file a bug report for gengetopt so that I can keep track of > that. Sure, will do after I go home tonight. Also the "Segmentation fault= " bug that I'll report later. > If I remember correctly, that example generates = a file that expected a > PACKAGE and VERSION passed on the compilation command line, e.g., > = > gcc -DPACKAGE=3D"..." -DVERSION=3D"..." That didn't work, but gcc -DPACK= AGE=3D'"..."' -DVERSION=3D"..." works. > this should be documented in the = manual. OK, here are the things need to be changed: ,----- | From /usr/share/doc/gengetopt/examples/README.example: | = | ... = | = | # commands to try the C example: = | = | gengetopt --input=3Dsample2.ggo --func-name=3Dmy_cmdline_parser = | --file-name=3Dcmdline2 --unamed-opts | gcc -o main2 main2.c cmdline2.c | ./main2 -h | ... = `----- the C example that come with the Debian/Ubuntu package was generated with a different command line: gengetopt --input=3D./sample2= .ggo --func-name=3Dmy_cmdline_parser --file-name=3Dcmdline2 --unamed-opts -= -no-handle-help --no-handle-version To compile, gcc -DPACKAGE=3D'"cmdline2= "' -DVERSION=3D"1.1" -o main2 main2.c cmdline2.c = HTH