alandekok / jlibtool

A replacement for libtool written in C
Apache License 2.0
36 stars 5 forks source link

Error during compilation #6

Open absolutelynothinghere opened 1 year ago

absolutelynothinghere commented 1 year ago

Compiling jlibtool with Clang (c99) yields the following error and 2 warnings:

jlibtool.c:1617:11: warning: call to undeclared function 'strdup'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                                tmp = strdup(arg);
                                      ^
jlibtool.c:1617:9: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
                                tmp = strdup(arg);
                                    ^ ~~~~~~~~~~~
jlibtool.c:2227:2: warning: call to undeclared function 'setenv'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        setenv(LD_LIBRARY_PATH_LOCAL, l, 1);
        ^

Adding -Wno-int-conversion -Wno-implicit-function-declaration to the compiler command silences the error and warnings.

alandekok commented 1 year ago

The better solution is to include the correct header files which have the function prototypes. I'll take a look.