Re: [fpc-pascal] Linker error on simple program (windows)

2021-06-24 Thread Sven Barth via fpc-pascal
Bart via fpc-pascal  schrieb am Mi., 23.
Juni 2021, 18:59:

> The error goes away if I remove the inline directive from the function
> definition in the interface section, or if I also declare the other
> function (which gives the linker error) in the interface section.
>

The compiler shouldn't do the inlining in that case, cause the pre-3.3.1
compiler doesn't allow inlining of implementation-only functions (and that
was something that was indeed fixed in 3.2.0: the overload that's not
declared in the interface section is no longer available globally).

3.3.1 handles inlining of implementation-only functions correctly.

Thus for 3.2.0 and 3.2.2 you indeed need to use the workarounds you
mentioned.

Regards,
Sven

>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker error

2015-12-18 Thread Jonas Maebe


Mattias Gaertner wrote on Fri, 18 Dec 2015:


What could be the cause of this linker error:

main.pp(6923,23) Warnung: Symbol "CommandLine" ist veraltet
/usr/bin/ld.bfd: warning: ../link.res contains output sections; did  
you forget -T?
/usr/bin/ld.bfd: /usr/lib/fpc/3.0.0/units/x86_64-linux/rtl/cprt0.o:  
unrecognized relocation (0x2a) in section `.text'

/usr/bin/ld.bfd: final link failed: Bad value


https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807170#19


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker error

2015-12-18 Thread Mattias Gaertner
On Fri, 18 Dec 2015 11:30:00 +0100
Jonas Maebe  wrote:

> 
> Mattias Gaertner wrote on Fri, 18 Dec 2015:
> 
> > What could be the cause of this linker error:
> >
> > main.pp(6923,23) Warnung: Symbol "CommandLine" ist veraltet
> > /usr/bin/ld.bfd: warning: ../link.res contains output sections; did  
> > you forget -T?
> > /usr/bin/ld.bfd: /usr/lib/fpc/3.0.0/units/x86_64-linux/rtl/cprt0.o:  
> > unrecognized relocation (0x2a) in section `.text'
> > /usr/bin/ld.bfd: final link failed: Bad value
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807170#19

Does that mean the fpc 3.0.0 (rc-buggy) package only works on
debian unstable?


Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker error

2015-12-18 Thread Jonas Maebe


Mattias Gaertner wrote on Fri, 18 Dec 2015:


On Fri, 18 Dec 2015 11:30:00 +0100
Jonas Maebe  wrote:


https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807170#19


Does that mean the fpc 3.0.0 (rc-buggy) package only works on
debian unstable?


