/usr/bin/ld: cannot find -lmysqlclient
8372 ワード
環境centos 5.7 x86_64システムにpostfixをインストール!
エラー
"/usr/bin/ld: cannot find -lmysqlclient"
類似/usr/bin/ld:cannot find-xxxxのエラーはたくさんありますが、
最も簡単な判断:対応するmysql-develパッケージをインストールするかどうか
mysql-develパッケージがインストールされていることを発見しました
エラーメッセージをもう一度確認すると、/usr/lib/mysql/
解決策、/usr/lib 64/mysqlとして指定
の最後の部分
エラーメッセージをもう一度よく確認してください.
エラー
"/usr/bin/ld: cannot find -lmysqlclient"
類似/usr/bin/ld:cannot find-xxxxのエラーはたくさんありますが、
最も簡単な判断:対応するmysql-develパッケージをインストールするかどうか
mysql-develパッケージがインストールされていることを発見しました
- # rpm -qa | grep mysql
- mysql-devel-5.0.77-4.el5_6.6
- mysql-server-5.0.77-4.el5_6.6
- mysql-devel-5.0.77-4.el5_6.6
- mysql-5.0.77-4.el5_6.6
- php-mysql-5.1.6-27.el5_5.3
- mysql-5.0.77-4.el5_6.6
エラーメッセージをもう一度確認すると、/usr/lib/mysql/
- [postfix-2.6.13]$ make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS ' 'AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto'
-
- /usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient
- /usr/bin/ld: cannot find -lmysqlclient
- collect2: ld returned 1 exit status
- make: *** [master] Error 1
- make: *** [update] Error 1
-
- [postfix-2.6.13]$ cat conf/makedefs.out
- # Do not edit -- this file documents how Postfix was built for your machine.
- SYSTYPE = LINUX2
- AR = ar
- ARFL = rv
- RANLIB = ranlib
- SYSLIBS = -L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto -ldb -lnsl -lresolv
- CC = gcc $(WARN) -DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS
- OPT = -O
- DEBUG = -g
- AWK = awk
- STRCASE =
- EXPORT = AUXLIBS='-L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto' CCARGS='-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS ' OPT='-O' DEBUG='-g'
- WARN = -Wall -Wno-comment -Wformat -Wimplicit -Wmissing-prototypes \
- -Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
- -Wunused -Wno-missing-braces
解決策、/usr/lib 64/mysqlとして指定
- [postfix-2.6.13]$ make clea
-
- [postfix-2.6.13]$ make makefiles 'CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS ' 'AUXLIBS=-L/usr/lib64/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto'
-
- [postfix-2.6.13]$ cat conf/makedefs.out
- # Do not edit -- this file documents how Postfix was built for your machine.
- SYSTYPE = LINUX2
- AR = ar
- ARFL = rv
- RANLIB = ranlib
- SYSLIBS = -L/usr/lib64/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto -ldb -lnsl -lresolv
- CC = gcc $(WARN) -DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS
- OPT = -O
- DEBUG = -g
- AWK = awk
- STRCASE =
- EXPORT = AUXLIBS='-L/usr/lib64/mysql -lmysqlclient -lz -lm -L/usr/lib/sasl2 -lsasl2 -lssl -lcrypto' CCARGS='-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DUSE_TLS ' OPT='-O' DEBUG='-g'
- WARN = -Wall -Wno-comment -Wformat -Wimplicit -Wmissing-prototypes \
- -Wparentheses -Wstrict-prototypes -Wswitch -Wuninitialized \
- -Wunused -Wno-missing-braces
-
- make && make isntall
の最後の部分
エラーメッセージをもう一度よく確認してください.