使用 freetype 编译 PHP 错误
我自己配置了 PHP,包括了我需要的所有库......但后来意识到我忘记了 freetype 库。
所以我回到我的 php-5.3.2 目录并运行 ./configure '--with-free-type=/usr/local/lib'
PHP 的配置很好,没有错误。
但是当我运行 make 时:
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1
经常出现的情况是:
/php-5.3.2/ext/libxml/libxml.c:336: undefined reference to `ts_resource_ex'
/php-5.3.2/ext/sqlite3/sqlite3.c:663: undefined reference to `executor_globals_id'
ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_callback_final':
/php-5.3.2/ext/sqlite3/sqlite3.c:811: undefined reference to `ts_resource_ex'
ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_callback_step':
/php-5.3.2/ext/sqlite3/sqlite3.c:799: undefined reference to `ts_resource_ex'
ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_callback_func':
/php-5.3.2/ext/sqlite3/sqlite3.c:788: undefined reference to `ts_resource_ex'
ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_authorizer':
/php-5.3.2/ext/sqlite3/sqlite3.c:1782: undefined reference to `ts_resource_ex'
/php-5.3.2/ext/sqlite3/sqlite3.c:1787: undefined reference to `core_globals_id'
ext/sqlite3/.libs/sqlite3.o: In function `zim_sqlite3_open':
/php-5.3.2/ext/sqlite3/sqlite3.c:161: undefined reference to `core_globals_id'
/php-5.3.2/ext/sqlite3/sqlite3.c:123: undefined reference to `core_globals_id'
未定义的引用出现了多种情况。
所以它在这里失败了,但当我最初编译 PHP 时却没有。这是怎么回事?我需要重新配置整个事情吗?
提前致谢。
I configured PHP myself, included all of the libraries I needed... but then realized I forgot the freetype library.
So I went back to my php-5.3.2 directory and ran ./configure '--with-free-type=/usr/local/lib'
PHP did the configure fine, no errors.
But when I run make:
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1
Something that comes up frequently:
/php-5.3.2/ext/libxml/libxml.c:336: undefined reference to `ts_resource_ex'
/php-5.3.2/ext/sqlite3/sqlite3.c:663: undefined reference to `executor_globals_id'
ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_callback_final':
/php-5.3.2/ext/sqlite3/sqlite3.c:811: undefined reference to `ts_resource_ex'
ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_callback_step':
/php-5.3.2/ext/sqlite3/sqlite3.c:799: undefined reference to `ts_resource_ex'
ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_callback_func':
/php-5.3.2/ext/sqlite3/sqlite3.c:788: undefined reference to `ts_resource_ex'
ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_authorizer':
/php-5.3.2/ext/sqlite3/sqlite3.c:1782: undefined reference to `ts_resource_ex'
/php-5.3.2/ext/sqlite3/sqlite3.c:1787: undefined reference to `core_globals_id'
ext/sqlite3/.libs/sqlite3.o: In function `zim_sqlite3_open':
/php-5.3.2/ext/sqlite3/sqlite3.c:161: undefined reference to `core_globals_id'
/php-5.3.2/ext/sqlite3/sqlite3.c:123: undefined reference to `core_globals_id'
The undefined reference comes up for several things.
So it fails here but it didn't when I initially compiled PHP. What's going on? Do I need to reconfigure the entire thing?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该使用
--with-freetype-dir
代替 freetype 安装前缀的路径:--with-freetype-dir=/usr/local
在您的情况下。当您执行干净构建(
make clean
、configure
、make
)时,编译错误应该消失。You should use
--with-freetype-dir
instead with the path to the freetype install prefix:--with-freetype-dir=/usr/local
in your case.The compile error should go away when you do a clean build (
make clean
,configure
,make
).