Re: [fpc-pascal] Linux library access violation

2006-10-30 Thread Chris
>L505 wrote: >First thing to check is it declared CDECL or STDCALL in the C library? >I think the default C declaration mode is CDECL if it is not defined explicitely. I knew it was gonna be the obvious. I changed: function testreturn(thename:pchar;rcity:pchar;rstate:pchar):integer; stdcal

Re: [fpc-pascal] Linux library access violation

2006-10-29 Thread Leducq Dominique
Le Lundi 30 Octobre 2006 01:13, Chris a écrit : > I get an "Access violation" when I call a function from a C library. > > Not sure if I can explain well enough, so I will just post the code: > > The C library: > #include > #include > > int testreturn(const char *thename, char *rcity, char *rstat

Re: [fpc-pascal] Linux library access violation

2006-10-29 Thread L505
> int testreturn(const char *thename, char *rcity, char *rstate) > { > > memcpy (rcity,"Boston",7); > memcpy (rstate,"Massachusetts",14); > > return strlen(thename); > } First thing to check is it declared CDECL or STDCALL in the C library? I think the default C declaration mode is C

Re: [fpc-pascal] Linux library access violation

2006-10-29 Thread L
> int testreturn(const char *thename, char *rcity, char *rstate) > { > > memcpy (rcity,"Boston",7); > memcpy (rstate,"Massachusetts",14); > > return strlen(thename); > } First thing to check is it declared CDECL or STDCALL in the C library? > I click OK and its fine. It returns ev