歡迎您光臨本站 註冊首頁

gcc: AUXLIBS=-L/usr/local/mysql/lib: No such file or directory

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

gcc: AUXLIBS=-L/usr/local/mysql/lib: No such file or directory

gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/sasl/lib -lsasl2 -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -DSUNOS5 -c alldig.c
gcc: AUXLIBS=-L/usr/local/mysql/lib: No such file or directory


bash-3.2# cd /usr/local/mysql/lib
bash-3.2# ls
libmysqlclient.a            libmysqlclient.so.18
libmysqlclient_r.a          libmysqlclient.so.18.0.0
libmysqlclient_r.so         libmysqld.a
libmysqlclient_r.so.18      libmysqld-debug.a
libmysqlclient_r.so.18.0.0  libmysqlservices.a
libmysqlclient.so           plugin

請問,我該怎麼辦?? 為什麼gcc: AUXLIBS=-L/usr/local/mysql/lib: No such file or directory?

謝謝
《解決方案》

樓主安裝mysql-devel開發包看看
《解決方案》

本帖最後由 nullbert 於 2011-11-11 15:40 編輯

剛才看了一下官方的文檔:

In order to build Postfix with mysql map support, you will need to add -DHAS_MYSQL and -I for the directory containing the mysql headers, and the mysqlclient library (and libm) to AUXLIBS, for example:

make -f Makefile.init makefiles \
    'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include' \
    'AUXLIBS=-L/usr/local/mysql/lib -lmysqlclient -lz -lm'
On Solaris, use this instead:

make -f Makefile.init makefiles \
    'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include' \
    'AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib \
        -lmysqlclient -lz -lm'

我的系統是opensolaris,可能需要-R選項
另外
'AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib
單引號和字母A之間是否有個空格也不確定
如果沒有空格:'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/includeAUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib
如果有有空格:'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib
所以我感覺應該有空格,問題是編譯的時候它不提示,有沒有空格都可以編譯,所以請教有經驗的朋友,這裡該怎麼辦?
《解決方案》

加-R選項也不行呀,仍然是gcc: AUXLIBS=-L/usr/local/mysql/lib: No such file or directory
《解決方案》

make -f Makefile.init makefiles    'CCARGS=-DHAS_MYSQL  -I/usr/local/mysql/include'      'AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib  -lmysqlclient -lz -lm'
拼寫1:兩個單引號中間留空格

make -f Makefile.init makefiles    'CCARGS=-DHAS_MYSQL  -I/usr/local/mysql/include''AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib  -lmysqlclient -lz -lm'
拼寫2:兩個單引號中間不留空格

make -f Makefile.init makefiles    'CCARGS=-DHAS_MYSQL  -I/usr/local/mysql/include''    AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib  -lmysqlclient -lz -lm'
拼寫3:單引號和字母AUXLIBS中間留空格

大家都用的哪種拼寫法?
?????
《解決方案》

語法問題,何不用 clang 看看
《解決方案》

make -f Makefile.init makefiles 'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl' 'AUXLIBS=-L/usr/local/mysql/lib -R/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/sasl/lib -R/usr/local/sasl/lib -lsasl2'


gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_append_service.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_notify_service.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_cleanup.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_notify_util.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_notify_verp.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_one_service.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_warn_service.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_trace_service.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_template.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c bounce_templates.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -o bounce bounce.o bounce_append_service.o bounce_notify_service.o  bounce_cleanup.o bounce_notify_util.o bounce_notify_verp.o  bounce_one_service.o bounce_warn_service.o bounce_trace_service.o  bounce_template.o bounce_templates.o ../../lib/libmaster.a ../../lib/libglobal.a ../../lib/libutil.a -L/usr/local/mysql/lib -R/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/sasl/lib -R/usr/local/sasl/lib -lsasl2 -L/usr/lib -R/usr/lib -lpcre -lresolv -lsocket -lnsl
cp bounce ../../libexec
rm -f ../../conf/bounce.cf.default
perl annotate.pl <template_test.ref >../../conf/bounce.cf.default




gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c tlsproxy.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -c tlsproxy_state.c
gcc -Wmissing-prototypes -Wformat -DHAS_MYSQL -I/usr/local/mysql/include -DUSE_SASL_AUTH -I/usr/local/sasl/include/sasl -Dstrcasecmp=fix_strcasecmp                   -Dstrncasecmp=fix_strncasecmp -DHAS_PCRE -g -O -I. -I../../include -DSUNOS5 -o tlsproxy tlsproxy.o tlsproxy_state.o ../../lib/libtls.a ../../lib/libmaster.a ../../lib/libglobal.a  ../../lib/libutil.a -L/usr/local/mysql/lib -R/usr/local/mysql/lib -lmysqlclient -lz -lm -L/usr/local/sasl/lib -R/usr/local/sasl/lib -lsasl2 -L/usr/lib -R/usr/lib -lpcre -lresolv -lsocket -lnsl
cp tlsproxy ../../libexec





make install


/bin/sh postfix-install

    Warning: if you use this script to install Postfix locally, this
    script will replace existing sendmail or Postfix programs.  Make
    backups if you want to be able to recover.

    Before installing files, this script prompts you for some
    definitions.  Most definitions will be remembered, so you have to
    specify them only once. All definitions should have a reasonable
    default value.

Please specify the prefix for installed file names. Specify this ONLY
if you are building ready-to-install packages for distribution to other
machines.
install_root: [/]  

Please specify a directory for scratch files while installing Postfix.
You must have write permission in this directory.
tempdir:   

Please specify the final destination directory for installed Postfix
configuration files.
config_directory:   

Please specify the final destination directory for installed Postfix
administrative commands. This directory should be in the command search
path of adminstrative users.
command_directory:   

Please specify the final destination directory for installed Postfix
daemon programs. This directory should not be in the command search
path of any users.
daemon_directory:   

Please specify the final destination directory for Postfix-writable
data files such as caches or random numbers. This directory should not
be shared with non-Postfix software.
data_directory:   

Please specify the destination directory for the Postfix HTML files.
Specify "no" if you do not want to install these files.
html_directory:   

Please specify the owner of the Postfix queue. Specify an account with
numerical user ID and group ID values that are not used by any other
accounts on the system.
mail_owner:   

Please specify the final destination pathname for the installed Postfix
mailq command. This is the Sendmail-compatible mail queue listing
command.
mailq_path:   

Please specify the destination directory for the Postfix on-line manual
pages. You can no longer specify "no" here.
manpage_directory:   

Please specify the final destination pathname for the installed Postfix
newaliases command. This is the Sendmail-compatible command to build
alias databases for the Postfix local delivery agent.
newaliases_path:   

Please specify the final destination directory for Postfix queues.
queue_directory:   

Please specify the destination directory for the Postfix README files.
Specify "no" if you do not want to install these files.
readme_directory:   

Please specify the final destination pathname for the installed Postfix
sendmail command. This is the Sendmail-compatible mail posting
interface.
sendmail_path:   

Please specify the group for mail submission and for queue management
commands. Specify a group name with a numerical group ID that is not
shared with other accounts, not even with the Postfix mail_owner
account. You can no longer specify "no" here.
setgid_group:   
Updating /usr/libexec/postfix/anvil...
Updating /usr/libexec/postfix/bounce...
Updating /usr/libexec/postfix/cleanup...
Updating /usr/libexec/postfix/discard...
Updating /usr/libexec/postfix/dnsblog...
Updating /usr/libexec/postfix/error...
Updating /usr/libexec/postfix/flush...
Updating /usr/libexec/postfix/local...
Updating /usr/libexec/postfix/main.cf...
Updating /usr/libexec/postfix/master.cf...
Updating /usr/libexec/postfix/master...
Updating /usr/libexec/postfix/oqmgr...
Updating /usr/libexec/postfix/pickup...
Updating /usr/libexec/postfix/pipe...
Updating /usr/libexec/postfix/post-install...
Updating /usr/libexec/postfix/postfix-files...
Updating /usr/libexec/postfix/postfix-script...
Updating /usr/libexec/postfix/postfix-wrapper...
Updating /usr/libexec/postfix/postmulti-script...
Updating /usr/libexec/postfix/postscreen...
Updating /usr/libexec/postfix/proxymap...
Updating /usr/libexec/postfix/qmgr...
Updating /usr/libexec/postfix/qmqpd...
Updating /usr/libexec/postfix/scache...
Updating /usr/libexec/postfix/showq...
Updating /usr/libexec/postfix/smtp...
Updating /usr/libexec/postfix/smtpd...
Updating /usr/libexec/postfix/spawn...
Updating /usr/libexec/postfix/tlsproxy...
Updating /usr/libexec/postfix/tlsmgr...
Updating /usr/libexec/postfix/trivial-rewrite...
Updating /usr/libexec/postfix/verify...
Updating /usr/libexec/postfix/virtual...
Updating /usr/libexec/postfix/nqmgr...
Updating /usr/libexec/postfix/lmtp...
Updating /usr/sbin/postalias...
Updating /usr/sbin/postcat...
Updating /usr/sbin/postconf...
Updating /usr/sbin/postfix...
Updating /usr/sbin/postkick...
Updating /usr/sbin/postlock...
Updating /usr/sbin/postlog...
Updating /usr/sbin/postmap...
Updating /usr/sbin/postmulti...
Updating /usr/sbin/postsuper...
Updating /usr/sbin/postdrop...
Updating /usr/sbin/postqueue...
Updating /usr/lib/sendmail...
Updating /usr/bin/newaliases...
Updating /usr/bin/mailq...
Updating /etc/postfix/LICENSE...
Updating /etc/postfix/TLS_LICENSE...
Updating /etc/postfix/access...
Updating /etc/postfix/aliases...
Updating /etc/postfix/bounce.cf.default...
Updating /etc/postfix/canonical...
Updating /etc/postfix/generic...
Updating /etc/postfix/header_checks...
Updating /etc/postfix/main.cf.default...
Updating /etc/postfix/main.cf...
Updating /etc/postfix/makedefs.out...
Updating /etc/postfix/master.cf...
Updating /etc/postfix/relocated...
Updating /etc/postfix/transport...
Updating /etc/postfix/virtual...
Updating /usr/local/man/man1/mailq.1...
Updating /usr/local/man/man1/newaliases.1...
Updating /usr/local/man/man1/postalias.1...
Updating /usr/local/man/man1/postcat.1...
Updating /usr/local/man/man1/postconf.1...
Updating /usr/local/man/man1/postdrop.1...
Updating /usr/local/man/man1/postfix.1...
Updating /usr/local/man/man1/postkick.1...
Updating /usr/local/man/man1/postlock.1...
Updating /usr/local/man/man1/postlog.1...
Updating /usr/local/man/man1/postmap.1...
Updating /usr/local/man/man1/postmulti.1...
Updating /usr/local/man/man1/postqueue.1...
Updating /usr/local/man/man1/postsuper.1...
Updating /usr/local/man/man1/sendmail.1...
Updating /usr/local/man/man5/access.5...
Updating /usr/local/man/man5/aliases.5...
Updating /usr/local/man/man5/body_checks.5...
Updating /usr/local/man/man5/bounce.5...
Updating /usr/local/man/man5/canonical.5...
Updating /usr/local/man/man5/cidr_table.5...
Updating /usr/local/man/man5/generic.5...
Updating /usr/local/man/man5/header_checks.5...
Updating /usr/local/man/man5/ldap_table.5...
Updating /usr/local/man/man5/master.5...
Updating /usr/local/man/man5/mysql_table.5...
Updating /usr/local/man/man5/sqlite_table.5...
Updating /usr/local/man/man5/nisplus_table.5...
Updating /usr/local/man/man5/pcre_table.5...
Updating /usr/local/man/man5/pgsql_table.5...
Updating /usr/local/man/man5/postconf.5...
Updating /usr/local/man/man5/postfix-wrapper.5...
Updating /usr/local/man/man5/regexp_table.5...
Updating /usr/local/man/man5/relocated.5...
Updating /usr/local/man/man5/tcp_table.5...
Updating /usr/local/man/man5/transport.5...
Updating /usr/local/man/man5/virtual.5...
Updating /usr/local/man/man8/bounce.8...
Updating /usr/local/man/man8/cleanup.8...
Updating /usr/local/man/man8/anvil.8...
Updating /usr/local/man/man8/defer.8...
Updating /usr/local/man/man8/discard.8...
Updating /usr/local/man/man8/dnsblog.8...
Updating /usr/local/man/man8/error.8...
Updating /usr/local/man/man8/flush.8...
Updating /usr/local/man/man8/lmtp.8...
Updating /usr/local/man/man8/local.8...
Updating /usr/local/man/man8/master.8...
Updating /usr/local/man/man8/oqmgr.8...
Updating /usr/local/man/man8/pickup.8...
Updating /usr/local/man/man8/pipe.8...
Updating /usr/local/man/man8/postscreen.8...
Updating /usr/local/man/man8/proxymap.8...
Updating /usr/local/man/man8/qmgr.8...
Updating /usr/local/man/man8/qmqpd.8...
Updating /usr/local/man/man8/scache.8...
Updating /usr/local/man/man8/showq.8...
Updating /usr/local/man/man8/smtp.8...
Updating /usr/local/man/man8/smtpd.8...
Updating /usr/local/man/man8/spawn.8...
Updating /usr/local/man/man8/tlsproxy.8...
Updating /usr/local/man/man8/tlsmgr.8...
Updating /usr/local/man/man8/trace.8...
Updating /usr/local/man/man8/trivial-rewrite.8...
Updating /usr/local/man/man8/verify.8...
Updating /usr/local/man/man8/virtual.8...

    Warning:  you still need to edit myorigin/mydestination/mynetworks
    parameter settings in /etc/postfix/main.cf.

    See also http://www.postfix.org/STANDARD_CONFIGURATION_README.html
    for information about dialup sites or about sites inside a
    firewalled network.

    BTW:  Check your /etc/mail/aliases file and be sure to set up
    aliases that send mail for root and postmaster to a real person,
    then run /usr/bin/newaliases.
