[fpc-pascal] linking to dll still fails

2008-06-06 Thread Marc Santhoff
Hi,

I still have no success in linking against a dll on windows.

The dll import source looks like this:

...
{$linklib 'hdf5'}
...
function H5open:herr_t;{$ifdef BSD}cdecl{$endif}{$ifdef 
Win32}stdcall{$endif};external;
function H5close:herr_t;{$ifdef BSD}cdecl{$endif}{$ifdef 
Win32}stdcall{$endif};external;
...

and compiles okay.

The demo program used for testing does the obvious:

...
uses {$ifdef FreeBSD} BaseUnix { size_t an friends }, {$endif}
 hdf5;
...

and uses functions normally as declared in the unit hdf5.

On FreeBSD this works as expected, on window it doesn't. Using -vv gave
(shortened, can be posted in full lenght):

8000:Searching file D:\FPC\2.2.0\units\i386-win32\.\libhdf5.a... not found
8000:Searching file D:\FPC\2.2.0\units\i386-win32\libhdf5.a... not found
8000:Searching file D:\FPC\2.2.0\BIN\I386-WIN32\libhdf5.a... not found
8000:Searching file D:\FPC\2.2.0\BIN\I386-WIN32\libhdf5.a... not found
8000:Searching file hdf5.dll... found


8000:Searching file D:\FPC\2.2.0\units\i386-win32\.\libhdf5.a... not found
8000:Searching file D:\FPC\2.2.0\units\i386-win32\libhdf5.a... not found
8000:Searching file D:\FPC\2.2.0\BIN\I386-WIN32\libhdf5.a... not found
8000:Searching file D:\FPC\2.2.0\BIN\I386-WIN32\libhdf5.a... not found
1002:Error: Import library not found for hdf5

...

0002:Number of unresolved externals in objects 123
0002:Number of unresolved externals after static libraries 123
0002:Number of unresolved externals after defining COMMON symbols 123
0002:Number of unresolved externals after DLL imports 55
1002:Error: Undefined symbol: _H5Aopen_name
1002:Error: Undefined symbol: _H5Aget_type
1002:Error: Undefined symbol: _H5Aget_space
1002:Error: Undefined symbol: _H5Sget_simple_extent_ndims
1002:Error: Undefined symbol: _H5Sget_simple_extent_dims
1002:Error: Undefined symbol: _H5Tget_class
1002:Error: Undefined symbol: _H5Sget_simple_extent_npoints
1002:Error: Undefined symbol: HDF5_H5AREAD$LONGINT$LONGINT$POINTER$$LONGINT
1002:Error: Undefined symbol: _H5Tclose
1002:Error: Undefined symbol: _H5Sclose
...

I have only adjusted some basic functions to use stdcall instead of
cdecl on windows, so ignore the lines about undefined symbols having an
underscore at the start.

The dll is in the program directory. And it does get found. Another
issue might be:

in the units target dir there are three files:

-rw-rw-rw-   1 user group   77104 Jun  7 05:45 hdf5.o
-rw-rw-rw-   1 user group  154410 Jun  7 05:45 hdf5.ppu
-rw-rw-rw-   1 user group   8 Jun  7 05:45 libimphdf5.a

If I assume the libimphdf5.a is the missing import library and look at
it:

!

That's in there, nothing else (8 bytes).

What's going wrong here, how can I make it work?

TIA,
Marc


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


Re: [fpc-pascal] x86_64 assembler

2008-06-06 Thread mm

Tomas Hajny a écrit :

On Fri, June 6, 2008 17:19, mm wrote:

I thought to use hexadecimal code to replace the mnemonic "dq" itself
but 1) I don't know its code and 2) I am not even sure it would work.


There's no hexadecimal code for 'dq' (or any other d?) - this directive
simply tells the assembler that the following constants shall be put
directly into the code (instead of being compiled into some CPU
instructions)...

I suggest that you add this issue as a request to our bug tracker so that
it doesn't get forgotten (I believe that adding it shouldn't be a problem
for somebody knowing the related part of FPC).


That's done.

mm

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


Re: [fpc-pascal] x86_64 assembler

2008-06-06 Thread mjm

Tomas Hajny a écrit :

On Fri, June 6, 2008 17:19, mm wrote:

I thought to use hexadecimal code to replace the mnemonic "dq" itself
but 1) I don't know its code and 2) I am not even sure it would work.


There's no hexadecimal code for 'dq' (or any other d?) - this directive
simply tells the assembler that the following constants shall be put
directly into the code (instead of being compiled into some CPU
instructions)...

I suggest that you add this issue as a request to our bug tracker so that
it doesn't get forgotten (I believe that adding it shouldn't be a problem
for somebody knowing the related part of FPC).


That's done.

mm

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


[fpc-pascal] code speed and size on various platforms

2008-06-06 Thread Mattias Gaertner
I would like to create a shot overview of the code quality of
FPC. Please help to complete the list:

Under i386 code size and speed is similar to Delphi and gcc (except
for some synthetic benchmarks).

Under x86_64 pentium code size and speed is similar to gcc (exc...).

Under x86_64 amd code size and speed is similar to D and not that far
away from gcc (exc...).

Under arm code size and speed is similar to  ? (exc...).

Under powerpc code size and speed is similar to  ? (exc...).

Under sparc code size and speed is similar to  ? (exc...).


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


Re: [fpc-pascal] x86_64 assembler

2008-06-06 Thread Tomas Hajny
On Fri, June 6, 2008 17:19, mm wrote:
> Tomas Hajny a écrit :
>> On Thu, June 5, 2008 15:29, mm wrote:
>>> Jonas Maebe a écrit :
> How can one declare a constant of type qword with the INTEL
> assembler?
> I am using FPC 2.2.0 and the mnemonic "dq"  stops the compilation
> with
> the message "Error: Unrecognized opcode DQ".
 As far as I can see, that's not possible at this time.
>>> That's what I was afraid of. Thanks anyway.
>>>
>>> So the simplest solution is to use the ATT (GAS?) assembler.
>>
>> Can't you just split the constant to two hexadecimal (or alphanumeric)
>> values put after "dd"?
>
> Unfortunately, no. I have to use it with something like
>
>dq  @@R0,@@R1,@@R2,@@R3
>
> where the @@nn are labels (this is done to select the right jump at
> run time).
>
> I thought to use hexadecimal code to replace the mnemonic "dq" itself
> but 1) I don't know its code and 2) I am not even sure it would work.

There's no hexadecimal code for 'dq' (or any other d?) - this directive
simply tells the assembler that the following constants shall be put
directly into the code (instead of being compiled into some CPU
instructions)...

I suggest that you add this issue as a request to our bug tracker so that
it doesn't get forgotten (I believe that adding it shouldn't be a problem
for somebody knowing the related part of FPC).

Tomas


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


Re: [fpc-pascal] x86_64 assembler

2008-06-06 Thread mm

Tomas Hajny a écrit :

On Thu, June 5, 2008 15:29, mm wrote:

Jonas Maebe a écrit :

How can one declare a constant of type qword with the INTEL assembler?
I am using FPC 2.2.0 and the mnemonic "dq"  stops the compilation with
the message "Error: Unrecognized opcode DQ".

As far as I can see, that's not possible at this time.

That's what I was afraid of. Thanks anyway.

So the simplest solution is to use the ATT (GAS?) assembler.


Can't you just split the constant to two hexadecimal (or alphanumeric)
values put after "dd"?


Unfortunately, no. I have to use it with something like

  dq  @@R0,@@R1,@@R2,@@R3

where the @@nn are labels (this is done to select the right jump at
run time).

I thought to use hexadecimal code to replace the mnemonic "dq" itself
but 1) I don't know its code and 2) I am not even sure it would work.

mm

http://www.ellipsat.net/

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


[fpc-pascal] libmilter + freepascal

2008-06-06 Thread TOUZEAU DAVID

Dear

I'm trying to find examples using libmilter (sendmail milter) with 
freepascal.

Does anybody have usefull links or code with it ?

best regards
--
David Touzeau -- Linux Ubuntu 7.04 feisty 
FreePascal-Lazarus,perl,delphi,php artica for postfix management console 
(http://www.artica.fr) icq:160018849

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


Re: [fpc-pascal] Date conversion question

2008-06-06 Thread [EMAIL PROTECTED]



Search for scandatetime in

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/dateutil.inc?view=markup

Have a look at the documentation for formatdatetime and the comments in the
source to get an idea how to use it.

  

 ScanDateTime('?MM?dd?hh?nn?ss',str); // seems to work fine here.

Thanks.


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


Re: [fpc-pascal] x86_64 assembler

2008-06-06 Thread Tomas Hajny
On Thu, June 5, 2008 15:29, mm wrote:
> Jonas Maebe a écrit :
>>> How can one declare a constant of type qword with the INTEL assembler?
>>> I am using FPC 2.2.0 and the mnemonic "dq"  stops the compilation with
>>> the message "Error: Unrecognized opcode DQ".
>>
>> As far as I can see, that's not possible at this time.
>
> That's what I was afraid of. Thanks anyway.
>
> So the simplest solution is to use the ATT (GAS?) assembler.

Can't you just split the constant to two hexadecimal (or alphanumeric)
values put after "dd"?

Tomas


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


Re: [fpc-pascal] Date conversion question

2008-06-06 Thread Graeme Geldenhuys
I would say the easiest would be to extract the different parts: Year,
Month, Day, Hour, Min, Sec and then use EncodeDateTime() to return a
TDateTime type.

I have implemented (with unit tests) the last format (ISO 8601) in the
tiOPF project. I use that for storing my dates in a database. See the
tiUtils.pas unit in the tiOPF project on SF.net:
  http://tinyurl.com/69a5nf

See the following functions:
  tiDateTimeAsIntlDateStor
  tiDateTimeAsIntlDateDisp
  tiIntlDateStorAsDateTime
  tiIntlDateDispAsDateTime

Hope this helps...

Regard,
  - Graeme -


2008/6/6 [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> Hello,
> I have a little project in which I need to convert various string encoded in
> various date format to TDateTime.
> For the same date, I'll have:
>
> '2008-05-10 21:49:21'
> '2008:05:10 21:49:21'
> '2008-05-10T19:49:21Z'
>
> I am no expert with date manipulation so I am asking:
>
> For the first type of string;
> DateSeparator:= '-';
> ShortDateFormat:= ':MM:dd';
> StrToDateTime(str_date); //gets converted.
>
> For the second type of string;
> ShortDateFormat:= ':MM:dd';
> DateSeparator:= ':';
> StrToDateTime(str_date); // will trigger an exception
> Is that intented or normal? Is there a method available except replacing the
> ':' by '-' in the date part?
>
> For the third type of string;
> Should I convert the third string and remove the T and Z chars or are there
> any others methods available?
>
> Thanks in advance.
>

___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Date conversion question

2008-06-06 Thread Marco van de Voort
> I have a little project in which I need to convert various string 
> encoded in various date format to TDateTime.
> For the same date, I'll have:

In the upcoming 2.2.2, there will be a scandatetime routine in datetuils.
One could copy this code also to 2.2.0 projects though.

Search for scandatetime in

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/dateutil.inc?view=markup

Have a look at the documentation for formatdatetime and the comments in the
source to get an idea how to use it.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Date conversion question

2008-06-06 Thread [EMAIL PROTECTED]

Hello,
I have a little project in which I need to convert various string 
encoded in various date format to TDateTime.

For the same date, I'll have:

'2008-05-10 21:49:21'
'2008:05:10 21:49:21'
'2008-05-10T19:49:21Z'

I am no expert with date manipulation so I am asking:

For the first type of string;
DateSeparator:= '-';
ShortDateFormat:= ':MM:dd';
StrToDateTime(str_date); //gets converted.

For the second type of string;
ShortDateFormat:= ':MM:dd';
DateSeparator:= ':';
StrToDateTime(str_date); // will trigger an exception
Is that intented or normal? Is there a method available except replacing 
the ':' by '-' in the date part?


For the third type of string;
Should I convert the third string and remove the T and Z chars or are 
there any others methods available?


Thanks in advance.



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