You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having issue building the sph2pipe on Mac OS Sonoma and Xcode 15. Here are the errors:
cc -o sph2pipe -s -w -g -O2 file_headers.c shorten_x.c sph2pipe.c -lm
file_headers.c:100:17: error: call to undeclared library function 'strdup' with type 'char *(const char *)'; ISO C99 and later do not support i
mplicit function declarations [-Wimplicit-function-declaration]
inporder = strdup( fldsval );
^
file_headers.c:100:17: note: include the header <string.h> or explicitly provide a declaration for 'strdup'
1 error generated.
sph2pipe.c:213:16: error: call to undeclared library function 'strdup' with type 'char *(const char *)'; ISO C99 and later do not support impli
cit function declarations [-Wimplicit-function-declaration]
hdrfile = strdup( optarg );
^
#define_XOPEN_SOURCE 500 /* See feature_test_macros(7) */#define_DARWIN_C_SOURCE#include<math.h>#include<string.h>#include<unistd.h>/* code goes on ... */
sph2pipe.c:
#define_SPH_CONVERT_MAIN_#define_XOPEN_SOURCE 500 /* See feature_test_macros(7) */#define_DARWIN_C_SOURCE#include<string.h>#include<unistd.h>/* code goes on ... */
I might send PR if you are interested in fixing it. I'm not very proficient in C code and don't know if those changes could break anything, but I can confirm that the changes are working. After adding those headers code builds just fine.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi! 👋
I'm having issue building the
sph2pipe
onMac OS Sonoma
andXcode 15
. Here are the errors:Here's similar issue in other project. They fixed it by defining
_DARWIN_C_SOURCE
. Like this:file_headers.c:
sph2pipe.c:
I might send PR if you are interested in fixing it. I'm not very proficient in C code and don't know if those changes could break anything, but I can confirm that the changes are working. After adding those headers code builds just fine.
Thanks!
The text was updated successfully, but these errors were encountered: