Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2002-09

Problem to open an File

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Armin Rohnen

I Have write the function (using ppc386 on WIN2000 System):

function GetMessData: integer;
type
  pak = record
	werte : String[23];
  end;
  PakFile = file of pak;
var
   i : integer;
   F : PakFile;
begin
  Assign(F,'C:\Temp\amag.txt');
  Reset(F);
end;

In the moment, there are not more line in the code of this function. compiling is ok.
but the linker send the error:
-:link.res: file format not recognized; treating as linker script -:link.res:1: parse error
unwucht.pp(165,1) ERROR: ERROR while linking
Closing script ppas.bat

Mit freundlichen Grüßen BMW AG Werk Regensburg TR-451 - Analyse, ATG Integration, Analyse-Werkstätten Akustik Analyse Werk Regensburg Dipl.-Ing. Armin Rohnen DGAQS Herbert-Quandt-Allee 93055 Regensburg Tel.: 0941-770 2565 Mobil: 0179 - 6613999 FAX: 0941 - 770 3433

Reply by email

Armin Rohnen

I Have write the function (using ppc386 on WIN2000 System):

function GetMessData: integer;
type
  pak = record
	werte : String[23];
  end;
  PakFile = file of pak;
var
   i : integer;
   F : PakFile;
begin
  Assign(F,'C:\Temp\amag.txt');
  Reset(F);
end;

In the moment, there are not more line in the code of this function. compiling is ok.
but the linker send the error:
-:link.res: file format not recognized; treating as linker script -:link.res:1: parse error
unwucht.pp(165,1) ERROR: ERROR while linking
Closing script ppas.bat

Mit freundlichen Grüßen BMW AG Werk Regensburg TR-451 - Analyse, ATG Integration, Analyse-Werkstätten Akustik Analyse Werk Regensburg Dipl.-Ing. Armin Rohnen DGAQS Herbert-Quandt-Allee 93055 Regensburg Tel.: 0941-770 2565 Mobil: 0179 - 6613999 FAX: 0941 - 770 3433

Reply by email

Peter Vreman
Show quoted text 29 lines
I Have write the function (using ppc386 on WIN2000 System): function GetMessData: integer; type pak = record werte : String[23]; end; PakFile = file of pak; var i : integer; F : PakFile; begin Assign(F,'C:\Temp\amag.txt'); Reset(F); end; In the moment, there are not more line in the code of this function. compiling is ok. but the linker send the error: -:link.res: file format not recognized; treating as linker script -:link.res:1: parse error unwucht.pp(165,1) ERROR: ERROR while linking Closing script ppas.bat

Please include the link.res also

Reply by email

Armin Rohnen
to Peter Vreman
Show quoted text 32 lines
> I Have write the function (using ppc386 on WIN2000 System): > > function GetMessData: integer; > type > pak = record > werte : String[23]; > end; > > PakFile = file of pak; > > var > i : integer; > F : PakFile; > > begin > > Assign(F,'C:\Temp\amag.txt'); > Reset(F); > > > end; > > In the moment, there are not more line in the code of this function. > compiling is ok. > but the linker send the error: > -:link.res: file format not recognized; treating as linker script > -:link.res:1: parse error > unwucht.pp(165,1) ERROR: ERROR while linking > Closing script ppas.bat Please include the link.res also

The line

{$I LINK.RES} dosnt work
link.res(1,1) Fatal: Syntax error, BEGIN expected but identifier
SEARCH_DIR found

Reply by email

Peter Vreman
Show quoted text 38 lines
> > I Have write the function (using ppc386 on WIN2000 System): > > > > function GetMessData: integer; > > type > > pak = record > > werte : String[23]; > > end; > > > > PakFile = file of pak; > > > > var > > i : integer; > > F : PakFile; > > > > begin > > > > Assign(F,'C:\Temp\amag.txt'); > > Reset(F); > > > > > > end; > > > > In the moment, there are not more line in the code of this function. > > compiling is ok. > > but the linker send the error: > > -:link.res: file format not recognized; treating as linker script > > -:link.res:1: parse error > > unwucht.pp(165,1) ERROR: ERROR while linking > > Closing script ppas.bat > > Please include the link.res also > The line {$I LINK.RES} dosnt work link.res(1,1) Fatal: Syntax error, BEGIN expected but identifier SEARCH_DIR found

Sorry. include/attach the link.res in the mail

Reply by email

Armin Rohnen
to Peter Vreman

I Have write the function (using ppc386 on WIN2000 System):

function GetMessData: integer;
type
   pak = record
       werte : String[23];
   end;
   PakFile = file of pak;
 var
   i : integer;
   F : PakFile;
 begin
  Assign(F,'C:\Temp\amag.txt');
  Reset(F);
 end;

In the moment, there are not more line in the code of this function. compiling is ok.
but the linker send the error:
-:link.res: file format not recognized; treating as linker script -:link.res:1: parse error
unwucht.pp(165,1) ERROR: ERROR while linking
Closing script ppas.bat

Please include the link.res also

--------------

here link.res

SEARCH_DIR(g:\pc\pp\unwucht\VERSI~L!\)
SEARCH_DIR(g:\pc\pp\units\win32\)
SEARCH_DIR(g:\pc\pp\units\win32\rtl\)
INPUT(
g:\pc\pp\units\win32\rtl\wprt0.ow
g:\pc\pp\unwucht\VERSI~L!\unwucht.ow
)
GROUP(
g:\pc\pp\units\win32\rtl\libpdos.aw
g:\pc\pp\units\win32\rtl\LIBPW~JH.AW
g:\pc\pp\units\win32\rtl\LIBPS~GM.AW
g:\pc\pp\units\win32\rtl\LIBPO~14.AW
g:\pc\pp\units\win32\rtl\LIBPS~UD.AW
)

Mit freundlichen Grüßen BMW AG Werk Regensburg TR-451 - Analyse, ATG Integration, Analyse-Werkstätten Akustik Analyse Werk Regensburg Dipl.-Ing. Armin Rohnen DGAQS

Reply by email

Peter Vreman
SEARCH_DIR(g:\pc\pp\unwucht\VERSI~L!\)

Can you try to place the file in a directory with a shortname or maybe a directory without a ! in the name. The GNU ld has difficulties with strange/long directory names

Reply by email

Armin Rohnen
to Peter Vreman
Show quoted text 6 lines
> SEARCH_DIR(g:\pc\pp\unwucht\VERSI~L!\) Can you try to place the file in a directory with a shortname or maybe a directory without a ! in the name. The GNU ld has difficulties with strange/long directory names

Hi Peter,

i have changet the directory to version01 and the linker gif ok.

thanks
Armin

Mit freundlichen Grüßen Dipl.-Ing. Armin Rohnen DGAQS

Reply by email

Pavel V. Ozerski
to Armin Rohnen: The line {$I LINK.RES} dosnt work link.res(1,1) Fatal: Syntax error, BEGIN expected but…

Hello Armin,

you wrote 32 lines
> > I Have write the function (using ppc386 on WIN2000 System): > > > > function GetMessData: integer; > > type > > pak = record > > werte : String[23]; > > end; > > > > PakFile = file of pak; > > > > var > > i : integer; > > F : PakFile; > > > > begin > > > > Assign(F,'C:\Temp\amag.txt'); > > Reset(F); > > > > > > end; > > > > In the moment, there are not more line in the code of this function. > > compiling is ok. > > but the linker send the error: > > -:link.res: file format not recognized; treating as linker script > > -:link.res:1: parse error > > unwucht.pp(165,1) ERROR: ERROR while linking > > Closing script ppas.bat > > Please include the link.res also >

AR> The line

AR> {$I LINK.RES} dosnt work

AR> link.res(1,1) Fatal: Syntax error, BEGIN expected but identifier
AR> SEARCH_DIR found

AR> _______________________________________________ AR> fpc-devel maillist -
AR> http://lists.freepascal.org/mailman/listinfo/fpc-devel

What is your link.res which you try to include using $i compiler directive? If it is a normal pascal include file, you have a names collision: FPC generates before calling of linker a linker response file named also link.res. Of course, this link.res is not a pascal source but is written in linker script language and, BTW, can begin from SEARCH_DIR keyword. Try to rename your link.res to prevent this file name conflict. BTW, .res extension is: 1) not typical for pascal include files; 2) typical for Windows resource files - that is a note for FPC developers team...

Best regards, Pavel

Reply by email

Pavel V. Ozerski
to Armin Rohnen: I Have write the function (using ppc386 on WIN2000 System): function GetMessData: integer;

Hello Armin,

Tuesday, September 03, 2002, 9:59:21 AM, you wrote:

AR> I Have write the function (using ppc386 on WIN2000 System):

AR> function GetMessData: integer;
AR> type
AR>    pak = record
AR>        werte : String[23];
AR>    end;
AR>    PakFile = file of pak;
AR>  var
AR>    i : integer;
AR>    F : PakFile;

AR> begin

AR>   Assign(F,'C:\Temp\amag.txt');
AR>   Reset(F);
AR>  end;

AR> In the moment, there are not more line in the code of this function. AR> compiling is ok.
AR> but the linker send the error:
AR> -:link.res: file format not recognized; treating as linker script AR> -:link.res:1: parse error
AR> unwucht.pp(165,1) ERROR: ERROR while linking
AR> Closing script ppas.bat

AR> Please include the link.res also

AR> --------------

AR> here link.res

AR> SEARCH_DIR(g:\pc\pp\unwucht\VERSI~L!\)
AR> SEARCH_DIR(g:\pc\pp\units\win32\)
AR> SEARCH_DIR(g:\pc\pp\units\win32\rtl\)
AR> INPUT(
AR> g:\pc\pp\units\win32\rtl\wprt0.ow
AR> g:\pc\pp\unwucht\VERSI~L!\unwucht.ow
AR> )
AR> GROUP(
AR> g:\pc\pp\units\win32\rtl\libpdos.aw
AR> g:\pc\pp\units\win32\rtl\LIBPW~JH.AW
AR> g:\pc\pp\units\win32\rtl\LIBPS~GM.AW
AR> g:\pc\pp\units\win32\rtl\LIBPO~14.AW
AR> g:\pc\pp\units\win32\rtl\LIBPS~UD.AW
AR> )

Are you sure that your linker is ldw for Win32?
ld's for different targets can have different script formats. 1) Try to compile and link separately (read -s compiler switch documentation); 2) Check targets supported by linker.

Best regards, Pavel

Reply by email