[fpc-pascal] Compiling library / Win32 DLL

L505 fpc505 at z505.com
Thu Dec 29 20:22:05 CET 2005




>i had started doing development using the FP console IDE.
>
>i then "discovered" Lazarus, and wanting to be able to use a GUI IDE,
>
>i downloaded and installed it.
>
>i then took the exact same code, compiled it, which produced a DLL for
>me, and when i tried to get my hosting application to load it, it
>complained, saying it wasn't a DLL.
>
>i then loaded the FP IDE, recompiled the same code, and it went back to working.
>
>i posted to the list, asking questions about my problem, but no one
>seemed to know why i might be having the problem.

>someone even sent me a "dll loader" tool to test whether my DLL would
>load with their testing tool.

I had sent you that tool, and it was extremely simple but it has solved some problems
I've had before.  I recalled having the same problem as you, once with lazarus..
lazarus didn't create a good DLL for me but for some reason my problem went away
after a while, and lazarus was producing OKAY dll's. I should have written down what
if anything I found out?? One of my issues was smart linking. The compiler did not
generate good DLL's when you had the smart linking on. But this was later repaired by
someone.. And again, it may not have to do with your issue. I am just guessing maybe
you had smartlinking on in lazarus, but not in the FP ide. Or maybe the FP Ide was a
different version of compiler than your compiler included with Lazarus in /pp/bin/

>the DLL _did_ load with the tool, but the application i was using
>still wouldn't deal with it, until i recompiled it with the FP console
>IDE.

Since the IDE has it's own compiled in compiler, maybe the compiler that was compiled
in was a different version than the one you were using with Laz? If you have time,
try pointing lazarus to use the exact same version of compiler that the FP IDE was
using (in environment options).

>stuff that is really hard to explain in any detail in an e-mail ...
>but things like "enumerators" within the API suddenly stopped
>enumerating ... without error ... function calls that returned enums
>were returning the wrong enum value ... stuff like that.


>after alot of head scratching and poking and prodding ... i ended up
>cleaning up a bunch of "dot o" files from some of the units for the
>third party API wrappers that are implemented in pascal, and which
>were being compiled by FP.
>
>my problems went away.

I've had the FPC config file problem before, where FPC config file is referencing my
old FPC units in other directories. It will pick up old .PPU/.o/.a files especially
if the FPC.CFG file has not updated the -FuC:\wherever\ to the new directories.
It's not actually in FPC config file problem as much as it is a user error problem
(my fault, really, for not updating the FPC cfg file in all the directories - the
problem is when you have two or more compilers running on one system)

> some kind of weird issue between 2.0.1 and 2.0.2 in the object files.

They are simply generated from the compiler with the PPU files, so if you use 2.0.0
.o files with 2.0.2 ppu files this will definitely cause issues AFAIK, and I've had
this problem before when the FPC.CFG file is pointing to old directories, as far as I
can remember.





More information about the fpc-pascal mailing list