Sign in Join

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

Mailing lists / fpc-devel / 2002-11

Error Delphi load DLL, when DLL created in FPC

13 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

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

Zbigniew Kuczbański
Show quoted text 12 lines
Subject: [fpc-devel]Error Delphi load DLL, when DLL created in FPC Reply-To: Hi, I have problem when I create DLL in FPC. (FPC 1.06 Win32) 1.When create DLL in FPC and use it in program written in FPC - it works OK. 2. The same DLL (created in FPC) and use in Delphi (6.0) - Delphi report error when loading DLL. What I can do, to write DLL in FPC and use it in Delphi. It's very strange for me, because both use teh same function to Load

DLL ->

Show quoted text 12 lines
LoadLibrary! Best regards Zb. Kuczbanski Here sample code my_dll. ---------------------------------------------- Library my_dll; Begin WriteLn('Loaded DLL1'); End.
OK, it is no important, what do DLL, I check it for new code of  DLL.
Library DLL1;
uses Sysutils;
var F: LongInt;
    szStr  : array[0..100] of Char;
Begin
   F:=FileCreate('Dll1.log');
   strcopy(szStr,'Dll1 is loaded');
   FileWrite(F,szStr,StrLen(szStr));
   FileClose(F);
End.

When this DLL load program written in Delphi, it show Error (function LoadLibrary)
In my opinion situation similar to show in Bug 2232. I check this bug, when both DLL created in Delphi. In this case both DLL loaded corecctly!

What I can do, to write DLL in FPC and use it in Delphi. Zb. Kuczbanski

Reply by email

Zbigniew Kuczbański
to Zbigniew Kuczbański

Hi,
Where I can find lastest version tools like dlltool.exe, asw.exe ldw.exe (in install FPC it exist in asldw.zip) ?
I have compiler snapshoot (15.11.2002) , but cant compile, create DLL because I dont have this tools.
Best regards,
Zb. Kuczbanski

Reply by email

Rimgaudas Laucius
to Zbigniew Kuczbański: DLL -> OK, it is no important, what do DLL, I check it for new code of DLL. Library DLL1;
Show quoted text 6 lines
> Subject: [fpc-devel]Error Delphi load DLL, when DLL created in FPC > Reply-To: > > Hi, > I have problem when I create DLL in FPC. (FPC 1.06 Win32) > 1.When create DLL in FPC and use it in program written in FPC - it

works

> OK. > 2. The same DLL (created in FPC) and use in Delphi (6.0) - Delphi

report

Show quoted text 38 lines
> error when loading DLL. > > What I can do, to write DLL in FPC and use it in Delphi. > It's very strange for me, because both use teh same function to Load DLL -> > LoadLibrary! > > Best regards > Zb. Kuczbanski > > > Here sample code my_dll. > ---------------------------------------------- > Library my_dll; > Begin > WriteLn('Loaded DLL1'); > End. OK, it is no important, what do DLL, I check it for new code of DLL. Library DLL1; uses Sysutils; var F: LongInt; szStr : array[0..100] of Char; Begin F:=FileCreate('Dll1.log'); strcopy(szStr,'Dll1 is loaded'); FileWrite(F,szStr,StrLen(szStr)); FileClose(F); End. When this DLL load program written in Delphi, it show Error (function LoadLibrary) In my opinion situation similar to show in Bug 2232. I check this bug, when both DLL created in Delphi. In this case both DLL loaded corecctly! What I can do, to write DLL in FPC and use it in Delphi. Zb. Kuczbanski

I can confirm that there are problems with fpc dll loading from delphi program. I noticed that some dlls dinamicaly loads in delphi, but then i tryed to load them staticaly (with "external") program stoped responding in its initialization state. I noticed these problems ealier, but failed to locate them clearly. I think there might be the same problems as mentioned here.

Reply by email

