Help with command line option

delphi package - automated exception handling
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Help with command line option

Post by madshi »

These are the IDE settings, though. If you compile in the IDE, everything works fine, doesn't it? This forum thread is about compiling outside of the IDE, which doesn't use the same settings as the IDE.
siUs
Posts: 6
Joined: Tue May 03, 2016 1:27 pm

Re: Help with command line option

Post by siUs »

yes this are the ide settings. and everything is working fine when i compile with the ide.

but i use msbuild to compile outside and this only works when i enable the madExcept in the IDE.
But i want compile outside the IDE with a batch job and don't want to aktivate madExcept every time before running the batch.

so there must something that I don't know or see.

Code: Select all

MSBuild S:\MadTest\Test.dproj /target:Build /p:config=Debug
Shouldn't msbuild use the IDE-Debug-settings with that parameter "/p:config=Debug"?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Help with command line option

Post by madshi »

I'm not really a big expert with using msbuild. I don't know exactly which settings it uses. Can you create a zip file for me with the EXE + MAP files that you get from msbuild, without having running madExceptPatch.exe yet? Also please include your MES file.
siUs
Posts: 6
Joined: Tue May 03, 2016 1:27 pm

Re: Help with command line option

Post by siUs »

done, so how can I give you the zip-file. size is about 3.5mb.

thanks so far
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Help with command line option

Post by madshi »

You can upload it somewhere, there are many free file hosts.
ciuly
Posts: 65
Joined: Mon Apr 30, 2007 1:16 pm
Location: Romania

Re: Help with command line option

Post by ciuly »

I have a feeling that he disables madexcept from the IDE and expects the command line build to do its magic. If so, madExcept conditional define must be passed along the command line and also the uses clause must be re-added to the project(s)and ifdefed accordingly.
But I have the feeling the root cause of the problem is something else, moist likely the need to not have madexcept in release build, which is why they disabled it in the IDE. Am I close?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Help with command line option

Post by madshi »

Could be good guesses!
siUs
Posts: 6
Joined: Tue May 03, 2016 1:27 pm

Re: Help with command line option

Post by siUs »

https://www.dropbox.com/s/4p23aioucf5apl8/Test.zip?dl=0

@ciuly you are right. I don't want to activate madexcept when I am developing but when I build a version with the commandline madexcept should by activated.

so I have to open in my batch-job the test.dpr file, insert after the uses the madexcept units (madExcept, madLinkDisAsm, madListHardware, madListProcesses, madListModules)
save the file, go on with msbuild and madExceptPatch?
ciuly
Posts: 65
Joined: Mon Apr 30, 2007 1:16 pm
Location: Romania

Re: Help with command line option

Post by ciuly »

no. You go to the IDE, open the project source and add the units like so

Code: Select all

uses
  FastMM4, (if you use it)
  {$IFDEF madExcept}
  madEx units here
  {$ENDIF}
  res tof units here;
begin
  ...
end.
you modify the build command to pass madExcept as a conditional define. I prefer creating a dedicated build configuration in the IDE. You can see most your options here: http://stackoverflow.com/questions/8507 ... mmand-line
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Help with command line option

Post by madshi »

Also, the MES file that madExceptPatch uses must have madExcept enabled. Furthermore, if madExcept removes the madExcept units from your uses clause, when running in the IDE, you can add a comment "// dontTouchUses" above your dpr's uses clause, then madExcept will leave your uses clause alone.
siUs
Posts: 6
Joined: Tue May 03, 2016 1:27 pm

Re: Help with command line option

Post by siUs »

it works. thanks to madshi and ciuly for their patience with me.

my probleme was the missing unit entries in the *.dpr file after the uses (tought the magic will do that for me :wink:) and the hint with the comment after uses so that the madexcept units stay after compiling with the IDE and disabled madexcept.
Post Reply