源码编译依赖关系一例小结
生活随笔
收集整理的這篇文章主要介紹了
源码编译依赖关系一例小结
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
mysql用的是源碼5.5.11安裝的,在編譯的時候使用不同參數,configure能正常通過,make卻報錯,也有configure報錯,nake卻正常的 更詳細的ndoutils安裝問題,請看此文http://hi.baidu.com/dongjunjia/blog/item/3c0043ed27a52a372697919f.html 這里,我主要是記錄下解決此問題的方法 #./configure --prefix=/usr/local/nagios --enable-mysql? LDFLAGS=-L/usr/local/mysql --with-mysql-inc=/usr/local/mysql/include? --with-ndo2db-user=nagios --with-ndo2db-group=nagios --with-mysql=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib/mysql 前面省略掉…… checking for initgroups... yes
checking for strtof... yes
checking for type of socket size... size_t
checking for linker flags for loadable modules... -shared
checking for mysql_init in -lmysqlclient... yes
MySQL library and include file(s) were found!
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating docs/docbook/en-en/Makefile
config.status: creating subst
config.status: creating include/config.h
*** Configuration summary for ndoutils 1.5 02-03-2012 ***: ?General Options:
?-------------------------
?NDO2DB user:??? nagios
?NDO2DB group:?? nagios
Review the options above for accuracy.? If they look okay,
type 'make' to compile the NDO utilities.
?configure是成功的 [root@localhost ndoutils-1-5]# make
cd ./src && make
make[1]: Entering directory `/root/nagios/nd2db_test/ndoutils-1-5/src'
gcc -fPIC -g -O2 -I/usr/local/mysql/include -DHAVE_CONFIG_H? -c -o io.o io.c
在包含自 io.c:11 的文件中:
../include/config.h:261:25: 錯誤:mysql/mysql.h:沒有那個文件或目錄
../include/config.h:262:26: 錯誤:mysql/errmsg.h:沒有那個文件或目錄
make[1]: *** [io.o] 錯誤 1
make[1]: Leaving directory `/root/nagios/nd2db_test/ndoutils-1-5/src'
make: *** [all] 錯誤 2
[root@localhost ndoutils-1-5]# 這里make出錯,那么查看提示,無法找到mysql.h? errmsg.h 先在系統里面找這2個文件 [root@localhost ndoutils-1-5]# find /usr/local/mysql/ -name mysql.h
/usr/local/mysql/include/mysql.h [root@localhost ndoutils-1-5]# find /usr/local/mysql/ -name errmsg.h
/usr/local/mysql/include/errmsg.h 第二看報錯信息? ../include/config.h? 那么由此可以看到? 上面2個出錯文件是由config .h定義的 #include <mysql/mysql.h>
#include <mysql/errmsg.h>
找到這2個文件的位置 從這里可以看出? mysql/mysql.h mysql/errmsg.h? 在系統里面是無法找到的,所以修改如下 #include </usr/local/mysql/include/mysql.h>
#include </usr/local/mysql/include/errmsg.h> 再次make 則順利通過 當然,處理上面的問題,還可以通過建立鏈接的方式 對上面解決問題的思路做一個總結: 編譯源碼包,通常會遇到N多依賴關系,常常提示無法找到某文件,缺少某依賴包,有時候裝上相關軟件,還是無法繼續 往往給我們帶來很多麻煩。對于此類問題,首先是找到錯誤提示信息,針對錯誤提示,分析系統是否有這個文件,再次是分析源碼文件的庫文件相關應用位置,上例中,正是由于庫文件引用不正確導致的,所以很容易就把吃問題解決了。 解決問題的方法不重要,思路卻是最重要的,思路清晰了,方法自然來了 ,希望給大家帶來一點收獲
本文轉自it你好 51CTO博客,原文鏈接:http://blog.51cto.com/itnihao/792286,如需轉載請自行聯系原作者
checking for strtof... yes
checking for type of socket size... size_t
checking for linker flags for loadable modules... -shared
checking for mysql_init in -lmysqlclient... yes
MySQL library and include file(s) were found!
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating docs/docbook/en-en/Makefile
config.status: creating subst
config.status: creating include/config.h
*** Configuration summary for ndoutils 1.5 02-03-2012 ***: ?General Options:
?-------------------------
?NDO2DB user:??? nagios
?NDO2DB group:?? nagios
Review the options above for accuracy.? If they look okay,
type 'make' to compile the NDO utilities.
?configure是成功的 [root@localhost ndoutils-1-5]# make
cd ./src && make
make[1]: Entering directory `/root/nagios/nd2db_test/ndoutils-1-5/src'
gcc -fPIC -g -O2 -I/usr/local/mysql/include -DHAVE_CONFIG_H? -c -o io.o io.c
在包含自 io.c:11 的文件中:
../include/config.h:261:25: 錯誤:mysql/mysql.h:沒有那個文件或目錄
../include/config.h:262:26: 錯誤:mysql/errmsg.h:沒有那個文件或目錄
make[1]: *** [io.o] 錯誤 1
make[1]: Leaving directory `/root/nagios/nd2db_test/ndoutils-1-5/src'
make: *** [all] 錯誤 2
[root@localhost ndoutils-1-5]# 這里make出錯,那么查看提示,無法找到mysql.h? errmsg.h 先在系統里面找這2個文件 [root@localhost ndoutils-1-5]# find /usr/local/mysql/ -name mysql.h
/usr/local/mysql/include/mysql.h [root@localhost ndoutils-1-5]# find /usr/local/mysql/ -name errmsg.h
/usr/local/mysql/include/errmsg.h 第二看報錯信息? ../include/config.h? 那么由此可以看到? 上面2個出錯文件是由config .h定義的 #include <mysql/mysql.h>
#include <mysql/errmsg.h>
找到這2個文件的位置 從這里可以看出? mysql/mysql.h mysql/errmsg.h? 在系統里面是無法找到的,所以修改如下 #include </usr/local/mysql/include/mysql.h>
#include </usr/local/mysql/include/errmsg.h> 再次make 則順利通過 當然,處理上面的問題,還可以通過建立鏈接的方式 對上面解決問題的思路做一個總結: 編譯源碼包,通常會遇到N多依賴關系,常常提示無法找到某文件,缺少某依賴包,有時候裝上相關軟件,還是無法繼續 往往給我們帶來很多麻煩。對于此類問題,首先是找到錯誤提示信息,針對錯誤提示,分析系統是否有這個文件,再次是分析源碼文件的庫文件相關應用位置,上例中,正是由于庫文件引用不正確導致的,所以很容易就把吃問題解決了。 解決問題的方法不重要,思路卻是最重要的,思路清晰了,方法自然來了 ,希望給大家帶來一點收獲
本文轉自it你好 51CTO博客,原文鏈接:http://blog.51cto.com/itnihao/792286,如需轉載請自行聯系原作者
總結
以上是生活随笔為你收集整理的源码编译依赖关系一例小结的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CentOS系统恢复误删除的文件
- 下一篇: gitlab添加用户