Subject | Re: [IBO] Packages |
---|---|
Author | Geoff Worboys |
Post date | 2002-01-01T04:55:53Z |
> We couldn't get that to work so we copied the DCUs and the BPLs andThe DCUs (and .DFMs and .RES files) are required in the search path if
> then compiled the package with no debug information. I am still
> getting hung up trying to trace through my code. I keep getting
> errors looking for .IMP files, etc. Did I miss something?
you want to create an all-in-one executable, so that the compiled code
and resourcese can be linked with your own code. They are not required
if you are going to use the runtime packages (.BPLs).
If you are getting errors about missing files during debug, then it
is because the DCUs contain debug information. I had presumed that
your above statement: "copied the ... and then compiled" was a typo,
but perhaps not :-)
You must **build** the IBO library after changing the debug settings,
to ensure all DCUs have been fully regenerated (without debug
information) THEN copy the .DCU (and .dfm and .res) files to the
separate location (more below).
Another possibility - I am talking about all the debug options under
the "Compiler" tab of the project options. The debug options under
the "Linker" tab apply to .exe and .dll and not packages.
The problem with the Delphi "build" option is that it wants to rebuild
all units linked with the executable. (Or at least those for which it
can find source in the search path.) Actually its not a problem, just
something that it has to do to truly do a full rebuild.
Regrettably one of the shortcomings of Delphi/Pascal is its lack of
support for distributing statically linkable code. It does not seem to
have the more simplified library options of C/C++. They have tried to
"fudge" it with .DPC files but its not quite the same thing. Anyway...
To support using IBO with all-in-one executables but without debugging
into the code there appear to be two options...
1. The simple option:
**IF** you can stop your self from hitting "build" in your project
(and only use compile) then you can get away with simply building the
IBO libraries with all debug options turned off. Leaving the IBO
source path in your application search path and all will be OK (but
only so long as you only "compile" and not "build" the application).
In my experiments under Delphi5, the above situation means that
debugging "step into" (F7) will not attempt to enter IBO source,
because there is no debug information in the linked code.
Note: This restriction on compile-not-build may be acceptable for
small projects, but not for larger projects containing many units.
The reason being that if you change some project options (such as
turning debug on/off) then the only way to have the change take effect
on only your own code is to alter each unit so that the compiler will
detect the change and recompile (with the new settings).
2. The more painful option:
First rebuild IBO with all debug options cleared. Then copy all the
resulting .DCU files, and all the .DFM and .RES files to a separate
directory. (You dont need the <package_name>.res files but its easier
to just do a copy *.res and ignore the small waste).
Then setup your application so that the directory containing the .DCU,
.DFM and .RES files are in the search path BUT the directory
containing all the rest of the IBO source is not.
Side Note: You can also add the IBO source directory to the
application "Debug Source Path". This is a convenient way to support
debugging into the IBO source code (if the library was compiled with
debug options on) WITHOUT it being rebuilt when the application is
rebuilt.
hth
--
Geoff Worboys
Telesis Computing