getopt and getopt_long for Windows? [with VC++] - Programmer

This is a discussion on getopt and getopt_long for Windows? [with VC++] - Programmer ; Does anyone know of a port of getopt and getopt_long for Windows, especially one that compiles and links with VC++?...

+ Reply to Thread
Results 1 to 6 of 6

Thread: getopt and getopt_long for Windows? [with VC++]

  1. getopt and getopt_long for Windows? [with VC++]

    Does anyone know of a port of getopt and getopt_long for Windows, especially one that compiles and links with VC++?

  2. Re: getopt and getopt_long for Windows? [with VC++]


    Angel Tsankov wrote:
    > Does anyone know of a port of getopt and getopt_long for Windows, especially one that compiles and links with VC++?


    Are you looking for something like "CommandLineInfo". You can extend
    from this class for your commandline parsing needs.


  3. Re: getopt and getopt_long for Windows? [with VC++]

    >> Does anyone know of a port of getopt and getopt_long for Windows, especially one that compiles and links with VC++?
    >
    > Are you looking for something like "CommandLineInfo". You can extend
    > from this class for your commandline parsing needs.


    No, I'm looking for a port of getopt and getopt_long for Windows. I'd like my programs that use any of these two functions to
    compile with VC++ w/o any modification or conditionals.


  4. Re: getopt and getopt_long for Windows? [with VC++]

    Angel Tsankov wrote:
    > >> Does anyone know of a port of getopt and getopt_long for Windows, especially one that compiles and links with VC++?

    > >
    > > Are you looking for something like "CommandLineInfo". You can extend
    > > from this class for your commandline parsing needs.

    >
    > No, I'm looking for a port of getopt and getopt_long for Windows. I'd like my programs that use any of these two functions to
    > compile with VC++ w/o any modification or conditionals.


    Good question. If you are GNU compatible, then I would encourage you
    to look at YICS (http://www.yics.org). The source includes a getopt()
    for Windows, that works well enought for most purposes. If you find a
    better solution please let us know by posting it here.

    --
    Paul Hsieh
    http://www.pobox.com/~qed/
    http://bstring.sf.net/


  5. Re: getopt and getopt_long for Windows? [with VC++]

    Angel Tsankov wrote:
    > >> Does anyone know of a port of getopt and getopt_long for Windows, especially one that compiles and links with VC++?

    > >
    > > Are you looking for something like "CommandLineInfo". You can extend
    > > from this class for your commandline parsing needs.

    >
    > No, I'm looking for a port of getopt and getopt_long for Windows. I'd like my programs that use any of these two functions to
    > compile with VC++ w/o any modification or conditionals.


    You can look at boost which provides portable libraries for c++

    specifically :
    http://www.boost.org/doc/html/progra.../overview.html


  6. Re: getopt and getopt_long for Windows? [with VC++]

    Angel Tsankov wrote
    (in article <4409b548$0$15795$14726298@news.sunsite.dk>):

    >>> Does anyone know of a port of getopt and getopt_long for Windows,
    >>> especially one that compiles and links with VC++?

    >>
    >> Are you looking for something like "CommandLineInfo". You can extend
    >> from this class for your commandline parsing needs.

    >
    > No, I'm looking for a port of getopt and getopt_long for Windows. I'd like my


    > programs that use any of these two functions to
    > compile with VC++ w/o any modification or conditionals.


    Yes, I've gone down that path a few times myself. For some
    reason, it's difficult to find GNU software that will compile
    cleanly off of POSIX. :-)

    I finally took the simpler route and use a getopt implementation
    that compiles anywhere you have a standard C compiler. I have
    no use for getopt_long, the last thing I want to do is write
    even more complicated command line interfaces. I've yet to see
    the need for getopt_long. YMMV.


    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw






+ Reply to Thread