You are not logged in.
When compiling an app with c-ares in the past I used:
gcc -Wall -o acountry.cgi acountry.c ares_getenv.c ares_strcasecmp.c ares_version.c -static -static-libgcc -lcaresbut now I get an error:
/usr/bin/ld: cannot find -lcaresOmitting "-lcares" gives undefined reference error.
I have the libraries in the usual path:
ls -ghlo /usr/lib/libcar*
lrwxrwxrwx 1 13 May 13 13:24 /usr/lib/libcares.so -> libcares.so.2
lrwxrwxrwx 1 17 May 13 13:24 /usr/lib/libcares.so.2 -> libcares.so.2.4.2
-rwxr-xr-x 1 94K May 13 13:24 /usr/lib/libcares.so.2.4.2I would experiment with an older c-ares version (c-ares-1.17.1-1-x86_64.pkg.tar.zst installed)
if I had one.
Last edited by cmt100 (2021-05-13 14:13:24)
Offline
You used the -static option, but there's no static lib listed there for c-ares.
Last edited by Scimmia (2021-05-13 14:17:48)
Offline
Thanks.
The "-static" option was giving me the error, but now I have a small file
which might not run independantly on a server.
Offline
If you want a static build, you'll have to compile c-ares manually with CARES_STATIC(_PIC)
https://github.com/c-ares/c-ares/blob/master/INSTALL.md
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline