我在 Windows 8.1 上使用 Free Pascal 2.6.4 32 位。我想使用 TFileStream 来复制文件。
program copy;
procedure CopyFile (strFilename : string);
var
SourceF, DestF : TFileStream;
begin
end;
begin
writeln('starting ');
end.
编译器无法识别 TFileStream:
fpc copy_small.pas
Free Pascal Compiler version 2.6.4 [2014/03/06] for i386
Copyright (c) 1993-2014 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling copy_small.pas
copy_small.pas(5,33) Error: Identifier not found "TFileStream"
copy_small.pas(5,33) Error: Error in type definition
copy_small.pas(12) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted
Error: C:\FPC\2.6.4\bin\i386-Win32\ppc386.exe returned an error exitcode (normal if you did not specify a source file to be compiled)
我在网上找到的使用 TFileStream 的示例代码没有“uses”子句。为了在 Free Pascal 中使用 TFileStream,是否需要在命令行中设置或包含在程序中?