On Thursday, 24 October 2013, 14:27, Tong Sun <[email protected]> wrote:
Thanks for your reply, Lorenzo. [Retry again] > 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="..." -DVERSION="..." That didn't work, but gcc -DPACKAGE='"..."' -DVERSION="..." 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=sample2.ggo --func-name=my_cmdline_parser | --file-name=cmdline2 --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=./sample2.ggo --func-name=my_cmdline_parser --file-name=cmdline2 --unamed-opts --no-handle-help --no-handle-version To compile, gcc -DPACKAGE='"cmdline2"' -DVERSION="1.1" -o main2 main2.c cmdline2.c _______________________________________________ Help-gengetopt mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-gengetopt
