Note that there are some explanatory texts on larger screens.

plurals
  1. POLinking Error Using HsLua on Windows
    primarykey
    data
    text
    <p>I am having some issues using HsLua as a library. Lua compiles just fine as a standalone. And this version runs on my Linux box without a problem. Here is the linking error I see.</p> <pre><code>GHCi, version 7.4.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude&gt; import Scripting.Lua as Lua Prelude Lua&gt; l &lt;- Lua.newstate Loading package hslua-0.3.4 ... linking ... &lt;interactive&gt;: C:\..\AppData\Roaming\cabal\hslua-0.3.4\ghc-7.4.1\HShslua-0.3.4.o: unknown symbol `___strtod' ghc.exe: unable to load package `hslua-0.3.4' Prelude Lua&gt; </code></pre> <p>I did some poking around the libraries and found the call for strtod and I think I may have been close but obviously not close enough.</p> <p><strong>EDIT</strong></p> <p>This may or may not help. I'll post the cabal file, I made a couple of changes such as adding the os(windows) portion.</p> <pre><code>Name: hslua Version: 0.3.4 ... Extra-source-files: src/*.h Library Build-depends: base==4.* Exposed-modules: Scripting.Lua, Scripting.Lua.ConfigFile Hs-source-dirs: src C-sources: src/lapi.c, src/lauxlib.c, src/lbaselib.c, src/lcode.c, src/ldblib.c, src/ldebug.c, src/ldo.c, src/ldump.c, src/lfunc.c, src/lgc.c, src/linit.c, src/liolib.c, src/llex.c, src/lmathlib.c, src/lmem.c, src/loadlib.c, src/lobject.c, src/lopcodes.c, src/loslib.c, src/lparser.c, src/lstate.c, src/lstring.c, src/lstrlib.c, src/ltable.c, src/ltablib.c, src/ltm.c, src/lundump.c, src/lvm.c, src/lzio.c, src/ntrljmp.c Include-dirs: src ghc-options: -Wall extensions: ForeignFunctionInterface if os(linux) CC-Options: "-DLUA_USE_LINUX" if os(darwin) CC-Options: "-DLUA_USE_MACOSX" if os(freebsd) CC-Options: "-DLUA_USE_POSIX" if os(windows) CC-Options: "-DLUA_BUILD_AS_DLL" includes: stdlib.h </code></pre> <p>I tried a couple of different ways to get the stdlib in the project, I've added it in main headers for the project and I've also specified it in the cabal file. Makes me think that is barking up the wrong tree. </p> <p><strong>EDIT-2</strong></p> <p>Well I haven't been able to get this built yet on win32. A couple of other things I tried to do that didn't work for me just in case someone else runs into the same problem.</p> <p>I linked all of the built object files into a static archive and I got the same error as above. I also tried to use a build DLL and I got a different error but I'm not sure if it were progress forwards or backwards.</p> <pre><code>C:\..\hslua-0.3.4&gt;ghci liblua.dll -package hslua GHCi, version 7.4.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Loading package hslua-0.3.4 ... linking ... ghc.exe: C:\..\hslua-0.3.4\ghc-7.4.1\HShslua-0.3.4.o: unknown symbol `_lua_close' ghc.exe: unable to load package `hslua-0.3.4' </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload