I was trying to build a C program that uses the ares_dns_parse
function from the c-ares
library. I have decided to install v1.30.0 according to the installation steps here: https://github.com/c-ares/c-ares/blob/main/INSTALL.md, as follows:
$ wget https://github.com/c-ares/c-ares/releases/download/v1.30.0/c-ares-1.30.0.tar.gz
$ tar xvfc-ares-1.30.0.tar.gz
$ cd c-ares-1.30.0
$ ./configure
$ make
$ sudo make install
I have set up a simple C program as follows:
#include <res.h>
... include all other relevant headers
int main(){
... all relevant declarations
ares_dns_parse();
return 0;
}
Error undefined symbol: ares_dns_parse
when compiled and ran:
$ gcc ares_test.c -lcares -L /usr/local/lib && sudo ./a.out
Are there any additional linking required, or any steps I’m missing? Any help would be appreciated, thank you.