LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-17-2025, 07:55 PM   #1
scp
LQ Newbie
 
Registered: Jun 2010
Posts: 20

Rep: Reputation: 1
Sendmail-8.18.1 build undefined reference


I have seen this problem posted on LinuxQuestions in reference to an earlier Sendmail build but the solution is not available due to an insecure link. I believe the solution is in the configuration of site.config.m4 but I am stumped.

Below is the error I get attempting to build Sendmail-8.18.1:

/bin/ld: domain.o: in function `getmxrr':
domain.c.text+0x156): undefined reference to `__res_search'
/bin/ld: domain.c.text+0x240): undefined reference to `__dn_skipname'
/bin/ld: domain.c.text+0x378): undefined reference to `__res_query'
/bin/ld: domain.c.text+0x536): undefined reference to `__dn_expand'
/bin/ld: domain.c.text+0x59f): undefined reference to `__dn_expand'
/bin/ld: domain.o: in function `dns_getcanonname':
domain.c.text+0x113e): undefined reference to `__res_querydomain'
/bin/ld: domain.c.text+0x1327): undefined reference to `__dn_skipname'
/bin/ld: domain.c.text+0x1437): undefined reference to `__dn_expand'
/bin/ld: domain.c.text+0x155a): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.o: in function `dns_lookup_int':
sm_resolve.c.text+0x246): undefined reference to `__res_search'
/bin/ld: sm_resolve.c.text+0x433): undefined reference to `__res_search'
/bin/ld: sm_resolve.c.text+0x54a): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x5f7): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x829): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x8a8): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x998): undefined reference to `__dn_expand'

My site.conf.m4:

