LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 08-01-2020, 06:44 PM   #1
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 2,412

Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
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.
 
Old 08-02-2020, 01:26 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,277
Blog Entries: 1

Rep: Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137
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.
Old 08-02-2020, 01:47 AM   #3
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 2,412

Original Poster
Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
Quote:
Originally Posted by bathory View Post
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
Code:
sh ./Build -c

Last edited by RandomTroll; 08-02-2020 at 02:50 AM. Reason: additional information.
 
Old 08-17-2025, 04:42 PM   #4
scp
LQ Newbie
 
Registered: Jun 2010
Posts: 20

Rep: Reputation: 1
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
 
Old 08-17-2025, 11:16 PM   #5
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 2,412

Original Poster
Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
Quote:
Originally Posted by scp View Post
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.
 
Old 08-18-2025, 06:55 AM   #6
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 4,317

Rep: Reputation: 3172Reputation: 3172Reputation: 3172Reputation: 3172Reputation: 3172Reputation: 3172Reputation: 3172Reputation: 3172Reputation: 3172Reputation: 3172Reputation: 3172

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.
Old 08-18-2025, 04:01 PM   #7
scp
LQ Newbie
 
Registered: Jun 2010
Posts: 20

Rep: Reputation: 1
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.
 
Old 08-20-2025, 12:12 PM   #8
scp
LQ Newbie
 
Registered: Jun 2010
Posts: 20

Rep: Reputation: 1
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Building git darktable, and get: undefined reference to `SSLv3_client_method@OPENSSL_1_1_0' jkh2cpu Slackware 5 02-23-2020 08:52 AM
Building gtk+-2.10.8 but get a undefined reference to g_thread_gettime Haraldsh Linux - Software 5 03-13-2007 02:29 AM
G++ Linking Error "undefined reference" djjumper9 Programming 2 04-13-2004 09:36 AM
ncurses compile error: "undefined reference" Mr. Eek Linux From Scratch 1 05-12-2003 04:25 PM
make error/ undefined reference apljdi Linux - Newbie 1 10-29-2002 01:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:08 PM.

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions