<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
The fundamental thing is that in --make mode, GHC figures out the required<br>Haskell dependencies itself. So it sees the import and looks in which<br>package it&#39;s provided and links (if necessary) with that package.<br>
But when you tell it to link a couple of .o files, it&#39;s not in --make mode,<br>so apart from the specified files it links in only symbols from a few<br>select packages (I think the wired-in packages), so then you have to tell<br>
it which other packages it needs to link in.<br>$ ghc -shared -package regex-genex -o genexlib.dll genexlib.o<br>genexlib_stub.o start.o<br>should fix the undefined reference.</blockquote><br><div>Aaaaaaaaaaa!<div>You are the Great Magician!</div>
<div><br></div><div><div class="HOEnZb"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
&gt; compiling:<br>&gt; &gt;ghc -c genexlib.hs<br>&gt; &gt;ghc -c start.c<br>&gt; &gt;ghc -shared -o genexlib.dll genexlib.o genexlib_stub.o start.o<br>Why the separate compilation? Can&#39;t you compile them in one go?</blockquote>
<div> </div><div> Sorry for a stupid question, how is it?</div></div></div><div><br></div><div><div class="gmail_quote">And one more question, please: how I can export genexPure :: [String] -&gt; [String] to achieve all preferences of lazy list? Not all array at once, but to get someting like an iterator, what I can call to get new genex.</div>
</div></div><div class="gmail_quote"><br></div><div class="gmail_quote">--</div><div class="gmail_quote">Thanks a lot, </div><div class="gmail_quote">Alexander Popov.</div><div class="gmail_quote"><br></div>