[Lazarus] Having trouble using Indy inside command line program
Bo Berglund
bo.berglund at gmail.com
Mon Dec 18 01:05:59 CET 2017
On Sat, 16 Dec 2017 22:16:11 +0100, Bo Berglund via Lazarus
<lazarus at lists.lazarus-ide.org> wrote:
>Compile package indylaz 10.6.2: Exit code 1, Errors: 2
>IdGlobal.pas(1405,14) Error: Identifier not found "Windows"
>IdGlobal.pas(1405,30) Error: Illegal expression
>
This is caused by a seemingly erroneous ifdef construct in the file.
I looked in the Indy repository and found that this has been modified
in a later tagged version of he file without any modification to the
Indy version, which is still the same.
I edited in that modification and then the above error disappeared.
Just a couple of more questions:
1) Why was Lazarus trying to re-compile indylaz when it is already
installed and built? Makes no sense to me....
Of course after I edited the file it will need a recompile, but why
before?
2) Why does my project not find the Indy units when compiling? If I
right-click these in Lazarus and select "Find declaration of" it
immediately opens the specified file. But while compiling I get unit
not found on some.
I have "solved" this by adding the three source directories Core,
Protocols and System to the
Project/Options/CompilerOptions/Paths/OtherUnitFiles
Now the project compiles but it always gives this warning:
Warning: other unit files search path (aka unit path) of "SvnMailer"
contains "D:\Engineering\Projects\CMPFPC\Indy10.6.2\System", which
belongs to package "indylaz"
But if I include indylaz in the uses clauses it errors out like this
instead:
SvnMailer.lpr(23,4) Fatal: Cannot find indylaz used by SvnMailer,
incompatible
ppu=D:\Engineering\Projects\CMPFPC\Indy10.6.2\lib\i386-win32\indylaz.ppu,
package indylaz
Finally, if I remove indylaz as a Required Package for the project,
then it compiles without errors but with a whole lot of warnings and
hints. The warnings deal with string conversions within Indy. Here is
one such, there are a lot more.:
IdSSLOpenSSL.pas(2140,18) Warning: Implicit string type conversion
with potential data loss from "UnicodeString" to "AnsiString"
What is going on here, really..?
3) And what should I do when creating a "Program" application in
Lazarus to make it possible to use the units from indylaz without
fussing with the paths to the Indy sources?
The program should be possible to build also on Linux.
--
Bo Berglund
Developer in Sweden
More information about the Lazarus
mailing list