Peter Vreman
to Zbigniew Kuczbański: Where I can find lastest version tools like dlltool.exe, asw.exe ldw.exe (in install FPC…
you wrote 5 lines
Hi, Where I can find lastest version tools like dlltool.exe, asw.exe ldw.exe (in install FPC it exist in asldw.zip) ? I have compiler snapshoot (15.11.2002) , but cant compile, create DLL because I dont have this tools.

The tools are from mingw http://www.mingw.org/. They can be found in the binutils package. The names are as and ld. But to make a different name for win32 they are renamed in the fpc distribution to asw and ldw.

Peter

Reply by email

Balogh, Karoly (Charlie/iNQ
to Rimgaudas Laucius: works report I can confirm that there are problems with fpc dll loading from delphi…

Hi,

There was a post here some time ago, which stated that there is a beta Linux/68k version available of FPC 1.0.7. So this means for me that's the 68k codegenerator is up and working in 1.0.x...

My questions are: How much effort would be needed to get an up-to-date Amiga/68k compiler? What's need to be done? Is there a to-do list for this? How big part of the RTL need to be reworked from 0.99.5? Anyone already working on these?

(I tried to port some of my PC-stuff to Amiga, but 0.99.5d seems to dislike my coding style, so i got some nasty deadend's and guru's at compile-time... :)

Bye,

Charlie/iNQ .:%[ Cybernetic Hydraulic Android Responsible for ]%:. .:%[ Logical Infiltration and Exploration ]%:. .:%[ Member of TeamOS/2 Hungary ]%:. .:%[ Member of Hungarian Amiga User Group ]%:.

Reply by email

Florian Klaempfl
to Balogh, Karoly (Charlie/iNQ
you wrote 16 lines
Hi, There was a post here some time ago, which stated that there is a beta Linux/68k version available of FPC 1.0.7. So this means for me that's the 68k codegenerator is up and working in 1.0.x... My questions are: How much effort would be needed to get an up-to-date Amiga/68k compiler? What's need to be done? Is there a to-do list for this? How big part of the RTL need to be reworked from 0.99.5? Anyone already working on these? (I tried to port some of my PC-stuff to Amiga, but 0.99.5d seems to dislike my coding style, so i got some nasty deadend's and guru's at compile-time... :)

Afaik the current 1.0.7 cvs version works on UAE. However, there is no snapshot available yet, i.e. you've to cross compile it yourself :)

Reply by email

Sasu Purola

How about making lha archive from you UAE installation and place it somewhere in fp ftp server? I could download it and make amiga installer script for it. :) What are needed besides FPC. Something from geekgadgets? Also simple list of needed assigns would be enough to install this beast to my UAE :)

Sasu

Show quoted text 35 lines
-----Original Message----- From: Florian Klaempfl Sent: 22. marraskuuta 2002 13:10 To: Subject: Re: [fpc-devel]FPC for Amiga/68k At 11:40 22.11.2002, you wrote: >Hi, > >There was a post here some time ago, which stated that >there is a beta Linux/68k version available of FPC 1.0.7. >So this means for me that's the 68k codegenerator is up >and working in 1.0.x... > >My questions are: How much effort would be needed to get >an up-to-date Amiga/68k compiler? What's need to be done? >Is there a to-do list for this? How big part of the RTL >need to be reworked from 0.99.5? Anyone already working >on these? > >(I tried to port some of my PC-stuff to Amiga, but 0.99.5d >seems to dislike my coding style, so i got some nasty >deadend's and guru's at compile-time... :) Afaik the current 1.0.7 cvs version works on UAE. However, there is no snapshot available yet, i.e. you've to cross compile it yourself :) _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Balogh, Karoly (Charlie/iNQ
to Florian Klaempfl: Afaik the current 1.0.7 cvs version works on UAE. However, there is no snapshot available…

Hi,

Florian Klaempfl wrote 5 lines
> My questions are: How much effort would be needed to get > an up-to-date Amiga/68k compiler? What's need to be done? Afaik the current 1.0.7 cvs version works on UAE. However, there is no snapshot available yet, i.e. you've to cross compile it yourself :)

Ahem, well... :) On what system it is possible to generate the 68k-hosted/targeted compiler? I've no Linux/68k here. Is it possible on Linux/x86? What additional tools (eg. cross-linker) needed and are these available from somewhere on the net?

(I've nothing but e-mail access now, so i can't check it.)

Bye,

Charlie/iNQ .:%[ Cybernetic Hydraulic Android Responsible for ]%:. .:%[ Logical Infiltration and Exploration ]%:. .:%[ Member of TeamOS/2 Hungary ]%:. .:%[ Member of Hungarian Amiga User Group ]%:.

Reply by email

Florian Klaempfl
to Balogh, Karoly (Charlie/iNQ
you wrote 11 lines
Hi, On 22-Nov-02, Florian Klaempfl wrote: >> My questions are: How much effort would be needed to get >> an up-to-date Amiga/68k compiler? What's need to be done? > Afaik the current 1.0.7 cvs version works on UAE. However, > there is no snapshot available yet, i.e. you've to cross > compile it yourself :) Ahem, well... :)

Hmmm, Carl-Eric Codere maintains the Amiga port so he should answer, but I'll try :)

Show quoted text 5 lines
On what system it is possible to generate the 68k-hosted/targeted compiler? I've no Linux/68k here. Is it possible on Linux/x86? What additional tools (eg. cross-linker) needed and are these available from somewhere on the net?

I don't think so.

But if you've a as/ld for AmigaOS, it should be enough. You can compile on i386 linux/win32 or whatever.

1. Get 1.0.7 via cvs
2. make cycle in the 1.0.7 compiler dir
3. del *.ppw (or *.ppu)
4. make CPU_TARGET=m68k

