error: expected declaration specifiers or ‘...’ before ‘FILE’

简介:


error: expected declaration specifiers or ‘...’ before ‘FILE’


In file included from /sever/php/php-5.3.6/ext/gd/libgd/gd_compat.c:8:
/usr/local/jpeg8//include/jpeglib.h:954: error: expected declaration specifiers or ‘...’ before

‘FILE’
/usr/local/jpeg8//include/jpeglib.h:955: error: expected declaration specifiers or ‘...’ before

‘FILE’

make: *** [ext/gd/libgd/gd_compat.lo] Error 1

 


这个问题应该是 库 文件路径问题


 1.安装gd之前,修改gd源码包目录下的gd_png.c

gd_png.c
进入该文件,找到#include "png.h"改成 #include "/usr/local/libpng/include/png.h"

【根据自己安装libpng的目录修改】

 

然后在 ./configure .......安装gd。

 

2.安装php之前,修改php源码包下的gd_compat.c

路径:【/php-5.3.6/ext/gd/libgd】

【根据自己安装libpng的目录修改】

include </usr/local/libpng/include/png.h>

然后再./configure .......安装php

本文转自linux博客51CTO博客,原文链接http://blog.51cto.com/yangzhiming/836892如需转载请自行联系原作者


yangzhimingg

相关文章
|
4月前
|
开发工具
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
gdbusauth.c:1302:11: error: ‘%s’ directive argument is null
63 0
|
9月前
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
error C2449: found ‘{‘ at file scope (missing function header?)和error C2059: syntax error : ‘}‘
69 0
|
10月前
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
error C2041: illegal digit ‘9‘ for base ‘8‘ | error C2059: syntax error: ‘bad suffix on number‘
93 0
error: ‘PRIO_PROCESS’ undeclared
error: ‘PRIO_PROCESS’ undeclared
77 0
error: passing ‘const AppJniCommand’ as ‘this’ argument discards qualifiers [-fpermissive]
error: passing ‘const AppJniCommand’ as ‘this’ argument discards qualifiers [-fpermissive]
68 0
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
error: implicit declaration of function ‘RAND_egd’ [-Werror=implicit-function-declaration]
95 0
|
C语言
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
error: implicit declaration of function ‘VerifyFixClassname‘ is invalid in C99 [-Werror,-Wimplicit-f
111 0
解决办法: error: passing ‘const VideoFrame’ as ‘this’ argument discards qualifiers [-fpermissive]
解决办法: error: passing ‘const VideoFrame’ as ‘this’ argument discards qualifiers [-fpermissive]
171 0
成功解决ParserError: Error tokenizing data. C error: Expected 2 fields in line 53, saw 3
成功解决ParserError: Error tokenizing data. C error: Expected 2 fields in line 53, saw 3