Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 2161  / 3 Years ago, mon, september 27, 2021, 4:07:31

I just installed postfix 2.7.11 in Ubuntu server from source code. I do not use the ubuntu own one because I need the old version.



I found a very interesting problem. Before, in both CentOS 5 and 6, I can build the source code without any problem. But, in Ubuntu server 12.04 is totally different.



I got the following problems:



dict_nis.c:173: error: undefined reference to 'yp_match'
dict_nis.c:187: error: undefined reference to 'yp_match'

dns_lookup.c:347: error: undefined reference to '__dn_expand'
dns_lookup.c:218: error: undefined reference to '__res_search'
dns_lookup.c:287: error: undefined reference to '__dn_expand'
dns_lookup.c:498: error: undefined reference to '__dn_expand'
dns_lookup.c:383: error: undefined reference to '__dn_expand'


Yes, this reason is obviously. I just search related library and add it to the makefile. It works.



The question is why? What is the difference between Ubuntu Server and CentOS?



One possibility is gcc and ld version. Ubuntu server use different version of gcc and ld with CentOS. But I am not sure.


More From » compiling

 Answers
0

Finally, with others help. I found the reason.

Ubuntu have special .so location. The location is different from CentOS.

But in Postfix makedefs file, it do not include this specific location. Let's check the source:



SYSLIBS="-ldb"
for name in nsl resolv
do
for lib in /usr/lib64 /lib64 /usr/lib /lib
do
test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
SYSLIBS="$SYSLIBS -l$name"
break
}
done
done


Here, SYSLIBS will be used when do make. This script will check some special folder to add .so lib. But these locations do not include Ubuntu's.


[#36298] Wednesday, September 29, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sconhoney

Total Points: 403
Total Questions: 118
Total Answers: 109

Location: Andorra
Member since Mon, Jan 9, 2023
1 Year ago
sconhoney questions
;