On Thu, 3 Jun 2004, Scott Klement wrote:

> I can't seem to build this thing.  I get the following:
> /home/klemscot/tn5250cvs/rich/x5250/x5250.c:1259: undefined reference to
> `getopt_long_only'
> *** Error code 1

Weird.  man getopt_long_only gives me:

SYNOPSIS
       #include <unistd.h>

       int getopt(int argc, char * const argv[],
                  const char *optstring);

       extern char *optarg;
       extern int optind, opterr, optopt;

       #define _GNU_SOURCE
       #include <getopt.h>

So AFAICT it comes from glibc.  I don't know if *bsd uses glibc, so this
may be an incompatibility I need to fix.

> First, is there any reason why you're not using TN5250's built-in
> command-line/configfile options system?

Only one reason:  consistency with most of the other software on my
system.  Actually, I do use tn5250_config_parse_argv() but not until
after I've extracted command line options that start with a dash.
getopt_long_only() removes options that start with a dash and passes the
rest of the command line unchanged.  Then I call
tn5250_config_parse_argv() to get the 5250 specific stuff.  Most X apps
expect to be able to specify things like -geometry or -name, things that
tn5250_config_parse_argv() doesn't understand.  The only dash options that
tn5250_config_parse_argv() does understand are -version, -ruler,
-underscores, and -ssl_verify_server.  -version I handle (as well as
--version for consistency).  -underscores is irrelevant to x5250.  -ruler
will be handled (as well as --ruler).

> Assuming that you have some reason to not use TN5250's system, can you
> tell me where "getopt_long_only" comes from?  Which package, that is, so I
> can see if it's available for my system?

I think from glibc.  You could try replacing getopt_long_only() with
getopt_long() and see if that compiles.  If not, I'll need to investigate
further.  If getopt_long() doesn't work, then getopt() will but may need
some more changes (specifically the options[] array will not be used).

btw - there is a new and improved version available (version 0.1.0) at:

http://www.chowhouse.com/~james/x5250

Thanks a ton for taking the time to look at this, Scott.

James Rich

Vs lbh guvax bs argjbex frphevgl nf na vzzhar flfgrz, Jvaqbjf vf UVI.
        -- Wbr Cyhgn

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.