I have a web server which load server extensions. these extensions eval-uate configuration files that contains code (user-editable workflow descriptions). The problem is that I need common definitions for the extensions and for the configurration files. This is not permitted by ha-plugins.<br>
<div class="gmail_quote">
<br>The minimal code example are the files below. main loads eval.hs , that evaluate a expression. The common definitions are in Include.hs. The error is:<br><br><i>GHCi runtime linker: fatal error: I found a duplicate definition for symbol<br>
Include_sum1_srt<br>whilst processing object file<br> /home/magocoal/haskell/devel/votesWorkflow/src/unused/tests/Include.o<br>This could be caused by:<br> * Loading two different object files which export the same symbol<br>
* Specifying the same object file twice on the GHCi command line<br> * An incorrect `package.conf' entry, causing some object to be<br> loaded twice.<br>GHCi cannot safely continue in this situation. Exiting now. Sorry.<br>
</i><br><br><i></i><br>Do you kno how to solve the problem while maintaining the functionality?<br>
<br>-------Include.hs-------<br>module Include where<br><br>sum [x,y]= x+y<br><br><br>------Main.hs----- <br>module Main where <br>
import Include<br>import System.Plugins<br><br>main= do<br> s <-loadExec "eval.o" "mainc" <br> print s<br> <br>loadExec:: String-> String->IO String
<br>loadExec file method = do
<br>
<br> mv <- load file ["."] [] method
<br> case mv of
<br> LoadSuccess mod v -> v :: IO String
<br> LoadFailure msg -> return $ concat msg
<br> <br><br><br>------------Eval.hs--------<br><br>module Eval(mainc) where<br>import System.IO.Unsafe<br>import System.Eval.Haskell<br><br>mainc= do i <- unsafeEval_ "sum1 [1,2]" ["Include"] [] []["."] :: IO (Either [String] Int)<br>
return $ show i <br><br><br> <br></div><br>