Recent

Author Topic: Strange error message when adding components to form  (Read 2191 times)

BLL

  • Sr. Member
  • ****
  • Posts: 276
Strange error message when adding components to form
« on: October 08, 2015, 09:19:30 pm »
Hi, I am quite new to lazarus, havng used CBuilder for years. I am finding the IDE very complicated! I had started to write a new application and had added various buttons, labels etc with no problems. Then, without rhyme or reason, I can no longer do so! Now, when I try and add any component to the main form, I get the following error dialogue:
The Codetools found an error
No scanner found for "/home/pi/Lazarus/Apps/Buccaneer/main.lfm"
If this is an error, please open the main source first.
I have no idea what a scanner is! main.lfm is my main form.
If I create another project, all is fine, so I don't have a clue what has happened and the dialogue is as clear as mud!!
Can someone tell me what has happened and why and how to get rid of the error?

I am using fpc 3.1.1 and lazarus 1.5 on a raspberry Pi

Thanks

Brian

Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: Strange error message when adding components to form
« Reply #1 on: October 09, 2015, 11:29:02 am »
One of your components might be referencing the Buccaneer scanner.
You might have looked at a demo and somehow transposed part of that demo into your program. This is quite easy if you say yes to saving the form before starting a project.

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Strange error message when adding components to form
« Reply #2 on: October 09, 2015, 03:06:32 pm »
Apparently this error has already happened in the past in some -rare- cases:

http://forum.lazarus.freepascal.org/index.php/topic,22034
http://forum.lazarus.freepascal.org/index.php/topic,21348

Looking at the source code, this message is present in codetoolmanager.pas:
Code: Pascal  [Select][+][-]
  1. function TCodeToolManager.GetCodeToolForSource(Code: TCodeBuffer;
  2.   GoToMainCode, ExceptionOnError: boolean): TCustomCodeTool;
  3. // return a codetool for the source
  4. ...
  5.   Result:=FindCodeToolForSource(Code);
  6.   if Result=nil then begin
  7.     CreateScanner(Code);
  8.     if Code.Scanner=nil then begin
  9.       if ExceptionOnError then
  10.         raise ECodeToolManagerError.CreateFmt(ctsNoScannerFound,[Code.Filename]);
  11.       exit;
  12.     end;
  13.  
  14. ...
  15.  
  16.   // codetoolsmanager
  17.   ctsNoScannerFound = 'No scanner found for "%s".'
  18.       +' If this is an include file, please open the main source first.';
  19.  
  20.  

Sorry, I don't have any answer concerning a fix  for this issue...

I you look at the above topic, one people has solved all his troubles with a re-installation, while another one has just closed the offending form.

Deleting the .lps file of your project might eventually help (save it before deleting it); I just don't know...

Someone else with a better knowledge concerning the IDE may have the answer.
« Last Edit: October 09, 2015, 03:19:09 pm by ChrisF »

BLL

  • Sr. Member
  • ****
  • Posts: 276
Re: Strange error message when adding components to form
« Reply #3 on: October 09, 2015, 08:29:20 pm »
Hi, Thanks for the replies but I still don't know what this scanner is for! I think that Zath has the probable cause - I was pasting some code from another app into this one. If a project is this easy to ruin, it doesn't say much for lazarus!! It's a shame that the IDE is so complex and apparently unreliable compared with the various versions of CBuilder I have and do use!

 

TinyPortal © 2005-2018