Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-01-2020, 06:44 PM
|
#1
|
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,412
|
Building sendmail 8.16.1 returns an undefined reference error
When I build sendmail 8.16.1 I get:
Quote:
/usr/bin/ld: domain.o: in function `getmxrr':
domain.c: (.text+0x156): undefined reference to `__res_search'
/usr/bin/ld: domain.c: (.text+0x228): undefined reference to `__dn_skipname'
/usr/bin/ld: domain.c: (.text+0x368): undefined reference to `__res_query'
/usr/bin/ld: domain.c: (.text+0x526): undefined reference to `__dn_expand'
/usr/bin/ld: domain.o: in function `dns_getcanonname':
domain.c: (.text+0x112e): undefined reference to `__res_querydomain'
/usr/bin/ld: domain.c: (.text+0x1317): undefined reference to `__dn_skipname'
/usr/bin/ld: domain.c: (.text+0x1427): undefined reference to `__dn_expand'
/usr/bin/ld: sm_resolve.o: in function `dns_lookup_int':
sm_resolve.c: (.text+0x246): undefined reference to `__res_search'
/usr/bin/ld: sm_resolve.c: (.text+0x433): undefined reference to `__res_search'
/usr/bin/ld: sm_resolve.c: (.text+0x54a): undefined reference to `__dn_expand'
collect2: error: ld returned 1 exit status
make: *** [Makefile:445: sendmail] Error 1
|
I think this means that the source for domain.c doesn't find a reference to __res_search in any of the libraries to which it links. I can still build the previous version, 8.15.2 with no problem. Does this mean that sendmail doesn't link to libresolv correctly?
Last edited by RandomTroll; 08-01-2020 at 06:47 PM.
|
|
|
|
08-02-2020, 01:26 AM
|
#2
|
|
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
|
Quote:
When I build sendmail 8.16.1 I get:
/usr/bin/ld: domain.o: in function `getmxrr':
domain.c: (.text+0x156): undefined reference to `__res_search'
/usr/bin/ld: domain.c: (.text+0x228): undefined reference to `__dn_skipname'
/usr/bin/ld: domain.c: (.text+0x368): undefined reference to `__res_query'
/usr/bin/ld: domain.c: (.text+0x526): undefined reference to `__dn_expand'
/usr/bin/ld: domain.o: in function `dns_getcanonname':
domain.c: (.text+0x112e): undefined reference to `__res_querydomain'
/usr/bin/ld: domain.c: (.text+0x1317): undefined reference to `__dn_skipname'
/usr/bin/ld: domain.c: (.text+0x1427): undefined reference to `__dn_expand'
/usr/bin/ld: sm_resolve.o: in function `dns_lookup_int':
sm_resolve.c: (.text+0x246): undefined reference to `__res_search'
/usr/bin/ld: sm_resolve.c: (.text+0x433): undefined reference to `__res_search'
/usr/bin/ld: sm_resolve.c: (.text+0x54a): undefined reference to `__dn_expand'
collect2: error: ld returned 1 exit status
make: *** [Makefile:445: sendmail] Error 1
I think this means that the source for domain.c doesn't find a reference to __res_search in any of the libraries to which it links. I can still build the previous version, 8.15.2 with no problem. Does this mean that sendmail doesn't link to libresolv correctly?
|
Take a look here for an explanation and a solution
|
|
|
1 members found this post helpful.
|
08-02-2020, 01:47 AM
|
#3
|
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,412
Original Poster
|
Quote:
Originally Posted by bathory
Take a look here for an explanation and a solution
|
Thanks. My own search didn't turn this up. There's a previous thread with exactly this problem in LQ, on an earlier version of sendmail, unsolved https://www.linuxquestions.org/quest...re-4175549965/
I didn't have this problem in 8.15.1 - I wonder what changed.
I haven't built sendmail in a long time. I forgot the baroque structure.
PS: The right way to do this is by editing devtools/Site/site.config.m4, then build with
Last edited by RandomTroll; 08-02-2020 at 02:50 AM.
Reason: additional information.
|
|
|
|
08-17-2025, 04:42 PM
|
#4
|
|
LQ Newbie
Registered: Jun 2010
Posts: 20
Rep:
|
The link you posted with the solution (5 years ago) is unreachable. If someone could post the actual solution on this forum it would be very helpful
|
|
|
|
08-17-2025, 11:16 PM
|
#5
|
|
Senior Member
Registered: Mar 2010
Distribution: Slackware
Posts: 2,412
Original Poster
|
Quote:
Originally Posted by scp
The link you posted with the solution (5 years ago) is unreachable. If someone could post the actual solution on this forum it would be very helpful
|
It's been 5 years: I've forgotten.
|
|
|
|
08-18-2025, 06:55 AM
|
#6
|
|
Senior Member
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 4,317
|
The link bathory posted in #2 is available in Wayback Machine: //web.archive.org/web/2020/http://www.jojees.com/resources/how-tos/sendmail/installation#TOC-Troubleshooting
I believe the referenced text from that page is:
Quote:
"domain.o: In function `dns_getcanonname'"
The above error is usually found when the sendmail compilation does not find the resolv.h header file. The text of the error is attached below. This file provides the routine known as res_query. So we have to force the sendmail installation to rather take the system resolver routine which may not be installed in the path /usr/include. To do so we just need to modify the variable "LIBS" in Makefile which is under the sendmail object directory. A pattern "-lresolv" has to be appended to the line containing "LIBS" variable.
|
|
|
|
2 members found this post helpful.
|
08-18-2025, 04:01 PM
|
#7
|
|
LQ Newbie
Registered: Jun 2010
Posts: 20
Rep:
|
Thank you. Adding -lresolv to the LIBS variable in the makefile in the object/sendmail directory does work - but resolv.h is in the /usr/include directory which is referenced by confINCDIRS in my site.conf.m4 file. So it is a bit mystifying why the Build program was not able to locate it.
|
|
|
|
08-20-2025, 12:12 PM
|
#8
|
|
LQ Newbie
Registered: Jun 2010
Posts: 20
Rep:
|
In the end I did not have to use -lresolv either in the makefile or in site.config.m4. It may have been changing DSASL2 to DSASL=2 or using -DHASFLOCK=1 instead of DHASFLOCK (though the latter should not have made a difference) - or adding -ldb to conf_sendmail_LIBS. But this is what worked in the end with Berkley db correctly accessing flock:
dnl # SASL2 (smtp authentication)
APPENDDEF(`confENVDEF', `-DSASL=2 -DHASFLOCK=1')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl2')
dnl # STARTTLS (smtp + tls/ssl)
APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
APPENDDEF(`conf_ENVDEF', `-D_FFR_SMTP_SSL')
APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto -ldb -L/usr/lib64')
APPENDDEF(`confLIBDIRS', `-L/usr/lib64')
APPENDDEF(`confINCDIRS', `-I/usr/include')
Last edited by scp; 08-20-2025 at 12:13 PM.
|
|
|
|
All times are GMT -5. The time now is 06:08 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|