It should work on Debian experimental/rc-buggy and on Debian  
sid/unstable (since those newer binutils have been accepted into  
Debian sid/unstable:  
https://packages.qa.debian.org/b/binutils/news/20151209T162037Z.html ).



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker error

2015-12-17 Thread Jonas Maebe

Mattias Gaertner wrote:


What could be the cause of this linker error:

main.pp(6923,23) Warnung: Symbol "CommandLine" ist veraltet
/usr/bin/ld.bfd: warning: ../link.res contains output sections; did you forget 
-T?
/usr/bin/ld.bfd: /usr/lib/fpc/3.0.0/units/x86_64-linux/rtl/cprt0.o: 
unrecognized relocation (0x2a) in section `.text'
/usr/bin/ld.bfd: final link failed: Bad value


A buggy assembler? There is indeed no relocation type 42 for ELF/x86-64. 
Does that happen with the official FPC release? Does objdump -r 
/usr/lib/fpc/3.0.0/units/x86_64-linux/rtl/cprt0.o show any unknown 
relocation types?



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker Error: what does this mean?

2013-01-25 Thread Gerhard Scholz

Sorry, I forgot how to file a bug report. Either somebody explains me,
please, or uses this information:

I created a smaller test program which produces the same error.

The test files can be found here:
http://mewal.com/test.zip (161 kB) or
http://mewal.com/test.7z (21 kB)

If someone wants to have it, of course I can also mail the files.

Gerhard

- Original Message - 
From: Tomas Hajny xhaj...@hajny.biz

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Thursday, January 24, 2013 9:32 AM
Subject: Re: [fpc-pascal] Linker Error: what does this mean?



On Wed, January 23, 2013 23:56, Gerhard Scholz wrote:

Hello,


thanks for the hint with the -Xe parameter (the external linker is damned
slow!), now it compiles.

.
I'm glad that the external linker helped. Indeed, slowness of the external
linker is one of reasons for using the internal one by default. If the
external and internal linkers behave differently here, it would be the
best to file a bug report so that the internal linker may get fixed.
However, it is necessary to include a (reference to) source code allowing
reproduction of the issue.

Tomas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker Error: what does this mean?

2013-01-25 Thread Tomas Hajny
On Fri, January 25, 2013 14:33, Gerhard Scholz wrote:
 Sorry, I forgot how to file a bug report. Either somebody explains me,
 please, or uses this information:

 I created a smaller test program which produces the same error.

 The test files can be found here:
 http://mewal.com/test.zip (161 kB) or
 http://mewal.com/test.7z (21 kB)

 If someone wants to have it, of course I can also mail the files.

Please, use our bug tracker at http://bugs.freepascal.org for filing it
there. The link to the bug tracker is also available from our homepage
(either search for bug tracker on http://www.freepascal.org, or just
have a look to the end of section General in the navigation panel at the
left side). You'll have to register in the bug tracker first ('Signup for
a new account') if you haven't done so previously, or log in with your
existing username and password.

Hope this helps

Tomas


 - Original Message -
 From: Tomas Hajny xhaj...@hajny.biz
 To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
 Sent: Thursday, January 24, 2013 9:32 AM
 Subject: Re: [fpc-pascal] Linker Error: what does this mean?


 On Wed, January 23, 2013 23:56, Gerhard Scholz wrote:

 Hello,

 thanks for the hint with the -Xe parameter (the external linker is
 damned
 slow!), now it compiles.
 .
 I'm glad that the external linker helped. Indeed, slowness of the
 external
 linker is one of reasons for using the internal one by default. If the
 external and internal linkers behave differently here, it would be the
 best to file a bug report so that the internal linker may get fixed.
 However, it is necessary to include a (reference to) source code
 allowing
 reproduction of the issue.

 Tomas
 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal

 ___
 fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
 http://lists.freepascal.org/mailman/listinfo/fpc-pascal



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker Error: what does this mean?

2013-01-24 Thread Tomas Hajny
On Wed, January 23, 2013 23:56, Gerhard Scholz wrote:


Hello,

 thanks for the hint with the -Xe parameter (the external linker is damned
 slow!), now it compiles.
 .
 .

I'm glad that the external linker helped. Indeed, slowness of the external
linker is one of reasons for using the internal one by default. If the
external and internal linkers behave differently here, it would be the
best to file a bug report so that the internal linker may get fixed.
However, it is necessary to include a (reference to) source code allowing
reproduction of the issue.

Tomas


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker Error: what does this mean?

2013-01-23 Thread Gerhard Scholz

Hello,

thanks for the hint with the -Xe parameter (the external linker is damned 
slow!), now it compiles.


The difference in the object file size seems to be the different amount of 
stored debug information; the declared structures have the same size 
(SIZEOF(...) is the same.


Thanks for the help.

Greetings

Gerhard

- Original Message - 
From: Tomas Hajny xhaj...@hajny.biz

To: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org
Sent: Wednesday, January 23, 2013 1:00 AM
Subject: Re: [fpc-pascal] Linker Error: what does this mean?



On 23 Jan 13, at 0:01, Gerhard Scholz wrote:


The files are completed compiled with FPC, no renaming of VPascal object
files.

The only explanation I have that it must have to do with the size of the
file; the .o has 8 MB and just defines some CONST and VAR structures, no
code.


Assuming (again ;-) - you haven't provided such information) that you
refer to the Win32 platform - could you disable internal linking (add
-Xe parameter)?



Interesting (maybe):
the .O which ppc386 made has 8.380.376 bytes,
the .OBJ made by vp has 7.002.097 bytes.


This difference in size could be due to different alignment rules.
Again, judging what goes wrong is difficult without being able to
reproduce it...

Tomas

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal 


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker Error: what does this mean?

2013-01-22 Thread Tomas Hajny
On 22 Jan 13, at 21:31, Gerhard Scholz wrote:

 Question: what's the reason for this error?
 
 Linking .\read.exe
 Error: Failed reading coff file, illegal reloctype $ while reading 
 .\U_UNIDAT
 
 The program compiles wonderfully with VirtualPascal; I wanted to recompile 
 it with FPC.

I will be just guessing because you haven't supplied any information 
about the program which you try to link, but I would suspect that you 
might have tried to link an externally created object file 
(u_unidat.o? - possibly just renamed from u_unidat.obj as previously 
used with VirtualPascal?) and it has object file format not supported 
by our linker. If this assumption is correct, you might need to re-
create the object file in the right format supported by FPC and/or 
the GNU linker.

Tomas

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Linker Error: what does this mean?

2013-01-22 Thread Tomas Hajny
On 23 Jan 13, at 0:01, Gerhard Scholz wrote:

 The files are completed compiled with FPC, no renaming of VPascal object 
 files.
 
 The only explanation I have that it must have to do with the size of the 
 file; the .o has 8 MB and just defines some CONST and VAR structures, no 
 code.

Assuming (again ;-) - you haven't provided such information) that you 
refer to the Win32 platform - could you disable internal linking (add 
-Xe parameter)?


 Interesting (maybe): 
 the .O which ppc386 made has 8.380.376 bytes, 
 the .OBJ made by vp has 7.002.097 bytes.

This difference in size could be due to different alignment rules. 
Again, judging what goes wrong is difficult without being able to 
reproduce it...

Tomas

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] linker error when cross compile for arm

2010-11-07 Thread Jonas Maebe

On 06 Nov 2010, at 04:18, Michael Fung wrote:

 But when I try to compile a program with the synapse units it gives the
 following error:
 
 /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function
 `_haltproc_eabi':
 (.text+0x88): undefined reference to `_fini'
 /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function
 `_haltproc_eabi':
 (.text+0x90): undefined reference to `_init'
 tcpclient1.lpr(42,21) Error: Error while linking
 tcpclient1.lpr(42,21) Fatal: There were 1 errors compiling module, stopping

That symbol should be defined in your ARM /usr/lib/crti.o, which is 
automatically linked by the compiler when cprt0.o is required.


Jonas___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] linker error when cross compile for arm

2010-11-07 Thread Michael Fung
Many Thanks Jonas! Now I know my SDK may be broken.

Rgds,
Michael


On 2010/11/8 上午 05:06, Jonas Maebe wrote:
 
 On 06 Nov 2010, at 04:18, Michael Fung wrote:
 
 But when I try to compile a program with the synapse units it gives the
 following error:

 /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function
 `_haltproc_eabi':
 (.text+0x88): undefined reference to `_fini'
 /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function
 `_haltproc_eabi':
 (.text+0x90): undefined reference to `_init'
 tcpclient1.lpr(42,21) Error: Error while linking
 tcpclient1.lpr(42,21) Fatal: There were 1 errors compiling module, stopping
 
 That symbol should be defined in your ARM /usr/lib/crti.o, which is 
 automatically linked by the compiler when cprt0.o is required.
 
 
 Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Linker error with OpenGL and SDL (long message)

2003-10-27 Thread Karim
Hello

Marco, the link.res seems to be o.k . It looks like this: 

SEARCH_DIR(/usr/lib/)
SEARCH_DIR(/usr/X11R6/lib/)
SEARCH_DIR(/usr/local/lib/)
SEARCH_DIR(/usr/local/lib/fpc/1.0.10/units/freebsd/rtl/)
SEARCH_DIR(/usr/local/lib/fpc/1.0.10/units/freebsd/SDL4Freepascal-1.2.0.0/)
etc. 

I don`t know exactly what you mean with  {$linklib SDL}... but I don`t
have such an entry in the code. 
The source that I`m trying to compile is this one (first demo from the
sdl package): 

{
SDL4FreePascal-1.2.0.0 - Simple DirectMedia Layer bindings for
FreePascal
Copyright (C) 2000, 2001  Daniel F Moisset

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
USA

Daniel F Moisset
[EMAIL PROTECTED]
}

Program Demo01 ;

{
  SDL4FreePascal Demo 01
  ==
  
  Just set the video mode.
}

{ SDL: Initialization and cleanup routines for SDL 
  SDL_Video: The Video services 
  SDL_Types: Some Types and constants usually needed }
Uses SDL, SDL_Video, crt;

Const
   { These are the screen parameters (window or videomode).
  When using a depth non supported by hardware, SDL automatically
  converts
 to the requested depth, but it's slower than direct access.
   }
   width = 320 ;
   height = 240 ;
   colordepth = 16 ;

Var
   screen: PSDL_Surface ;
   { A PSDL_Surface is used to store bitmap video surfaces, for example
   the
 visible screen, non-visible areas of video memory, and memory areas
 used
 for storing pixmaps.
 This variable will be used to store the visible screen.
   }

Begin
   { SDL_Init must be called before doing anything with SDL.
 The parameter is a bitwise or of SDL_INIT_xxx constants, indicating 
 which SDL subsystems will be used. }
   SDL_Init (SDL_INIT_VIDEO) ;

   { SDL_SetVideoMode creates a surface attached to the visible screen or
 window. Its last parameter indicates several flags for the surface.
 In this demo we're creating the surface in system memory (instead of
 video memory). This makes for faster pixel r/w access, but
 eventually
 is necessary to spend some time copying it to real video memory. A 
 hardware surface must not be copied (it's already there), and may
 take
 advantage of hardware acceleration for blitting, but must be  locked 
 and unlocked when accessing }
   screen := SDL_SetVideoMode (width, height, colordepth, SDL_SWSURFACE)
   ;
   { SDL_SetVideoMode returns nil if something fails }
   if screen = nil then
   Begin
   Writeln ('Couldn''t initialize video mode at ', width, 'x',
height, 'x', colordepth, 'bpp') ;
   Halt(1)
   End ;

   Delay(5000) ; { Wait 5 seconds }

   { Allocated surfaces must be freed using SDL_FreeSurface }
   SDL_FreeSurface (screen) ;
   { SDL_Quit closes SDL  }
   SDL_Quit ;
   { The window/videomode closes just here (it's not closed by
   FreeSurface) }

   WriteLn('Now we are not using SDL')
End.


Now, the whole thing is bewildering, because I get a second error message
which is diffrent from the old one. 
The message looks like this: 

-bash-2.05b$ fpc demo01.pp 
Free Pascal Compiler version 1.0.10 [2003/06/27] for i386
Copyright (c) 1993-2003 by Florian Klaempfl
Target OS: FreeBSD/ELF for i386
Compiling demo01.pp
Assembling demo01
Linking demo01
Compilation aborted demo01.pp:87
Runtime error 5 at 0x080BE16F
  0x080BE16F
  0x0809F874
  0x0809F9C5
  0x0804B325
  0x0808904E
  0x080884DA
  0x08107AC9
  0x080480E9

Can somebody explain to me, how I can get two diffrent error outputs with
the same source code ? 

Greetings 






-- 
  Karim
  [EMAIL PROTECTED]

-- 
http://www.fastmail.fm - mmm... Fastmail...

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Linker error with OpenGL and SDL (long message)

2003-10-27 Thread Marco van de Voort
 
 
 Now, the whole thing is bewildering, because I get a second error message
 which is diffrent from the old one. 
 The message looks like this: 
 
 -bash-2.05b$ fpc demo01.pp 
 Free Pascal Compiler version 1.0.10 [2003/06/27] for i386
 Copyright (c) 1993-2003 by Florian Klaempfl
 Target OS: FreeBSD/ELF for i386
 Compiling demo01.pp
 Assembling demo01
 Linking demo01
 Compilation aborted demo01.pp:87
 Runtime error 5 at 0x080BE16F
   0x080BE16F
   0x0809F874
   0x0809F9C5
   0x0804B325
   0x0808904E
   0x080884DA
   0x08107AC9
   0x080480E9
 
 Can somebody explain to me, how I can get two diffrent error outputs with

I don't have time atm to delve deeper in this, but the runtime error 5 seems
some locking/sharing/permission violation, and unrelated to the problem
at hand.

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Linker error with OpenGL and SDL (long message)

2003-10-27 Thread Marco van de Voort
 Marco, the link.res seems to be o.k . It looks like this: 
 
 SEARCH_DIR(/usr/lib/)
 SEARCH_DIR(/usr/X11R6/lib/)
 SEARCH_DIR(/usr/local/lib/)
 SEARCH_DIR(/usr/local/lib/fpc/1.0.10/units/freebsd/rtl/)
 SEARCH_DIR(/usr/local/lib/fpc/1.0.10/units/freebsd/SDL4Freepascal-1.2.0.0/)
 etc. 

Hmm, I ssh'ed to some FreeBSD box with SDL installed, and it seems that
FreeBSD names the libraries SDL-x.y

Simply do a 

cd /usr/local/lib
ln -s libSDL-x.y.so  libSDL.so

Maybe you need to do that for the other libSDL-*.so files too.
(x.y=1.1 on my system)

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal