[fpc-pascal] problem with command line defines??

Jonas Maebe jonas.maebe at elis.ugent.be
Wed Nov 28 19:39:22 CET 2012


On 28 Nov 2012, at 19:22, waldo kitty wrote:

> on OS/2 eCS2 i have fpc 2.6.0 release installed... i've been working with a library and needed to create a define so that some code would be compiled that otherwise is not... since i have to compile from the command line with fpc, i compiled my project like this...
> 
>  fpc -dOS2GCC testhttp
> 
> and it did compile with the defined code block... later, i wanted to test without that defined code block so i compiled again like this...
> 
>  fpc testhttp
> 
> but the library wasn't recompiled... i had to manually remove the *.O and *.ppu files to get it recompiled without the defined code block...
> 
> why?

Changing defines does not cause recompilation of units because e.g. the defines required to compile the FPC RTL or packages are completely unrelated to any defines that may or may not be required for compiling your program. In general, requiring you to specify all defines used for every unit you use in a program would result in an unmaintainable situation. 

Additionally, there are some practical difficulties with adding hints for indicating such situations, see http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/compiler/fppu.pas?annotate=22452#l659


Jonas


More information about the fpc-pascal mailing list