Recent

Author Topic: Error using RichMemo in existing application  (Read 4751 times)

uwe

  • New Member
  • *
  • Posts: 13
Error using RichMemo in existing application
« on: December 16, 2011, 12:06:38 pm »
Hi folks,

I have the following problem using the TRichMemo component. I have downloaded and installed the package yesterday and it works fine (I had to include the patch for Lazarus 0.9.30.2 because a function parameter of a function was added). So after doing that I installed the package and created a new project with Lazarus to check it out. It all worked fine so far, the TRichMemo did exactly what I wanted it to.

Then I converted an existing project from Delphi, which worked, too. I can compile the program and run it.
Now If I place a new TRichMemo component on one of the forms of the converted Delphi-project I get the following Linker error during the compilation process:
"Error: Undefined symbol: WSRegisterCustomRichMemo". What I do not understand is why does it work with a new from-scratch application but not with my converted Delphi application? The error remains even if I delete the file from the form again. It only disappears if I also remove RichMemo from the uses clause.

Any ideas?

Thanks for your help.

Uwe

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3652
  • I like bugs.
Re: Error using RichMemo in existing application
« Reply #1 on: December 16, 2011, 01:11:27 pm »
I have the following problem using the TRichMemo component. I have downloaded and installed the package yesterday and it works fine (I had to include the patch for Lazarus 0.9.30.2 because a function parameter of a function was added).

So the TRichMemo version is actually for Lazarus 0.9.31 ?

Quote
Then I converted an existing project from Delphi, which worked, too. I can compile the program and run it.
Now If I place a new TRichMemo component on one of the forms of the converted Delphi-project I get the following Linker error during the compilation process:
"Error: Undefined symbol: WSRegisterCustomRichMemo". What I do not understand is why does it work with a new from-scratch application but not with my converted Delphi application? The error remains even if I delete the file from the form again. It only disappears if I also remove RichMemo from the uses clause.

I don't know what causes the problem. Check the "Required packages" in Project Inspector.
Also check the Paths in Project Options -> Compiler Options.

Juha

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Error using RichMemo in existing application
« Reply #2 on: December 16, 2011, 02:40:00 pm »
Any ideas?

Does your Delphi application have the Interfaces unit in the uses clause and the LCL package as a dependency?

uwe

  • New Member
  • *
  • Posts: 13
Re: Error using RichMemo in existing application
« Reply #3 on: December 16, 2011, 02:52:33 pm »
Hello together,
The "required packages"-node in the project inspector shows the following packages:
- Richmemopackage
-ZVDateTimeCtrl
-LCL

The beginning of the interface section of my converted Delphi application looks like that:
unit MainFrm;

//{$MODE Delphi}
//{$MODE FPC}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, InfoForm,
  Dialogs, StdCtrls, ComCtrls, FileCtrl, Menus, Util, Variants, ShellApi,
  ExtCtrls, SearchUnit, ToolWin, Buttons,    FormMerge, FormSearch,
  DateUtils, Utils, ConfigFrm, Vars, SearchKeywordQueryForm, GoToLineForm,
  UnitLanguages, IniFiles, FunctionsUnit, Interfaces;
                                                           
As soon as I add RichMemo to the uses clause the following error occurs during linking:
"Error: Undefined symbol: WSRegsiterCustomRichMemo".

Thanks again

Uwe

Leledumbo

  • Hero Member
  • *****
  • Posts: 8114
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Error using RichMemo in existing application
« Reply #4 on: December 16, 2011, 04:42:32 pm »
The main program file (.lpr / .dpr) must have Interfaces unit in the uses clause

uwe

  • New Member
  • *
  • Posts: 13
Re: Error using RichMemo in existing application
« Reply #5 on: December 16, 2011, 04:50:02 pm »
The .lpr file does have Interfaces in its uses clause. Also I have ruled out the error in being in the component, I have tried with another component instead (RichEdit)  and I get exactly the same effect. I have tried it with an empty Delphi application that I convert into Lazarus. Same result. The Uses clause in the lpr file now looks like that:

program LogCheck;

//{$MODE Delphi}

uses
  Interfaces,Forms,
  windows,Dialogs,sysutils,
  Util,
  MainFrm in 'MainFrm.pas' {MainForm},
  SearchUnit in 'SearchUnit.pas',
  FormMerge in 'FormMerge.pas' {FRM_MergeSelection},
  FormSearch in 'FormSearch.pas' {FRM_Search},
  Utils in 'Utils.pas',
  ConfigFrm in 'ConfigFrm.pas' {FRM_Configuration},
  vars in 'vars.pas',
  SearchKeywordQueryForm in 'SearchKeywordQueryForm.pas' {FRM_SearchQuery},
  GoToLineForm in 'GoToLineForm.pas' {FRM_GotoLine},
  UnitLanguages in 'UnitLanguages.pas',
  FunctionsUnit in 'FunctionsUnit.pas',
  ConstDef in 'ConstDef.pas';

ARYLIOA

  • New Member
  • *
  • Posts: 23
Re: Error using RichMemo in existing application
« Reply #6 on: May 05, 2012, 06:03:21 pm »
Did you ever come up with a solution?

After some head-scratching, I looked at the sample project that came with RichEdit and saw that his Uses clause also had  richmemopackage, in it.  The the project now links and runs.