That should be fine, but just so you know there is something wrong with your configuration or setup given what your described in your previous posts. The directive {$mode delphi} should have been included in {$i codebot.inc}, causing no issues with the type declaration of "TArray<T> = array of T", but it was generating error. This should not have happened, so there is likely some other issue in need of fixing related to your configuration.
I would advise you to remove all reference to fpc and lazarus from your path, and to delete both rm $HOME/.fpc.cfg and rm -rf $HOME/.lazarus. After that this command should return nothing:
$ which fpc
Next find out where the fpc you want to use is located, and generate a fresh fpc.cfg in that folder using fpcmkcfg. Assuming you have fpc in a folder such as $HOME/fpc/bin/, place this script in $HOME/fpc/
#!/bin/bash
# save as setup.sh
# chmod +x setup.sh
# source./setup.sh
if [ -z ${OLDPATH+x} ]; then
OLDPATH=$PATH
else
PATH=$OLDPATH
fi
BASE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export PPC_CONFIG_PATH=$BASE/bin
rm $PPC_CONFIG_PATH/fpc.cfg > /dev/null 2>&1
$PPC_CONFIG_PATH/fpcmkcfg -d basepath=$BASE/lib/fpc/\$FPCVERSION -o $PPC_CONFIG_PATH/fpc.cfg
export PATH=$PPC_CONFIG_PATH:$OLDPATH
Running the above script using the source command ($ source ./setup.sh) will generate a correct fpc.cfg in $HOME/fpc/bin, and also put PPC_CONFIG_PATH in your path. After the script has been sourced in your bash session, typing this in the same terminal:
$ fpc -iV
Should output the correct fpc version.In my case that is:
3.1.1
But everything should work fine with 3.0.2 as well. After than you need to reconfigure Lazarus.
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ -z ${OLDPATH+x} ]; then
OLDPATH=$PATH
else
PATH=$OLDPATH
fi
BASE=$DIR/fpc
export PPC_CONFIG_PATH=$BASE/bin
rm $PPC_CONFIG_PATH/fpc.cfg > /dev/null 2>&1
$PPC_CONFIG_PATH/fpcmkcfg -d basepath=$BASE/lib/fpc/\$FPCVERSION -o $PPC_CONFIG_PATH/fpc.cfg
export PATH=$PPC_CONFIG_PATH:$OLDPATH
cd $DIR/lazarus
./lazarus --pcp=config
The last line of the above script tells lazarus to use the config folder inside the lazarus folder to store all its settings.