Unit path compiled in executable
Asked Answered
S

1

8

I noticed that in compiled exe there are hard-coded paths to 3rd party components units. For example, if I use VirtualTrees component, TVirtualStringTree, in compiled executable I can find this path several times:

C:\Program Files\Borland\Delphi7\Source\Virtual Treeview\Source\VirtualTrees.pas

This applies to almost all 3rd party components I use, paths to component's units in exe. I think this information should not be in executable, but don't know what I have to change in Delphi 7 settings, or in project's settings, to get rid of it. Does anyone have a solution please?

Scoreboard answered 21/9, 2012 at 19:50 Comment(0)
A
10

What you see are the assertion messages keeping the source of the assert. You can disable them if you go to Project / Options or using CTRL + SHIFT + F11 shortcut which opens the project options dialog.

There uncheck the Assertions check box in the Compiler tab, save the project options and rebuild the project. Not recompile, but rebuild!

enter image description here

The paths in your binary you will see always when you use Assert when you'll have that option turned on.

Argentous answered 21/9, 2012 at 20:16 Comment(3)
You're welcome! Anyway, you should keep the assertions enabled in your debug environment and turn them off just when you're going to build a release version. That can be easily done from a batch file build script.Argentous
@Shadi: Keeping asserts on can actually be very useful. Your internal testing will never catch every possible error condition, and having assertions around provides protection against data corruption. (It's even more useful if you're also using an error reporting tool, like MadExcept or EurekaLog.)Intermediate
@MasonWheeler +1 for your comment. IMHO assertions are not to be confused with unit testing, and should always be left enabled. An assertion should check something which may break the execution due to a code logic, like an un-set parameter or an invalid sequence call to a method. Such logic issues can not be defined at compile time, but could be tracked with assertions at run-time. This is something diverse to unit-testing.Leatherleaf

© 2022 - 2024 — McMap. All rights reserved.