At this point you've a ppc68k, i.e. a fpc with m68k as target.

5. Now switch to fixes/rtl/amiga and do a
make PP=c:\fpc\fixes\compiler\ppc68k OPT=-s
then you get a couple of .asm and .as files. Move them to the amiga and assemble them there.

6. Go back fixes/compiler
7. renanme ppc68k.exe to pp.exe
8. do a make PP=c:\fpc\fixes\compiler\pp CPU_TARGET=m68k OS_TARGET=amiga OPT=-s
9. now you get another couple of .asm files, move them again to the amiga, assemble them with a GNU AS for Amiga and link them together to a amiga hosted pp.

:/

Reply by email

Nils Sjöholm
to Balogh, Karoly (Charlie/iNQ: Ahem, well... :) On what system it is possible to generate the 68k-hosted/targeted…

fredag 22 november 2002 13:24 skrev Balogh, Karoly (Charlie/iNQ):

Show quoted text 19 lines
Hi, On 22-Nov-02, Florian Klaempfl wrote: >> My questions are: How much effort would be needed to get >> an up-to-date Amiga/68k compiler? What's need to be done? > > Afaik the current 1.0.7 cvs version works on UAE. However, > there is no snapshot available yet, i.e. you've to cross > compile it yourself :) Ahem, well... :) On what system it is possible to generate the 68k-hosted/targeted compiler? I've no Linux/68k here. Is it possible on Linux/x86? What additional tools (eg. cross-linker) needed and are these available from somewhere on the net? (I've nothing but e-mail access now, so i can't check it.) Bye,

Hi,
I do have a crossystem on linux/x86, compile on linux and testrun on uae. The same for win32. I also have made a native amigafpc that works ok but there are some problems with paths for ther compiler. It's much faster to compile on linux.

Nisse

Reply by email

Carl Eric Codere
Show quoted text 5 lines
Ahem, well... :) On what system it is possible to generate the 68k-hosted/targeted compiler? I've no Linux/68k here. Is it possible on Linux/x86? What additional tools (eg. cross-linker) needed and are these available from somewhere on the net?

Greetings,
Regarding the cross-tools, i've built them for
win32, and they work correctly. They can be built for any host, just download the binutils source code from geekgadgets and rebuild them with the correct options.

Regarding the actual native amiga compiler creation, there are currently several problems :
- For creating a 'real' snapshot i need to use makefiles, but some of the geekgadgets tools only return/accept unix style-paths, which of course are not known by the compiler, which accepts native amiga paths. Other geekgadgets tools don't like a mix of unix / amiga paths (contrary to cygwin), so it messes up. The only solution i see to this is to create an amiga script to do the building of the snapshot.
- My UAE (WinUAE) is probably buggy, or geekgadgets, since by hacking a bit and doing a make, it stops compilation in the FCL indicating that a file is corrupt (which is not the case - since compiling those files by hand works!)
- Doing a make (33% done - before they stop because of path problems) takes me 45-65 minutes (on WinUAE) of compilation time... and I'm not patient!

But currently, the amiga compiler works quite well! There might still be problems in the following areas (very minor):
- some array of const parameter do not work correctly it seems (Nils knows more than me on this problem)
- passing structures to routines declared with cdecl might not work correctly (it depends on the types in the structures).

p.s : The 1.0.7 Amiga compiler should be much much more stable than then 0.95d Amiga compiler.

p.p.s : I'm really happy to see there is still interest in the Amiga!

Reply by email

Balogh, Karoly (Charlie/iNQ
to Florian Klaempfl: Hmmm, Carl-Eric Codere maintains the Amiga port so he should answer, but I'll try :) I…

Hi,

Florian Klaempfl wrote 9 lines
>>> My questions are: How much effort would be needed to get >>> an up-to-date Amiga/68k compiler? What's need to be done? >> Afaik the current 1.0.7 cvs version works on UAE. However, >> there is no snapshot available yet, i.e. you've to cross >> compile it yourself :) > Ahem, well... :) Hmmm, Carl-Eric Codere maintains the Amiga port so he should answer, but I'll try :) [...]

Huh, this one wasn't an easy ride, but i successfully compiled a working Amiga/68k hosted&targeted compiler. Cool. :) Thanks Florian for your help!

However, there are still a few problems exist, for eg. around paths as Nils said. But i'm happy with the current results. (... and waiting for offical snapshot... :)

Bye,

Charlie/iNQ .:%[ Cybernetic Hydraulic Android Responsible for ]%:. .:%[ Logical Infiltration and Exploration ]%:. .:%[ Member of TeamOS/2 Hungary ]%:. .:%[ Member of Hungarian Amiga User Group ]%:.

Reply by email