
Hi, (second time: Outlook tricked me: wrong email address I really love this mailer. :-( ) The lib prefix convention is only for .a and .so files, .o files do not fall under this convention, so: ld -r --whole-archive libHSfoo.a -o HSfoo.o is what should work for you. Cheers Dirk
-----Original Message----- From: glasgow-haskell-users-admin@haskell.org [mailto:glasgow-haskell-users-admin@haskell.org]On Behalf Of S.D.Mechveliani Sent: Thursday, May 31, 2001 8:00 AM To: glasgow-haskell-users@haskell.org Cc: simonmar@microsoft.com Subject: package for ghci
To my question on packages for ghci Simon Marlow
responds 5. ar -q libHSfoo.a *.o ld -r --whole-archive libHSdocon.a -o libHSdocon.o
Here's your problem: you named the output libHSdocon.o, but GHCi is looking for HSfoo.o (because that's the name you gave in the package spec).
ld -r --whole-archive libHSfoo.a -o libHSfoo.o
[..]
Thank you. The matter was indeed in the name. And it was due to the `lib' prefix, not due to `docon'.
Because there was a typo in my letter: ...--whole-archive libHSfdocon.a ... while in real experiment it was ...--whole-archive libHSfoo.a ...
And I doubt whether the GHC implementation agrees at this point with the GHC User's guide. Section 4.11.2 says
---------------------------------------------- A package specification looks like this:
Package {name = "mypkg" hs_libraries = ["HSmypkg"] ... } ... hs_libraries A list of libraries containing Haskell code for this package, with the .a or .dll suffix omitted. On Unix, the `lib' prefix is also omitted.
extra_libraries ... ----------------------------------------------
The user (myself) thinks at this: "HSmypkg" in package specification -->
HSmypkg.a HSmypkg.o in the library directory. But " `lib' is also omitted " - similarly as `.a'. Hence, the library directory should contain libHSmypkg.a libHSmypkg.o Now, ghci -package-mypkg
sees "HSmypkg" in package specification but searches for the file HSmypkg.o. It adds `.o', but skips `lib'. On the other hand, `.o' has different status, it is separated by period. So I wonder.
Regards,
----------------- Serge Mechveliani mechvel@botik.ru
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users