Lazarus中文社区

 找回密码
 立即注册(注册审核可向QQ群索取)

QQ登录

只需一步,快速开始

Lazarus IDE and 组件 下载地址版权申明
查看: 2415|回复: 3

自写dll调用产生 'External:SIGSEGV' 错误的解决方法.

[复制链接]

该用户从未签到

发表于 2012-7-19 07:27:59 | 显示全部楼层 |阅读模式
把要调用的函数或过程中的私有局部变量提升为公用的全局变量.

例如

uses
  Classes,SysUtils  //,interfaces, forms
  { you can add units after this };

const
  passwd ='*****';

function GetsomeInfo(avar:string):String;stdcall;

var  F:TextFile;
  Txt:string;  tmpStr, aStr: string;
begin   
something......
end;

{$R *.res}

exports
  GetbaseInfo;

begin

end.

更改为

uses  Classes,SysUtils  //,interfaces, forms  { you can add units after this };
const  passwd ='*****';
var  F:TextFile;  Txt:string;  tmpStr, aStr: string;
function GetsomeInfo(avar:string):String;stdcall;begin    something......
end;
{$R *.res}

exports  GetbaseInfo;

begin
end.
        

评分

参与人数 1威望 +6 收起 理由
猫工 + 6 Lazarus社区有你更精彩!

查看全部评分

回复

使用道具 举报

该用户从未签到

发表于 2012-7-19 13:31:39 | 显示全部楼层
谢谢分享,好象真遇到过这中错误
回复 支持 反对

使用道具 举报

该用户从未签到

发表于 2012-7-19 23:54:33 | 显示全部楼层
这个解决方法比较勉强,应该有别的原因。
回复 支持 反对

使用道具 举报

该用户从未签到

 楼主| 发表于 2012-7-20 15:33:06 | 显示全部楼层
我查不到其他原因了。。就只有一个函数,还没有form界面。
我把全源码放出你帮我看看?
回复 支持 反对

使用道具 举报

*滑块验证:

本版积分规则

QQ|手机版|小黑屋|Lazarus中国|Lazarus中文社区 ( 鄂ICP备16006501号-1 )

GMT+8, 2025-5-2 03:31 , Processed in 0.054052 second(s), 13 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表