[Haskell-cafe] Re: dynamic loading of code on windows

Kevin Jardine kevinjardine at gmail.com
Tue Nov 16 04:16:58 EST 2010


This is a known problem and there appears to be a fix:

http://www.mail-archive.com/haskell-cafe@haskell.org/msg55899.html

I can't access that link for some reason but Google has it cached
here:

http://www.google.com/url?sa=t&source=web&cd=3&ved=0CCQQFjAC&url=http%3A%2F%2Fwww.mail-archive.com%2Fhaskell-cafe%40haskell.org%2Fmsg55899.html&rct=j&q=Missing%20header%20file%3A%20Linker.h&ei=k0riTOjZDc_pOd3K5GA&usg=AFQjCNHa8H8tDTcD65dqhTlZO448bEIOCQ&sig2=fxbBCuMUpU-8yHTlYhaoxQ&cad=rja

Kevin

On Nov 16, 6:46 am, Arnaud Bailly <arnaud.oq... at gmail.com> wrote:
> OK, here is a short summary:
>  - installed MinGW + GCC 4.5 toolchain
>  - downloaded latest code from darcs
>  - Run ./Setup.lhs configure
>  - got another failure
>
> Setup.lhs:2:2:
>     Warning: In the use of `defaultUserHooks'
>              (imported from Distribution.Simple):
>              Deprecated: "Use simpleUserHooks or autoconfUserHooks,
> unless you need Cabal
>              compatibility in which case you must stick with defaultUserHooks"
> Warning: plugins.cabal: The field "hs-source-dir" is deprecated, please use
> "hs-source-dirs"
> Warning: defaultUserHooks in Setup script is deprecated.
> Configuring plugins-1.0...
> Warning: No 'build-type' specified. If you do not need a custom Setup.hs or
> ./configure script then use 'build-type: Simple'.
> checking build system type... i686-pc-mingw32
> checking for ghc... ghc
> checking for value of __GLASGOW_HASKELL__... 612
> checking for ghc library directory... D:\Program Files\Haskell
> Platform\2010.2.0.0\lib
> checking for tex... tex
> checking for tex2page... no
> configure: WARNING: tex2page is needed to build some of the documentation
>                    http://www.ccs.neu.edu/home/dorai/tex2page/tex2page-doc.html
> checking for gcc... gcc
> checking for C compiler default output file name... a.exe
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables... .exe
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ANSI C... none needed
> checking for arc4random... no
> checking for a BSD-compatible install... /usr/bin/install -c
> configure: creating ./config.status
> config.status: creating config.mk
> config.status: creating testsuite/makewith/io/TestIO.conf
> config.status: creating testsuite/makewith/unsafeio/Unsafe.conf
> config.status: creating config.h
> config.status: config.h is unchanged
> Setup.lhs: Missing dependency on a foreign library:
> * Missing header file: Linker.h
> This problem can usually be solved by installing the system package that
> provides this library (you may need the "-dev" version). If the library is
> already installed but in a non-standard location then you can use the flags
> --extra-include-dirs= and --extra-lib-dirs= to specify where it is.
>
> So it seems really I will have to 1) fix this myself or 2) gave up. I
> would really like to go for 1) but my knowledge of GHC's internals is
> rather limited, so I must stick with 2). I will try to adapt hint.
>
> I have one question regarding hint: does it handle reloading of modules?
>
> Thanks a lot for the various answers so far,
> Best regards,
> Arnaud
>
>
>
> On Mon, Nov 15, 2010 at 11:45 PM, Mathias Weber <mat_we... at t-online.de> wrote:
> > Hello Arnaud,
> > I also faced this problem with the plugins package. This particular
> > error comes from the backslashes in the ghc library directory not being
> > escaped. But even after patching this, I had trouble with missing
> > imports and some other stuff. It seams that this package is not much
> > used/tested under Windows. At the end I gave up using it and switched to
> > hint (like Alberto pointed out before).
>
> > Mathias
>
> > Am 13.11.2010 19:41, schrieb Arnaud Bailly:
> >> Hello again,
> >> So I followed Kevin's suggestion and installed MinGW along with gcc
> >> and autoconf tools needed by hs-plugins. Then it failed with the
> >> following error:
>
> >> $ cabal install --enable-documentation plugins
> >> Resolving dependencies...
> >> Configuring plugins-1.5.1.4...
> >> checking build system type... i686-pc-mingw32
> >> checking for ghc... ghc
> >> checking for value of __GLASGOW_HASKELL__... 612
> >> checking for ghc library directory... D:\Program Files\Haskell Platform\2010.2.0
> >> .0\lib
> >> checking for gcc... gcc
> >> checking for C compiler default output file name... a.exe
> >> checking whether the C compiler works... yes
> >> checking whether we are cross compiling... no
> >> checking for suffix of executables... .exe
> >> checking for suffix of object files... o
> >> checking whether we are using the GNU C compiler... yes
> >> checking whether gcc accepts -g... yes
> >> checking for gcc option to accept ANSI C... none needed
> >> checking for arc4random... no
> >> checking for a BSD-compatible install... /usr/bin/install -c
> >> configure: creating ./config.status
> >> config.status: creating config.mk
> >> config.status: creating testsuite/makewith/io/TestIO.conf
> >> config.status: creating testsuite/makewith/unsafeio/Unsafe.conf
> >> config.status: creating config.h
> >> Preprocessing library plugins-1.5.1.4...
> >> Building plugins-1.5.1.4...
> >> [ 1 of 12] Compiling System.Plugins.Process ( src\System\Plugins\Process.hs, dis
> >> t\build\System\Plugins\Process.o )
> >> [ 2 of 12] Compiling System.Plugins.Parser ( src\System\Plugins\Parser.hs, dist\
> >> build\System\Plugins\Parser.o )
> >> [ 3 of 12] Compiling System.Plugins.LoadTypes ( src\System\Plugins\LoadTypes.hs,
> >>  dist\build\System\Plugins\LoadTypes.o )
> >> [ 4 of 12] Compiling System.Plugins.Consts ( src\System\Plugins\Consts.hs, dist\
> >> build\System\Plugins\Consts.o )
>
> >> src\System\Plugins\Consts.hs:39:22:
> >>     lexical error in string/character literal at character 'P'
> >> cabal.exe: Error: some packages failed to install:
> >> plugins-1.5.1.4 failed during the building phase. The exception was:
> >> ExitFailure 1
>
> >> Any clues? Should I try to use latest source tree? I am really
> >> interested in the plugins approach, rather than the interpreter
> >> approach. What I am trying to achieve is a system similar to Yi as
> >> presented in Don Stewart's paper
> >> (http://www.cse.unsw.edu.au/~dons/papers/yi.pdf), but much simpler, of
> >> course. The system would load modules as found in some known location,
> >> run tests found here before really accepting them, then use them, with
> >> the possibility of replacing those modules when a newer version is
> >> found. The idea is  to provide a self-tested and continuously running
> >> system for development, something that might be reminiscent of
> >> Smalltalk although I never programmed in Smalltalk.
>
> >> Thanks in advance for advises,
>
> >> REgards,
> >> Arnaud
>
> >> On Fri, Nov 12, 2010 at 8:49 PM, Alberto G. Corona <agocor... at gmail.com> wrote:
> >>> I use Hint for the same purpose. It has been tested under windows
>
> >>> 2010/11/12 Arnaud Bailly <arnaud.oq... at gmail.com>
>
> >>>> Hello Kevin,
> >>>> Thanks. I understand that this is a toolchain issue, I just got used
> >>>> to the nice feeling of having 'cabal install foo' works seamlessly and
> >>>> flawlessly to get me some magic piece of software :-) I will try to be
> >>>> more patient and try to setup a proper toolchain for installing
> >>>> plugins package.
>
> >>>> Arnaud
>
> >>>> On Fri, Nov 12, 2010 at 7:01 PM, Kevin Jardine <kevinjard... at gmail.com>
> >>>> wrote:
> >>>>> This isn't about the plugin functionality, it's about compiling code.
>
> >>>>> As the message says :
>
> >>>>> This requires a Unix compatibility toolchain such as MinGW+MSYS or
> >>>>> Cygwin.
>
> >>>>> You'll find that you need such a toolchain to compile much open source
> >>>>> software, including many Haskell modules, on Windows.
>
> >>>>> Personally I use MinGW+MSYS on my Windows machine. It works very well.
>
> >>>>> Kevin
>
> >>>>> On Nov 12, 3:20 pm, Arnaud Bailly <arnaud.oq... at gmail.com> wrote:
> >>>>>> Hello,
> >>>>>> I recently tried to
>
> >>>>>> cabal install plugins
>
> >>>>>> on a windows box and it failed with the following error:
>
> >>>>>> Resolving dependencies...
> >>>>>> Downloading plugins-1.5.1.4...
> >>>>>> Configuring plugins-1.5.1.4...
> >>>>>> cabal: The package has a './configure' script. This requires a Unix
> >>>>>> compatibility toolchain such as MinGW+MSYS or Cygwin.
> >>>>>> cabal: Error: some packages failed to install:
> >>>>>> plugins-1.5.1.4 failed during the configure step. The exception was:
> >>>>>> ExitFailure 1
>
> >>>>>> What solution can I use to load dynamically code in a cross-platform
> >>>>>> way ?
>
> >>>>>> Thanks in advance
> >>>>>> Arnaud
> >>>>>> _______________________________________________
> >>>>>> Haskell-Cafe mailing list
>
> >>>>>> Haskell-C... at haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe
> >>>>> _______________________________________________
> >>>>> Haskell-Cafe mailing list
> >>>>> Haskell-C... at haskell.org
> >>>>>http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> >>>> _______________________________________________
> >>>> Haskell-Cafe mailing list
> >>>> Haskell-C... at haskell.org
> >>>>http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> >> _______________________________________________
> >> Haskell-Cafe mailing list
> >> Haskell-C... at haskell.org
> >>http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-C... at haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe


More information about the Haskell-Cafe mailing list