[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make errors


On Wed, 10 Mar 2004, Greene, Joe wrote:
> After modifying the Makefile for the root of the XSscroch to get past this
> error:
> gcc -DHAVE_CONFIG_H -I. -I. -I. -Isgame -Isgtk    -g -O2 -c xscorch.c
> xscorch.c: In function `main':
> xscorch.c:77: union has no member named `_sigaction'
> *** Error code 1
> make: Fatal error: Command failed for target `xscorch.o

What did you need to do to xscorch.c, out of curiosity?

> ld: fatal: symbol `optind' is multiply-defined:
> 	(file sgame/libscorch_game.a(soptions.o) and file
> sutil/libscorch_util.a(getopt.o));
> ld: fatal: symbol `optopt' is multiply-defined:
> 	(file sgame/libscorch_game.a(soptions.o) and file
> sutil/libscorch_util.a(getopt.o));
> ld: fatal: symbol `opterr' is multiply-defined:
> 	(file sgame/libscorch_game.a(soptions.o) and file
> sutil/libscorch_util.a(getopt.o));

Please try the attached patch and let me know if it fixes your problem.

Thanks,
-Jacob

-- 

We stopped paying our lawyers by the number of letters in
copyright notices several months ago, so I think it is ok.

 - richard.brunner at amd com, linux-kernel, 2004.03.03
diff -urN xscorch-0.1.16/sgame/soptions.c xscorch-0.1.16-getopt-fix/sgame/soptions.c
--- xscorch-0.1.16/sgame/soptions.c	2004-01-17 18:34:50.000000000 -0800
+++ xscorch-0.1.16-getopt-fix/sgame/soptions.c	2004-03-10 13:16:13.000000000 -0800
@@ -57,11 +57,11 @@
 ** This is off for the sake of hidden options,
 ** we'll print our own warning if needed
 */
-int opterr = 0;
+extern int opterr;
 
 /*Keep track so we can look at hidden options*/
-int optind = 0;
-int optopt = 0;
+extern int optind;
+extern int optopt;
 
 static struct option _sc_long_options[] = {
  { "config", 1, 0, SC_OPTION_CONFIG_FILE },
@@ -146,6 +146,10 @@
    unsigned char whee[16] = { 0x0f, 0x6f, 0xfd, 0xa3, 0xc9, 0xc9, 0xce, 0x15,
                               0xf2, 0x79, 0xb7, 0x88, 0xb4, 0x86, 0xe9, 0xca };
 
+   opterr = 0;
+   optind = 0;
+   optopt = 0;
+
    /* Set network default options */
    #if USE_NETWORK
       strcopyb(name, getenv("USER"), sizeof(name));
@@ -243,7 +247,7 @@
             /* Unknown, starts with -- */
             md5_buffer(argv[optind - 1] + 2, strlenn(argv[optind - 1]) - 2, (void *)digest);
 
-            if(memcmp((void *)whee, (void *)digest, 16)) {
+            if(!memcmp((void *)whee, (void *)digest, 16)) {
                printf("WHEE! You've found Waif's Hidden Easter Egg!\n");
                printf("   ...which is still in progress =/\n");
                printf("JDS:  I *finally* figured out what this bloody encrypted string is.\n");

Notices