Recent

Author Topic: External compiled program works but faulty in the IDE  (Read 2548 times)

MikeFinch

  • Jr. Member
  • **
  • Posts: 79
External compiled program works but faulty in the IDE
« on: May 24, 2018, 08:38:10 am »
I use Mageia 6 with Lazarus 1.8.2. I used Pierre Muller's four .o files to overwrite those in the rtl subfolder to successfully remove the "crtbeginS.o not found, this will probably cause a linking error" warnings - the first of two similar warnings.
The point of this post is that the compiled program that I am tweaking at the moment does not match with the same code run in the IDE.
Two windows appear (that are coded for) in the compiled program but in the IDE the main window (which fills the screen) brightens a little and becomes frozen. I have to use ctrl-alt-esc to apply the dreaded skull-and-crossbones icon to kill the program (my program, not Lazarus!).
Is there a simple quick answer to this? Otherwise I would have to send someone all of the code to demonstrate the quandry.
Is there some bug in the IDE?
Another thing I have noticed is that (seemingly) too may showmessages seem to sometimes "upset" the system : won't compile. Is this my imagination or is there a rational reason for this?
I am using procedural coding, not object-oriented.
MikeFinch

EXTRA MATERIAL!!


To Pierre Muller ==> I changed the four files in the subfolder rtl as you suggested. In the IDE and after rebooting the computer they seemed to do the job : the two error messages disappear (a brief mention of Florian something-or-other appears instead). However the two error messages then reappeared next time I ran my program. What is going on?
Also I am STILL having those other problems : when I run my program the two forms appear as they should, but only when I use a showmessage prior to displaying the form(s). When I comment out the showmessage line the main form freezes and brightens a little. WHAT ON EARTH IS GOING ON? It seems plain illogical.
Is this a Lazarus thing, a Mageia 6 thing (the new Plasma graphics) or what?
I wish someone could help!
MikeFinch

MORE

Moments after sending the EXTRA MATERIAL I uncommented 'heaptrc' in the .lpr file. THIS SEEMS TO SOLVE THE PROBLEM [?] but what does heaptrc do? I'm no good at the technical innards of Lazarus; maybe someone will care to explain what is going on ...
MikeFinch
« Last Edit: May 26, 2018, 06:07:33 am by MikeFinch »

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: External compiled program works but faulty in the IDE
« Reply #1 on: June 05, 2018, 02:14:39 am »
heaptrc ( heap trace) reports memory usage and left over memory that wasn't released and helps you to
locate where the possible areas can be that are causing the leaks.

 It is a wedge into the memory manager so it can create a tracked list of allocations and deallocations, starting memory
and ending memory..

 When your program exists it will popup a dialog screen showing you the results
The only true wisdom is knowing you know nothing

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: External compiled program works but faulty in the IDE
« Reply #2 on: June 05, 2018, 12:32:40 pm »
I use Mageia 6 with Lazarus 1.8.2. I used Pierre Muller's four .o files to overwrite those in the rtl subfolder to successfully remove the "crtbeginS.o not found, this will probably cause a linking error" warnings - the first of two similar warnings.
That's silly. To remove the crtbegin/end warnings you should include the path to the current GCC lib files. That's all. It does not need any patches. And the warning is harmless in most cases.
E.g.:
Code: Bash  [Select][+][-]
  1. -Fl/usr/lib/gcc/arm-linux-gnueabihf/6.3.0
This path may differ on Mageia but it is there.
Alternatively find out where your current GCC is (whereis GCC && gcc --version), match it to the ./lib with the same version and export GCCLIBDIR=<that path> as an environment variable.
Second alternative: FPC supports GCCLIBDIR=<that path> as a makefile setting, but that is for the compiler and rtl only.
Third (best option) include it in /etc/fpc.cfg as -Fl option'. If you use multiple fpc.cfg's with different paths, include it in all of them.

Hey, presto: warnings are gone....
« Last Edit: June 05, 2018, 01:00:20 pm by Thaddy »
Specialize a type, not a var.

 

TinyPortal © 2005-2018