Forum > FPC development

[Solved] Problem extending FPC

(1/2) > >>

Mike.Cornflake:
I'm trying my hand at extending fpc trunk.  Simple changes (final code will be slightly different, I'm aware that at the moment the user can pass undesired options to TProcess)

process.pp

--- Code: ---//old
function RunCommand(const exename:string;const commands:array of string;var outputstring:string):boolean;
function RunCommand(const cmdline:string;var outputstring:string):boolean; deprecated;

//new
function RunCommand(const exename:string;const commands:array of string;var outputstring:string;const AExtraProcessOptions:TProcessOptions=[]):boolean;
function RunCommand(const cmdline:string;var outputstring:string;const AExtraProcessOptions:TProcessOptions=[]):boolean; deprecated;
--- End code ---

My development environment is Lazarus Trunk.
I rebuild fpc with make clean all, and I've good confidence that's working.  If I introduce syntax errors into my process.pp, then this rebuild bombs out at the expected place.
I then rebuild lazarus with clean all as well.  And finally try to rebuild my test app with "clean up build files"

No matter what I try, I always end up with...

--- Quote ---FormMain.pas(161,7) Error: Wrong number of parameters specified for call to "RunCommand"
Error: Found declaration: RunCommand(const AnsiString;const {Open} Array Of AnsiString;var AnsiString):Boolean;
Error: Found declaration: RunCommand(const AnsiString;var AnsiString):Boolean;
--- End quote ---

Line 167 is

--- Code: ---      RunCommand(MplayerControl1.MPlayerPath, arrCommands, sOutput, [poNoConsole]);
--- End code ---

ctrl-clicking on RunCommand in my form takes me to the modified process.pp, and as I said, I've clean rebuilt everything I can think of.

All paths defined in Lazarus - Tools - Options are pointing to the trunk fpc that I'm modifiying.

What step am I missing, or where I can look to find to another path that might be incorrect?

BigChimp:
Wild guess (haven't read closely) Tools/Rescan FPC source directory in Lazarus after rebuild

Mike.Cornflake:
Many thanks for the ultra quick reply, but no go I'm afraid...

UPDATE:  Hmmm.  If I introduce syntax errors into process.pp, then the Lazarus rebuild doesn't fail, it just continues right on :-(

BigChimp:
Mmm, a bit
--- Quote from: Mike.Cornflake on June 28, 2014, 11:43:10 am ---I rebuild fpc with make clean all, and I've good confidence that's working.  If I introduce syntax errors into my process.pp, then this rebuild bombs out at the expected place.
I then rebuild lazarus with clean all as well.  And finally try to rebuild my test app with "clean up build files"

--- End quote ---
Ah... building fpc with make clean all will rebuild FPC but not copy the compiled units into the (fpcdir)\units directory.
I'd suggest doing make clean all install or if that doesn't work make clean all followed by make install.
Then rebuild Lazarus.

BigChimp:
Or, of course <cue drumroll> fpcup using settings like this:

--- Code: ---[buildonly]
; no checkout/update
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
fpcdir=c:\development\fpctrunk
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
lazdir=c:\development\lazarus
primary-config-path=c:\development\lazarussettings
;fpcopt=""
fpcopt="-gw2 -gl -O-1"
;fpcrevision=27774
fpcuplinkname=""
lazlinkname=Laz32FPCTrunk
lazopt="-gw2 -gl -O-1"
noconfirm=true
keeplocalchanges=true
synapsetrunk=1
only=FPCBuildOnly,LazarusBuildOnly,useride
skip=FPCCleanOnly,FPCGetOnly,LazarusCleanOnly,LazarusGetOnly,crosswin32-64

--- End code ---
Basically copy over your existing settings and add the only= and skip= lines to just rebuild FPC and Lazarus
Then run fpcup --inifile=whateveryou'reusing.ini --inisection=buildonly
... or use fpcupgui to select the ini section you want.

</advertisement>

Navigation

[0] Message Index

[#] Next page

Go to full version