DLL 我用了TBitmap ,编译时通不过

lovezhou 2003-07-21 03:25:06
我用了TBitmap ,编译时通不过,当然在 Build with runtime package 选定时没问题,如果没有选,编译时所有和TBitmap有关的的都要报错了,请问这是为什么呢?

extern "C"
{
int WINAPI __export getfontwidth(LPSTR outstr, LPSTR lfFaceName,
short int lfOrientation, short int lfHeight,
short int lfWidth, short int lfBold, short int lfItalic)
{
int x,y,ByteLength,width,height;
AnsiString outText;
outText = AnsiString(outstr);
Graphics::TBitmap *pBitmap = new Graphics::TBitmap();
Byte *ptr;
pBitmap->Canvas->Font->Name = lfFaceName;
pBitmap->Canvas->Font->Height = lfHeight;
pBitmap->Height = pBitmap->Canvas->TextHeight(outText);
pBitmap->Width = pBitmap->Canvas->TextWidth(outText);
pBitmap->PixelFormat = pf8bit;
pBitmap->Canvas->TextOutA(0,0,outText);
int firstColum = 0;
int count = 0;
for (x = 0; x < pBitmap->Width ; x ++)
{
bool isLineEmpty = true;
for (y = 0; y < pBitmap->Height ; ++ y)
if (pBitmap->Canvas->Pixels[x][y] == 0)
{
isLineEmpty = false;
break;
}
if ((firstColum == 0) && (!isLineEmpty))
{
firstColum = x;
}
if ((firstColum != 0)&& (!isLineEmpty))
{
++ count;
}
}
return (count);
}
}
...全文
45 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
lovezhou 2003-07-22
  • 打赏
  • 举报
回复
to: ouyongke(只吃源代码的Mouse)

我就是这样试不行,才只好考那些运行库的,动态库这样编译好象有问题我试了两台机了
lovezhou 2003-07-22
  • 打赏
  • 举报
回复
to : Win32CPP(给一点分我吧,升级好难哟!)
早已加在上面了不行的,
我试过IniFile 之类,就没问题
Win32CPP 2003-07-22
  • 打赏
  • 举报
回复
#include <graphics.hpp>
  • 打赏
  • 举报
回复
也就是说,我编的这个DLL在安装过BCB的环境中就没问题但到别的机器上就得带VCL60。BPL等一大堆运行库了,怎么办呢?
  这个我知道!
  在project菜单里有个options选项,运行它在页面上选择packages项把Build with runtime packages的勾去掉,在在页面上选择Linker项,将use dynamic Rtl的勾去掉就可以了。对了,你可不能使用BDE数据库哦,用了那东东只好BCB的安装向导了。
lovezhou 2003-07-21
  • 打赏
  • 举报
回复
》》》要么是工程(Project)有问题,要么是BCB有问题。你新建一个Project,然后将各个cpp
加到Project中再Build看看。

工程文件没问题

to ghostwang(鬼鬼)
我看了下LIB目录什么也看不出来,怎么办有资料吗?

ghostwang 2003-07-21
  • 打赏
  • 举报
回复
找到TImage定义的LIB文件,加到工程中,应该没问题啦
jishiping 2003-07-21
  • 打赏
  • 举报
回复
要么是工程(Project)有问题,要么是BCB有问题。你新建一个Project,然后将各个cpp
加到Project中再Build看看。
lovezhou 2003-07-21
  • 打赏
  • 举报
回复
出错信息:[Linker Error] Unresolved external '__fastcall Graphics::TBitmap::~TBitmap()' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
[Linker Error] Unresolved external 'Graphics::TBitmap::' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
[Linker Error] Unresolved external '__fastcall Graphics::TBitmap::TBitmap()' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
[Linker Error] Unresolved external '__fastcall Graphics::TFont::SetName(const System::AnsiString)' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
[Linker Error] Unresolved external '__fastcall Graphics::TFont::SetHeight(int)' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
[Linker Error] Unresolved external '__fastcall Graphics::TCanvas::TextHeight(const System::AnsiString)' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
[Linker Error] Unresolved external '__fastcall Graphics::TCanvas::TextWidth(const System::AnsiString)' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
[Linker Error] Unresolved external '__fastcall Graphics::TBitmap::SetPixelFormat(Graphics::TPixelFormat)' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
[Linker Error] Unresolved external '__fastcall Graphics::TCanvas::TextOut(int, int, const System::AnsiString)' referenced from D:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\RELEASE\VCLE.LIB|_t_Graph
[Linker Error] Unresolved external '__fastcall Graphics::TBitmap::GetCanvas()' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
[Linker Error] Unresolved external '__fastcall Graphics::TCanvas::GetPixel(int, int)' referenced from C:\JOE\RUNTIAN\WINFONTDLL.OBJ
jishiping 2003-07-21
  • 打赏
  • 举报
回复
报什么错啊?你不写别人怎么知道什么错啊?提问时应该将问题描述清楚。
lovezhou 2003-07-21
  • 打赏
  • 举报
回复
也就是说,我编的这个DLL在安装过BCB的环境中就没问题但到别的机器上就得带VCL60。BPL等一大堆运行库了,怎么办呢?

604

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder VCL组件使用和开发
社区管理员
  • VCL组件使用和开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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