Recent

Author Topic: Running GUI app raises external: SIGSEGV  (Read 5808 times)

jl

  • Full Member
  • ***
  • Posts: 178
Running GUI app raises external: SIGSEGV
« on: April 09, 2011, 09:41:01 am »
Hi, i'm trying to figure out why i get this exception when i run a simple test GUI application, hope to receive some pointers.  Thanks.


unit Unit1;

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, common;

type

  { TForm1 }

  TForm1 = class(TForm)
    mySMSSender: TWritePort;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
begin

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
    mySMSSender.sCFUN :='test'; <-- exception appears here!
end;

end.


unit common;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils;

type
TWritePort = class(TObject)
  private
    { Private declarations }

  protected
  public
    sCFUN:   string;
    constructor Create;
    destructor Destroy; override;
  end;

implementation

constructor TWritePort.Create;
begin
  inherited Create;
end;

destructor TWritePort.Destroy;
begin
  inherited;
end;

end.

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: Running GUI app raises external: SIGSEGV
« Reply #1 on: April 09, 2011, 10:59:43 am »
what is that component TWritePort ?
it's not in the uses


you miss the:
mySMSSender := TWritePort.Create;
« Last Edit: April 09, 2011, 11:12:47 am by FabienWang »
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

Leledumbo

  • Hero Member
  • *****
  • Posts: 8831
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Running GUI app raises external: SIGSEGV
« Reply #2 on: April 09, 2011, 11:07:49 am »
Quote
Hi, i'm trying to figure out why i get this exception when i run a simple test GUI application, hope to receive some pointers.  Thanks.
I don't see anywhere you create TWritePort instance and assign it to mySMSSender. i.e. nothing like:
Code: [Select]
mySMSSender := TWritePort.Create;
Quote
what is that component TWritePort ?
it's not in the uses
He posts two source, one is the program (above) and the other is the unit named common (below).

jl

  • Full Member
  • ***
  • Posts: 178
Re: Running GUI app raises external: SIGSEGV
« Reply #3 on: April 09, 2011, 11:20:41 am »
what is that component TWritePort ?
it's not in the uses


you miss the:
mySMSSender := TWritePort.Create;


Oh, i missed that, thanks for pointing out.   :o

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: Running GUI app raises external: SIGSEGV
« Reply #4 on: April 09, 2011, 11:27:55 am »
Thanks Leledumbo ^^
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

 

TinyPortal © 2005-2018