Thomas Hoefer wrote:
> I downloaded H/Direct as a source, adapted it to my settings and then
> typed "make all". [...]
> >ld: fatal: symbol `main' is multiply defined:
> >        (file mkNativeInfo.o and file
> /usr/local/lib/libHSrts.a(main.o));
> >ld: fatal: File processing errors. No output written to ihc
> 
> I don't want to edit the sources, so perhaps you might help  ;)
> 
> Might it be enough to search for a 'new' file "libHSrts.a"?

I ran into the same thing (and more) last week, but I mailed my patches
only to Sigbjorn as I was sure nobody else would be interested in them.
There was no answer yet, but here they are, unapproved, but at least it
compiles...

--------------------------------------------------------------------------------
*** hdirect-0.1/src/Makefile.~1~        Sun May 17 23:17:08 1998
--- hdirect-0.1/src/Makefile    Mon May 18 11:59:23 1998
***************
*** 36,42 ****
  AbstractH.lhs IDLUtils.lhs NameSupply.lhs \
  Attribute.lhs Lex.lhs Opts.lhs \
  BasicTypes.lhs LexM.lhs PP.lhs \
! CgMonad.lhs LibUtils.lhs PpAbstractH.lhs \ 
  CodeGen.lhs Literal.lhs PpCore.lhs \
  CoreIDL.lhs Main.lhs PpIDLSyn.lhs \
  CoreUtils.lhs MarshallDep.lhs PreProc.lhs \
--- 36,42 ----
  AbstractH.lhs IDLUtils.lhs NameSupply.lhs \
  Attribute.lhs Lex.lhs Opts.lhs \
  BasicTypes.lhs LexM.lhs PP.lhs \
! CgMonad.lhs LibUtils.lhs PpAbstractH.lhs \
  CodeGen.lhs Literal.lhs PpCore.lhs \
  CoreIDL.lhs Main.lhs PpIDLSyn.lhs \
  CoreUtils.lhs MarshallDep.lhs PreProc.lhs \
***************
*** 83,90 ****
  clean ::
        rm -f *.o green-card
  
! ihc :: $(ALL_OBJS)
!       $(HC) $(HC_OPTS) -o ihc $(ALL_OBJS)
  
  # Suffix rules (GNU make.)
  %.o : %.lhs    
--- 83,90 ----
  clean ::
        rm -f *.o green-card
  
! ihc :: $(OBJS)
!       $(HC) $(HC_OPTS) -o ihc $^
  
  # Suffix rules (GNU make.)
  %.o : %.lhs    
*** hdirect-0.1/src/MarshallPtr.lhs.~1~ Mon May  4 20:17:54 1998
--- hdirect-0.1/src/MarshallPtr.lhs     Mon May 18 12:26:16 1998
***************
*** 72,78 ****
     w_ty    = funTy (tyCon "Pointer" [b_ty]) 
                     (funTy b_ty io_unit)
     w_def   = funDef w_name [varPat a, varPat arg] w_rhs
!    w_rhs   = funApp (mkQVarName "Addr" ("writeAddrOffAddr")) [a, intLit 0, arg]
     
     {- reference unmarshalling code for [ptr]t*
          r_ptr_t :: Pointer (BaseTy[t*]) -> IO (BaseTy[t*])
--- 72,78 ----
     w_ty    = funTy (tyCon "Pointer" [b_ty]) 
                     (funTy b_ty io_unit)
     w_def   = funDef w_name [varPat a, varPat arg] w_rhs
!    w_rhs   = funApp (mkQVarName (Just "Addr") ("writeAddrOffAddr")) [a, intLit 0, 
arg]
     
     {- reference unmarshalling code for [ptr]t*
          r_ptr_t :: Pointer (BaseTy[t*]) -> IO (BaseTy[t*])
***************
*** 82,87 ****
     r_tysig = typeSig r_name r_ty
     r_ty    = funTy (tyCon "Pointer" [b_ty]) (io b_ty)
     r_def   = funDef r_name [varPat a] r_rhs
!    r_rhs   = funApp (mkQVarName "Addr" ("readAddrOffAddr")) [a, intLit 0]
  
  \end{code}
--- 82,87 ----
     r_tysig = typeSig r_name r_ty
     r_ty    = funTy (tyCon "Pointer" [b_ty]) (io b_ty)
     r_def   = funDef r_name [varPat a] r_rhs
!    r_rhs   = funApp (mkQVarName (Just "Addr") ("readAddrOffAddr")) [a, intLit 0]
  
  \end{code}
*** hdirect-0.1/src/MarshallUnique.lhs.~1~      Mon May  4 20:23:41 1998
--- hdirect-0.1/src/MarshallUnique.lhs  Mon May 18 12:28:01 1998
***************
*** 77,83 ****
                                    (io (tyCon "Maybe" [t_ty])))
     u_def    = funDef u_name [varPat pv] u_rhs
     u_rhs    = 
!      hCase (binOp Eq pv (varName (mkQVarName "Addr" "nullAddr")))
             [ alt (conPat (mkConName "True") [])  (ret nothing)
             , alt (conPat (mkConName "False") []) 
                 (bind (funApp (prefix "u_ref_" show_ty) [pv]) v
--- 77,83 ----
                                    (io (tyCon "Maybe" [t_ty])))
     u_def    = funDef u_name [varPat pv] u_rhs
     u_rhs    = 
!      hCase (binOp Eq pv (varName (mkQVarName (Just "Addr") "nullAddr")))
             [ alt (conPat (mkConName "True") [])  (ret nothing)
             , alt (conPat (mkConName "False") []) 
                 (bind (funApp (prefix "u_ref_" show_ty) [pv]) v
--------------------------------------------------------------------------------

-- 
Sven Panne                                        Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik                     FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen              Oettingenstr. 67
mailto:[EMAIL PROTECTED]            D-80538 Muenchen
http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne

Reply via email to