《解決方案》

clang命令怎樣用
bash-3.2# clang
bash: clang: command not found
《解決方案》

發現smtp不正常,察看log顯示以下錯誤

Jul 24 14:58:46 wap postfix/smtpd: warning: unsupported SASL server implementation: cyrus
Jul 24 14:58:46 wap postfix/smtpd: fatal: SASL per-process initialization failed
Jul 24 14:58:47 wap postfix/master: warning: process /usr/libexec/postfix/smtpd pid 15000 exit status 1
Jul 24 14:58:47 wap postfix/master: warning: /usr/libexec/postfix/smtpd: bad command startup — throttling

好生覺得奇怪,察看2.3.0的Change log ,找到原因,原來編譯的時候必須加一個參數,英文是這麼寫的

The Postfix-with-Cyrus-SASL build procedure has
changed. You now need to specify -DUSE_CYRUS_SASL in addition to
-DUSE_SASL_AUTH or else you end up without any Cyrus SASL support.
The error messages are:

    unsupported SASL server implementation: cyrus
    unsupported SASL client implementation: cyrus

增加-DUSE_CYRUS_SASL 這個編譯參數后,重新編譯,測試通過

[火星人 ] gcc: AUXLIBS=-L/usr/local/mysql/lib: No such file or directory已經有1253次圍觀

http://coctec.com/docs/service/show-post-13567.html