Editing Default Redirection RED file to create .LIB with .DLL in project folder

The redirection file in Clarion determines where the IDE reads files from, and writes files to.

By default, EXE and DLL files are created in the same folder as the APP, but LIB files are stored in 2 places, in \OBJ\DEBUG when compiling in debug mode and \OBJ\RELEASE when compiling in release mode.

Unfortunately separating DLL and LIB files can cause some major problems in your app, ones which are difficult to spot and can result in “random” (very strange) behaviours. This is especially the case where you have done say, a full release build of your system, and then at some later time start to compile one (or more) apps in debug mode to find a bug.

Fortunately eradicating a whole class of problems is trivial to do by editing the Redirection file to place LIB files in the same folder as the DLL. This makes sense, the LIB and DLL are created at the same time and must “match” storing an old copy of the LIB in another folder can only lead to pain and suffering.

to edit the Redirection file go to the Tools menu in the IDE.

At a minimum add the following line to both the [DEBUG] and the [RELEASE] sections.

*.lib = .

This explicitly tells the system to create libs into the local folder (the same folder as the app.)

I usually make it explicit for all 3 file types.

*.lib = .
*.dll = .
*.exe = .

this saves a possible problem if the *.dll or *.exe entry lower down does not begin with . - leading to files being created in the Clarion folder, not the app folder (a source of a whole other kind of problem.)

4 Likes

This is one of the best tips ever!
A picture may make this easer than reading.
Add the .Lib in 2 places: [Debug] and [Release]

1 Like

While you’re editing your RED file consider making the changes from this post to use the Debug ClaRun.DLL so the Exception window gives you Procedure and Routine Names in the Call Stack .

To get Line Numbers in the call stack on the Project Compiling tab check the box “Add Line Number information to MAP”

1 Like

by way of an update, my RED file now contains;

[Debug]
– Directories only used when building with Debug configuration

*.obj = c:\tempobj
*.$$$ = c:\tempobj
*.res = c:\tempobj
*.rsc = c:\tempobj
*.lib = .
*.dll = .
*.exe = .
*.FileList.xml = c:\tempobj
*.map = c:\tempobj
*.bat = .

[Release]
– Directories only used when building with Release configuration
*.$$$ = c:\tempobj
*.obj = c:\tempobj
*.res = c:\tempobj
*.rsc = c:\tempobj
*.lib = .
*.dll = .
*.exe = .
*.FileList.xml = c:\tempobj
*.map = c:\tempobj
*.bat = .

1 Like

Hi Bruce,

Thank you for sharing! So all unnecessary stuff is dumped into 1 central temp folder?
I see that also the .map file is placed into this folder?

Best regards
Jeffrey