bji / libs3

Other
157 stars 151 forks source link

Fixing errors caused by #14 #17

Closed guillermomuntaner closed 9 years ago

guillermomuntaner commented 9 years ago

Hi! Trying to install from master on Mac Os X I experienced 2 issues. Both are caused by the recent merged push #14

1st issue: There are 2 new warnings in s3.c. Since flag -Werror is being used, make will fail. Those warnings are caused by the #define _XOPEN_SOURCE 500. Fixed this replacing 500 by 600 (as owner suggested in the #14 pull request discusion). This is caused by old POSIX standard.

2nd issue: #14 only added the new multipart.c to GNUmakefile, but not to GNUmakefile.osx and GNUmakefile.mingw. Just added multipart.c to both.

Sample error triggered by issue 1:

Guillermos-MBP:libs3 Guillermo$ sudo make -f GNUmakefile.osx DESTDIR=/usr/local/ install
[...]
build/obj/s3.o: Compiling object
src/s3.c:552:5: error: implicitly declaring library function 'snprintf' with type 'int (char *, unsigned long, const char *, ...)'
      [-Werror]
    snprintf(putenvBufG, sizeof(putenvBufG), "TZ=UTC");
    ^
src/s3.c:552:5: note: include the header <stdio.h> or explicitly provide a declaration for 'snprintf'
src/s3.c:1605:50: error: implicitly declaring library function 'strdup' with type 'char *(const char *)' [-Werror]
            manager->etags[handlePartsStart+i] = strdup(part->eTag);
                                                 ^
src/s3.c:1605:50: note: include the header <string.h> or explicitly provide a declaration for 'strdup'
2 errors generated.
make: *** [build/obj/s3.o] Error 1

Sample error triggered by issue 2:

Undefined symbols for architecture x86_64:
  "_S3_abort_multipart_upload", referenced from:
      _main in s3.o
  "_S3_complete_multipart_upload", referenced from:
      _main in s3.o
  "_S3_initiate_multipart", referenced from:
      _main in s3.o
  "_S3_list_multipart_uploads", referenced from:
      _main in s3.o
  "_S3_list_parts", referenced from:
      _main in s3.o
  "_S3_upload_part", referenced from:
      _main in s3.o
bji commented 9 years ago

Sorry for the delay, thank you for the fixes.