View Full Version : EurekaLog expands conditional defines
micronav
23-Jun-2009, 01:59 PM
Hi,
I have a problem that is very similar to this one:
http://news.eurekalog.com/showthread.php?t=2272&highlight=defines
We are running CodeGear C++Builder 2007 and EurekaLog 6.0.21 RC 3 Pro.
We have setup our projects with a 'Base' setting in BCC_Defines:
<BCC_Defines>__BUILDING_THE_DLL</BCC_Defines>
And in the same project the 'Debug' configuration is:
<BCC_Defines>_MNLDEBUG_;$(BCC_Defines)</BCC_Defines>
So the $(BCC_Defines) part is causing the Debug options to be merged with the base options.
However.
When I activate EurekaLog on this project it changes the 'Debug' configuration to:
<BCC_Defines>_MNLDEBUG_;__BUILDING_THE_DLL;EUREKALOG;EUREKALOG_ VER6</BCC_Defines>
You can see the $(BCC_Defines) has been expanded, but this option is no longer merged with the 'Base' one. Any future changes to the 'Base' configuration will be lost.
Can this be fixed so that the $(BCC_Define) in the 'Debug' configuration is not expanded.
Regards,
Micronav.
Alex
24-Jun-2009, 09:52 AM
Hi,
Unfortunately this looks like limitation of IDE's API itself. EurekaLog do not perform any variable expanding. It just call IOTAProject.ProjectOptions.Values['BCC_Defines'] to get this string and adds EurekaLog's defines to it. That's all.
I've added this as suggestion for v7. May be we'll be able to find workaround.
Albert Wiersch
07-Jul-2009, 06:27 PM
I'm having some very annoying and time wasting define problems as well, in C++Builder 2009. This didn't seem to happen until a few weeks ago so maybe it has something to do with an update. I don't know if it's a C++Builder issue and/or an EurekaLog issue but I hope this gets looked into in case it is a EurekaLog issue.
Albert Wiersch
08-Jul-2009, 05:49 PM
I uninstalled EurekaLog and the problems went away so there is a serious and annoying problem that has recently occurred and it is most likely EurekaLog or something it is doing. Maybe it has something to do with a change made in one of the C++Builder updates that doesn't work well with EurekaLog? Anyway, I can't use EurekaLog until this is fixed. Please address the issue where the defines get "messed up" ASAP. Thanks!
micronav
10-Jul-2009, 04:51 PM
Hi Alex,
I've done some investigation of my own and I think I have a solution that you could implement:
String orig := IOTAProject.ProjectOptions.Values['BCC_Defines'];
// get base value
IOTAProject.ProjectOptions.Values['BCC_Defines'] = '$(BCC_Defines)';
String base := IOTAProject.ProjectOptions.Values['BCC_Defines'];
// replace base in original
String update := StringReplace( orig, base, '$(BCC_Defines)', [] );
// modify settings
// .....
// write new settings
IOTAProject.ProjectOptions.Values['BCC_Defines'] := update;
Forgive me if the code doesn't compile, we use C++ so I'm converting to Pascal as I write. I'd dearly love to see this in a RC soon that we could try.
Hope this helps,
Ken.
Alex
11-Jul-2009, 12:57 PM
2 micronav:
Hi, unfortunately, this is not decision.
If I have some absolute settings, which so happens that it is match BCC_Defines, then your code will replace my absolute settings with $(BCC_Defines) variable.
You just inverted the situation.
This solution can be not acceptable for everyone. You can implement it for yourself, if you have Enterprose version of EurekaLog.
But we need another solution to implement it in EurekaLog itself.
2 Albert Wiersch:
Hi, can you describe your problem, please?
Do you switch EurekaLog on and off very often?
Honestly, I can not see, why this is a big problem. As I understood, this happens only when you change EL's settings (turn it off and on). Can someone enlighten me?
Alex
11-Jul-2009, 01:26 PM
BTW, it looks like C++ Builder bug.
I tried to reproduce this issue in Delphi and can not reproduce it. The defines are added correctly. But the same actions lead to mentioned above behavior on C++ Builder.
Can you try this with the latest updates on C++ Builder installed? Not much hope though, as I tested this in Delphi and C++ Builder 2009.
Albert Wiersch
13-Jul-2009, 03:08 PM
2 Albert Wiersch:
Hi, can you describe your problem, please?
Do you switch EurekaLog on and off very often?
Not exactly sure how to describe it except to say my defines kept being mangled for my various build configurations. Also, sometimes I would get an error when I tried to build - "too many conditional symbols". It was extremely annoying. I didn't switch EurekaLog on and off very often. I believe the problem may have been triggered more by changing build configurations. I really can't live with this issue so I can't use EurekaLog anymore until this is resolved. The latest release of my application does not use it. :(
I suspect the problem may be related to the latest C++Builder 2009 updates as I do not recall having this problem before.
Alex
14-Jul-2009, 08:31 AM
Hi, Albert.
May be this is a temporary workaround, but you can make this: turn on EurekaLog, set all options and save its configuration to file (there is "Export" button). Turn off EurekaLog (you may disable IDE expert too).
If you use EurekaLog only for production version, then you should run ecc32 for your application before testing/deployment.
If you use EurekaLog during developing too, then you can use Delphi's post builds events to call ecc32 for your project.
Calling ecc32 will embed EurekaLog information into your executable. You can specify a configuration file for ecc32, which you've saved earlier.
ecc32 does not modify any configuration files.
Just make sure, that you have ExceptionLog unit at very first unit in your project's file and appropriate project's settings (like full map generation) - those issues usually carry out by IDE expert, but since we don't use it now, we now should do these checks manually.
See also: http://blog.eurekalog.com/?p=35 for more info about command-line compilation.
Yes, I know, that may look ugly, but unfortunately, I can not see any other way. We'll be working on this issue to resolve it.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.