dnl # SASL2 (smtp authentication)
APPENDDEF(`confENVDEF', `-DGSASL -DHASFLOCK')
APPENDDEF(`conf_sendmail_LIBS', `-lgsasl -lresolv')
dnl #
dnl # STARTTLS (smtp + tls/ssl)
APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
APPENDDEF(`conf_ENVDEF', `-D_FFR_SMTP_SSL')
APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto -L/usr/lib64')
APPENDDEF(`confLIBDIRS', `-L/usr/lib64')
APPENDDEF(`confINCDIRS', `-I -L/usr/include')
 
Old 08-17-2025, 11:33 PM   #2
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 2,412

Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
I haven't built since 8.17.2. I get:
Quote:
cc -O2 -I. -I../../include -I/usr/local/include -I/usr/local/ssl/include -DCDB -UNIS -DSTARTTLS -DUSE_EAI -c -o vfscanf.o vfscanf.c
vfscanf.c: In function 'scanalrm':
vfscanf.c:88:1: warning: old-style function definition [-Wold-style-definition]
88 | scanalrm(sig)
| ^~~~~~~~
vfscanf.c: In function 'sm_vfscanf':
vfscanf.c:109:1: warning: old-style function definition [-Wold-style-definition]
109 | sm_vfscanf(fp, timeout, fmt0, ap)
| ^~~~~~~~~~
vfscanf.c:243:30: error: assignment to 'ULONGLONG_T (*)(const char *, char **, int)' {aka 'long long unsigned int (*)(const char *, char **, int)'} from incompatible pointer type 'ULONGLONG_T (*)(void)' {aka 'long long unsigned int (*)(void)'} [-Wincompatible-pointer-types]
243 | ccfn = (ULONGLONG_T (*)())sm_strtoll;
| ^
vfscanf.c:249:30: error: assignment to 'ULONGLONG_T (*)(const char *, char **, int)' {aka 'long long unsigned int (*)(const char *, char **, int)'} from incompatible pointer type 'ULONGLONG_T (*)(void)' {aka 'long long unsigned int (*)(void)'} [-Wincompatible-pointer-types]
249 | ccfn = (ULONGLONG_T (*)())sm_strtoll;
| ^
vfscanf.c:327:30: error: assignment to 'ULONGLONG_T (*)(const char *, char **, int)' {aka 'long long unsigned int (*)(const char *, char **, int)'} from incompatible pointer type 'ULONGLONG_T (*)(void)' {aka 'long long unsigned int (*)(void)'} [-Wincompatible-pointer-types]
327 | ccfn = (ULONGLONG_T (*)()) sm_strtoll;
| ^
vfscanf.c: In function 'sm_sccl':
vfscanf.c:776:1: warning: old-style function definition [-Wold-style-definition]
776 | sm_sccl(tab, fmt)
| ^~~~~~~
make[1]: *** [<builtin>: vfscanf.o] Error 1
make[1]: Leaving directory '/usr/src/sendmail-8.18.1/obj.Linux.6.16.1.x86_64/libsm'
make: *** [Makefile:409: /usr/src/sendmail-8.18.1/obj.Linux.6.16.1.x86_64/libsm/libsm.a] Error 2
I get the same with 8.17.2 - which I have successfully built. Don't know.
 
Old 08-18-2025, 04:23 AM   #3
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:
Originally Posted by scp View Post
I have seen this problem posted on LinuxQuestions in reference to an earlier Sendmail build but the solution is not available due to an insecure link. I believe the solution is in the configuration of site.config.m4 but I am stumped.

Below is the error I get attempting to build Sendmail-8.18.1:

/bin/ld: domain.o: in function `getmxrr':
domain.c.text+0x156): undefined reference to `__res_search'
/bin/ld: domain.c.text+0x240): undefined reference to `__dn_skipname'
/bin/ld: domain.c.text+0x378): undefined reference to `__res_query'
/bin/ld: domain.c.text+0x536): undefined reference to `__dn_expand'
/bin/ld: domain.c.text+0x59f): undefined reference to `__dn_expand'
/bin/ld: domain.o: in function `dns_getcanonname':
domain.c.text+0x113e): undefined reference to `__res_querydomain'
/bin/ld: domain.c.text+0x1327): undefined reference to `__dn_skipname'
/bin/ld: domain.c.text+0x1437): undefined reference to `__dn_expand'
/bin/ld: domain.c.text+0x155a): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.o: in function `dns_lookup_int':
sm_resolve.c.text+0x246): undefined reference to `__res_search'
/bin/ld: sm_resolve.c.text+0x433): undefined reference to `__res_search'
/bin/ld: sm_resolve.c.text+0x54a): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x5f7): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x829): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x8a8): undefined reference to `__dn_expand'
/bin/ld: sm_resolve.c.text+0x998): undefined reference to `__dn_expand'

My site.conf.m4:

dnl # SASL2 (smtp authentication)
APPENDDEF(`confENVDEF', `-DGSASL -DHASFLOCK')
APPENDDEF(`conf_sendmail_LIBS', `-lgsasl -lresolv')
dnl #
dnl # STARTTLS (smtp + tls/ssl)
APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
APPENDDEF(`conf_ENVDEF', `-D_FFR_SMTP_SSL')
APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto -L/usr/lib64')
APPENDDEF(`confLIBDIRS', `-L/usr/lib64')
APPENDDEF(`confINCDIRS', `-I -L/usr/include')
Hi,

FYI, using your site.conf.m4, replacing just gsasl with sasl2 as I use cyrus-sasl, sendmail-8.18.1 was compiled successfully on Slackware64-current:
Code:
dnl # SASL2 (smtp authentication)
APPENDDEF(`confENVDEF', `-DSASL2 -DHASFLOCK')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl2 -lresolv')
dnl #
dnl # STARTTLS (smtp + tls/ssl)
APPENDDEF(`conf_sendmail_ENVDEF', `-DSTARTTLS')
APPENDDEF(`conf_ENVDEF', `-D_FFR_SMTP_SSL')
APPENDDEF(`conf_sendmail_LIBS', `-lssl -lcrypto -L/usr/lib64')
APPENDDEF(`confLIBDIRS', `-L/usr/lib64')
APPENDDEF(`confINCDIRS', `-I -L/usr/include')
 
Old 08-18-2025, 11:01 AM   #4
scp
LQ Newbie
 
Registered: Jun 2010
Posts: 20

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by bathory View Post
Hi,

FYI, using your site.conf.m4, replacing just gsasl with sasl2 as I use cyrus-sasl, sendmail-8.18.1 was compiled successfully on Slackware64-current

Thank you for responding. I went over to Cyrus SASL but still get the same error. I see others have encountered this problem, too. Perhaps it has to do with Build not finding libresolv?

Last edited by scp; 08-18-2025 at 11:03 AM.
 
Old 08-18-2025, 12:15 PM   #5
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:
Originally Posted by scp View Post
Thank you for responding. I went over to Cyrus SASL but still get the same error. I see others have encountered this problem, too. Perhaps it has to do with Build not finding libresolv?
The sasl package is irrelevant in your case...
The problem is with resolv.h that cannot be found by the compiler.

You didn't mention your distro, but for Slackware libresolv and the header resolv.h are provided by glibc
On a different distro you need to install the glibc development package.
 
Old 08-18-2025, 02:10 PM   #6
scp
LQ Newbie
 
Registered: Jun 2010
Posts: 20

Original Poster
Rep: Reputation: 1
Quote:
The problem is with resolv.h that cannot be found by the compiler.
I use Fedora. Slackware was the first Linux distro I used eons ago. You may be right but both the header and the library of libresolv is installed and loaded in the LDCache. Also, it is in /usr/include so Sendmail Build should be able to find it the path is stated in site.conf.m4

Last edited by scp; 08-18-2025 at 02:29 PM.
 
Old 08-18-2025, 04:09 PM   #7
scp
LQ Newbie
 
Registered: Jun 2010
Posts: 20

Original Poster
Rep: Reputation: 1
The fix was to add -lresolv to the LIBS variable in the makefile in the object/sendmail directory - then Build completes. (Important to use only ./Build when doing this and not, of course ./Build -c .) The mystifying thing is that resolv.h is in the /usr/include directory which is referenced by confINCDIRS in my site.conf.m4 file. So it is odd that the Build program was not able to locate it.
 
1 members found this post helpful.
Old 08-20-2025, 12:11 PM   #8
scp
LQ Newbie
 
Registered: Jun 2010
Posts: 20

Original Poster
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:15 PM.
 
  


Reply

Tags
sendmail, undefined



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
[SOLVED] Building sendmail 8.16.1 returns an undefined reference error RandomTroll Linux - Software 7 08-20-2025 12:12 PM
[SOLVED] ldap_add undefined attribute type (17) additional info attribute type undefined yashfire007 Linux - Newbie 6 03-20-2015 09:12 AM
bmpx throws undefined reference to `sqlite3_prepare_v2' during build vofka Linux - Software 5 11-09-2009 03:00 PM
PHP Problem ('undefined index', 'undefined function') zokken Programming 2 12-04-2008 10:18 AM
GTK+ build, undefined reference error? headrift Linux - Software 2 09-15-2005 04:00 PM

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

All times are GMT -5. The time now is 06:09 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