Re: [fpc-pascal] FPC linker oddity

2015-06-21 Thread Tomas Hajny
On Sun, June 21, 2015 22:58, Jonas Maebe wrote: > On 21/06/15 22:20, patspiper wrote: >> On 21/06/15 23:08, Jonas Maebe wrote: >>> On 21/06/15 21:43, patspiper wrote: Changing the GetTickCount declaration to any of the following works: Function GetTickCount: DWORD; external name '

Re: [fpc-pascal] FPC linker oddity

2015-06-21 Thread patspiper
On 21/06/15 23:58, Jonas Maebe wrote: On 21/06/15 22:20, patspiper wrote: So what should be done to remedy the Windows case when $LINKLIB is used, that is unless $LINKLIB is not to be used with Windows? {$linklib xxx} can be useful on Windows if you have a DLL that has an initialisation routin

Re: [fpc-pascal] FPC linker oddity

2015-06-21 Thread Jonas Maebe
On 21/06/15 22:20, patspiper wrote: > On 21/06/15 23:08, Jonas Maebe wrote: >> On 21/06/15 21:43, patspiper wrote: >>> Changing the GetTickCount declaration to any of the following works: >>>Function GetTickCount: DWORD; external name >>> '_$dll$kernel32$GetTickCount'; >>>Function GetTickCo

Re: [fpc-pascal] FPC linker oddity

2015-06-21 Thread patspiper
On 21/06/15 23:08, Jonas Maebe wrote: On 21/06/15 21:43, patspiper wrote: program Project1; {$Linklib kernel32} Function GetTickCount: DWORD; external; begin WriteLn ('GetTickCount ', GetTickCount); end. project1.lpr(10,1) Error: Undefined symbol: P$PROJECT1_$$_GETTICKCOUNT$$LONGWORD Chan

Re: [fpc-pascal] FPC linker oddity

2015-06-21 Thread Jonas Maebe
On 21/06/15 21:43, patspiper wrote: > program Project1; > {$Linklib kernel32} > Function GetTickCount: DWORD; external; > begin > WriteLn ('GetTickCount ', GetTickCount); > end. > project1.lpr(10,1) Error: Undefined symbol: > P$PROJECT1_$$_GETTICKCOUNT$$LONGWORD > > Changing the GetTickCount d

[fpc-pascal] FPC linker oddity

2015-06-21 Thread patspiper
The following simple program which uses the $LINKLIB compiler directive builds fine under Linux: program Project1; {$Linklib c} Const P : PChar = 'This is fun !'; Function strlen (P: PChar): Longint; cdecl; external; begin WriteLn ('Length of (',p,') : ',strlen(p)) end. However, cross-compili