GD库不支持gdImageCreateTrueColor() ?

rorot 2004-07-09 02:23:13
linux 2.4.20 gcc 3.2 gd 2.0.15
-----------------------
#include "gd.h"
#include <cstdio>

int main()
{
gdImagePtr imTrue = gdImageCreateTrueColor(50, 50);

std::FILE *out = fopen( "line01.png", "wb" );
fclose(out);

return 0;
}
---------------------
[rorot@ccsd cgi]$ g++ line.cpp -lgd
/tmp/ccuNaLpW.o(.text+0x30): In function `main':
: undefined reference to `gdImageCreateTrueColor'
collect2: ld returned 1 exit status

why?

...全文
171 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
rorot 2004-07-10
  • 打赏
  • 举报
回复
linux环境下得,那儿有.dll啊?
diekiss 2004-07-09
  • 打赏
  • 举报
回复
用 gd2.dll,支持此函数
rorot 2004-07-09
  • 打赏
  • 举报
回复
gd.h里面定义了gdImageCreateTrueColor()函数了...
ezdevelop 2004-07-09
  • 打赏
  • 举报
回复
gdImagePtr gdImageCreateTrueColor (int sx, int sy)
{
int i;
gdImagePtr im;
im = (gdImage *) gdMalloc(sizeof(gdImage));
memset(im, 0, sizeof(gdImage));
im->tpixels = (int **) safe_emalloc(sizeof(int *), sy, 0);
im->AA_opacity = (unsigned char **) safe_emalloc(sizeof(unsigned char *), sy, 0);
im->polyInts = 0;
im->polyAllocated = 0;
im->brush = 0;
im->tile = 0;
im->style = 0;
for (i = 0; i < sy; i++) {
im->tpixels[i] = (int *) gdCalloc(sx, sizeof(int));
im->AA_opacity[i] = (unsigned char *) gdCalloc(sx, sizeof(unsigned char));
}
im->sx = sx;
im->sy = sy;
im->transparent = (-1);
im->interlace = 0;
im->trueColor = 1;
/* 2.0.2: alpha blending is now on by default, and saving of alpha is
* off by default. This allows font antialiasing to work as expected
* on the first try in JPEGs -- quite important -- and also allows
* for smaller PNGs when saving of alpha channel is not really
* desired, which it usually isn't!
*/
im->saveAlphaFlag = 0;
im->alphaBlendingFlag = 1;
im->thick = 1;
im->AA = 0;
im->AA_polygon = 0;
im->cx1 = 0;
im->cy1 = 0;
im->cx2 = im->sx - 1;
im->cy2 = im->sy - 1;
return im;
}
ezdevelop 2004-07-09
  • 打赏
  • 举报
回复
看一下gd.h里面有没有定义这个函数吧,最近GD好象经常变的。
xuzuning 2004-07-09
  • 打赏
  • 举报
回复
是ImageCreateTrueColor() 吧?

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