multiple definition of `optind'

Phil Howard phil-openssh-unix-dev at ipal.net
Mon Jun 17 01:24:28 EST 2002


Any ideas of the best way around this problem?  Should I just hack the
source code, or is there a magic switch somewhere I'm missing?  I'm
assuming I can't just dismiss that function as OpenSSH is probably
based on the OpenBSD semantics.

=============================================================================
gcc -g -O2 -Wall -Wno-uninitialized -I. -I.  -DSSHDIR=\"/etc/ssh\" -D_PATH_SSH_PROGRAM=\"/bin/ssh\" -D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/libexec/ssh-askpass\" -D_PATH_SFTP_SERVER=\"/usr/libexec/sftp-server\" -D_PATH_SSH_PIDDIR=\"/var/run\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DSSH_RAND_HELPER=\"/usr/libexec/ssh-rand-helper\" -DHAVE_CONFIG_H -c clientloop.c
gcc -o ssh ssh.o sshconnect.o sshconnect1.o sshconnect2.o sshtty.o readconf.o clientloop.o -static -L. -Lopenbsd-compat -lssh -lopenbsd-compat -lutil -lz -lnsl  -lcrypto -lcrypt
/usr/lib/libc.a(getopt.o): In function `store_args_and_env':
/tmp/glibc-2.2.3/posix/getopt.c(.data+0x0): multiple definition of `optind'
openbsd-compat/libopenbsd-compat.a(getopt.o)(.data+0x4):/home/root/src/openssh-3.2.3p1/tmp/openssh-3.2.3p1/openbsd-compat/getopt.c: first defined here
/usr/lib/libc.a(getopt.o): In function `store_args_and_env':
/tmp/glibc-2.2.3/posix/getopt.c:271: multiple definition of `opterr'
openbsd-compat/libopenbsd-compat.a(getopt.o)(.data+0x0):/home/root/src/openssh-3.2.3p1/tmp/openssh-3.2.3p1/openbsd-compat/getopt.c: first defined here
collect2: ld returned 1 exit status
make: *** [ssh] Error 1
make failed
=============================================================================

-- 
-----------------------------------------------------------------
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| phil-nospam at ipal.net | Texas, USA | http://phil.ipal.org/     |
-----------------------------------------------------------------



More information about the openssh-unix-dev mailing list