Forum > Options

"Set compiler options as default" does NOT save custom paths

(1/2) > >>

lazaruser:
Hi.
Please, does anyone know, how to you make the compiler options Paths stay the way I set them up for all new created projects?

What I tried is:
1. Open Lazarus, create and save new empty project.
2. Set up my own Project options > Compiler options > Paths > Unit output directory and Target file name.
3. Checked Set compiler options as default.
4. Saved and closed the project.

Alas, after creating another empty project, although at first it seems my custom paths are visible in the Project options, once I save that project, the paths revert to the "factory" defaults.

It's weird because other options, ie. Compilation and Linking or Debugging, are all preserved, just the Paths are resetting.

Please, advise.

ASBzone:
What version of Lazarus, FPC and OS?

lazaruser:
Hi.
Thank you for response. And sorry, I should've write that in the first place.

I've downloaded the installer yesterday and I'm currently using
Lazarus 2.0.12 fpc 3.2.0 SVN revision 64642 x86_64-win64-win32/win64

After a clean install I've only changed language to English and added 1 package (AnchorDockingDsgn 1.0).

My OS is Windows 7 x64 SP1.

I've checked yet again and confirmed: if I change the Paths ie.
Unit output directory to lib\$(TargetCPU)-$(TargetOS)
and Target file name to release\$(TargetOS)-$(TargetCPU)\$NameOnly($(ProjFile))
in the Project options > Compiler options the values are stored properly until the moment I save the project.
Then when I re-open the options my paths are gone ie.
Unit output directory reverts to lib\$(TargetOS)-$(TargetCPU)
and Target file name to literal project1.

Cheers.

Ps. I'm sory, mods, for a double post (same message in the other thread). Won't happen again.

wp:
Normally there is no need to change the paths in the Lazarus settings. In this respect, Lazarus is fundamentally different from Delphi. When a new component is added to Delphi the unit path is extended by the path to the new component so that this path gets longer and longer. In Lazarus, you work with packages: when you need a unit of some package you add the package to the requirements of the project ("Project" > "Project inspector" > "Add" > "New requirement" > select the package from the dialog). The IDE takes care of finding the related units without extending the overall unit path.

Extending the unit path will result in a variety of severe compilation issues. Don't do this. This is only needed for the within-project paths when a project distributes its units over several directories. Delete the ppu output directory of your project and recompile it.

lazaruser:
Hi.
I understand, but then if I want to compile to many different targets at once (Compile many Modes), I have to do it one by one and manually rename/move the executable, otherwise it gets overwritten.
I found a nice tutorial the other day explaining how to add many build modes and seemingly easily cross compile (link: youtube.com/watch?v=qOzreCx2xWA ) a single project to many targets.
I gues that procedure is no longer valid. The documentation to the IDE is lacking, to say the least, so it's double dissapointing that instructions like these can get obsolete so fast.

Then again, I just found out that cross compiling with Lazurus in general isn't as straight forward as one might think. Apparently if you're using Windows you can't just add many build modes for different target architectures/OSes and expect a single Lazarus installation to built all the different executables.

Regardless, if the IDE offers me options to modify I expect it to respect my choices and not just cancel them without reason.

Also it's inconsistent that you can have Unit output directory go to lib\$(TargetOS)-$(TargetCPU), but not with the executables.

Also that's not entirely true, because as I said, unless I save the project my setting for Target file name (and the other one) will work as intended.
IMO, at this point this behavior has to be considered a bug and if these options are so volatile they have to be forcibly kept a certain way they shouldn't be exposed to the user IMO and the documentation/help should explicitly warn about changing them.

Cheers.

Navigation

[0] Message Index

[#] Next page

Go to full version