Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-05

TRichMemo and current Lazarus

7 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

Following on from my questions about simulating a terminal emulator with colour and insertion-point marker.

I'm trying to work by creating the TRichMemo under code-control rather than using the IDE, so that I can easily enable/disable it depending on what packages etc. are available.

Running 0.9.30.4 with 2.6.0 using GTK2 on Debian "Squeeze" x86, I've got RichMemo from SVN. To install the package I found I had to patch as described at http://bugs.freepascal.org/view.php?id=17319.

With references to RichEdit, my terminal emulator compiles, but at linkage I get

/usr/local/src/x2741/trunk/lib/i386-linux/richmemo.o: In function `TCUSTOMRICHMEMO__WSREGISTERCLASS':
/usr/local/src/richmemo/richmemo.pas:180: undefined reference to `WSRegisterCustomRichMemo'

Any suggestions would be appreciated.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Ludo Brands
to Mark Morgan Lloyd
Show quoted text 17 lines
I'm trying to work by creating the TRichMemo under code-control rather than using the IDE, so that I can easily enable/disable it depending on what packages etc. are available. With references to RichEdit, my terminal emulator compiles, but at linkage I get /usr/local/src/x2741/trunk/lib/i386-linux/richmemo.o: In function `TCUSTOMRICHMEMO__WSREGISTERCLASS': /usr/local/src/richmemo/richmemo.pas:180: undefined reference to `WSRegisterCustomRichMemo' Any suggestions would be appreciated.

WSRegisterCustomRichMemo is defined in the unit RichMemoFactory. Richmemopackage.pas has this in the uses clause. So add RichMemoFactory to the uses clause of your program. Perhaps some others need to be added too but they should be listed in Richmemopackage.pas.

Ludo

Reply by email

Ludo Brands
to Ludo Brands
Show quoted text 6 lines
WSRegisterCustomRichMemo is defined in the unit RichMemoFactory. Richmemopackage.pas has this in the uses clause. So add RichMemoFactory to the uses clause of your program. Perhaps some others need to be added too but they should be listed in Richmemopackage.pas.

Double checked: RichMemo and RichMemoFactory is enough. No other units needed.

Ludo

Reply by email

Mark Morgan Lloyd
to Ludo Brands: WSRegisterCustomRichMemo is defined in the unit RichMemoFactory. Richmemopackage.pas has…
Ludo Brands wrote 22 lines
> I'm trying to work by creating the TRichMemo under > code-control rather > than using the IDE, so that I can easily enable/disable it > depending on > what packages etc. are available. > > > With references to RichEdit, my terminal emulator compiles, but at > linkage I get > > /usr/local/src/x2741/trunk/lib/i386-linux/richmemo.o: In function > `TCUSTOMRICHMEMO__WSREGISTERCLASS': > /usr/local/src/richmemo/richmemo.pas:180: undefined reference to > `WSRegisterCustomRichMemo' > > Any suggestions would be appreciated. > WSRegisterCustomRichMemo is defined in the unit RichMemoFactory. Richmemopackage.pas has this in the uses clause. So add RichMemoFactory to the uses clause of your program. Perhaps some others need to be added too but they should be listed in Richmemopackage.pas.

Thanks Ludo, I'll try that in about an hour.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Mark Morgan Lloyd
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 24 lines
Ludo Brands wrote: >> I'm trying to work by creating the TRichMemo under code-control >> rather than using the IDE, so that I can easily enable/disable it >> depending on what packages etc. are available. >> >> >> With references to RichEdit, my terminal emulator compiles, but at >> linkage I get >> >> /usr/local/src/x2741/trunk/lib/i386-linux/richmemo.o: In function >> `TCUSTOMRICHMEMO__WSREGISTERCLASS': >> /usr/local/src/richmemo/richmemo.pas:180: undefined reference to >> `WSRegisterCustomRichMemo' >> >> Any suggestions would be appreciated. >> > > WSRegisterCustomRichMemo is defined in the unit RichMemoFactory. > Richmemopackage.pas has this in the uses clause. So add > RichMemoFactory to > the uses clause of your program. Perhaps some others need to be added too > but they should be listed in Richmemopackage.pas. Thanks Ludo, I'll try that in about an hour.

I've added RichMemoFactory in the uses statements that have RichMemo, but I'm now getting things like

config.pas(1,1) Fatal: Unit RichMemoFactory searched but RichMemo found

Because I'm not adding the RichMemo using the IDE, it doesn't appear in the main project source file. I've not tried adding the directory containing the RichEdit to any of my paths, since Googling earlier suggested this was a Really Bad Idea.

Can anybody tell me what obvious point I'm missing? :-)

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Ludo Brands
to Mark Morgan Lloyd
Show quoted text 15 lines
I've added RichMemoFactory in the uses statements that have RichMemo, but I'm now getting things like config.pas(1,1) Fatal: Unit RichMemoFactory searched but RichMemo found Because I'm not adding the RichMemo using the IDE, it doesn't appear in the main project source file. I've not tried adding the directory containing the RichEdit to any of my paths, since Googling earlier suggested this was a Really Bad Idea. Can anybody tell me what obvious point I'm missing? :-)

You have to add the paths to richmemo and richmemo/gtk2 to the unit file search path (-Fu) or the path to richmemo/lib/xyz-linux/ to the libraries search path (-Fl). The latter only works if the richmemo was compiled before (installed the package in the IDE .fe).

Don't know why this would be a Really Bad Idea. The unit path could lead to lazarus rebuilding when you do a full build of your project which won't happen when using the library path.

Ludo

Reply by email

Mark Morgan Lloyd
to Ludo Brands
Ludo Brands wrote 19 lines
> I've added RichMemoFactory in the uses statements that have > RichMemo, > but I'm now getting things like > > config.pas(1,1) Fatal: Unit RichMemoFactory searched but > RichMemo found > > Because I'm not adding the RichMemo using the IDE, it doesn't > appear in > the main project source file. I've not tried adding the directory > containing the RichEdit to any of my paths, since Googling earlier > suggested this was a Really Bad Idea. > > Can anybody tell me what obvious point I'm missing? :-) You have to add the paths to richmemo and richmemo/gtk2 to the unit file search path (-Fu) or the path to richmemo/lib/xyz-linux/ to the libraries search path (-Fl). The latter only works if the richmemo was compiled before (installed the package in the IDE .fe).

Thanks Ludo: compiles and links OK, so now all I've got to do is get it working :-)

Thanks in particular for explaining both -Fu and -Fl, which is particularly relevant bearing in mind the way I'm trying to build the app.

Don't know why this would be a Really Bad Idea. The unit path could lead to lazarus rebuilding when you do a full build of your project which won't happen when using the library path.

I could be misinterpreting things, I suspect the comment was specifically about adding an extra path to the LCL.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email