On Wed, Jun 27, 2012 at 2:33 PM, Benoit Germain <bnt.germ...@gmail.com> wrote: > Hello, > > I am in the process of converting the Lanes rockspec from a "make" build > type to a "builtin" build type. > > Lanes consists of one Lua module lanes.lua, and one C module > lua51-lanes.[so|dll]. > > With the rockspec as follows: > > ["lanes51"] = > { > sources = { "src/lanes.c", "src/keeper.c", "src/tools.c", > "src/threading.c"}, > incdirs = { "src"}, > }, >
Are you sure the error below corresponds to the snippet above? I don't see "lanes51" down there. > I get the following error: > > link -dll -def:lua51-lanes.def -out:lua51-lanes.dll > c:/SDK/LuaRocks/2.0/lua5.1.lib src/lanes.obj src/keeper.obj src/tools.obj > src/threading.obj > Microsoft (R) Incremental Linker Version 10.00.40219.01 > Copyright (C) Microsoft Corporation. All rights reserved. > > lua51-lanes.def : error LNK2001: symbole externe non résolu > luaopen_lua51-lanes > lua51-lanes.lib : fatal error LNK1120: 1 externes non résolus > > However, Lua documentation for package.loaders says: > > "Moreover, if the module name has a hyphen, its prefix up to (and including) > the first hyphen is removed. For instance, if the module name is a.v1-b.c, > the function name will be luaopen_b_c. " > > In this light, shouldn't LuaRocks remove the prefix as well to look for the > module entry point? Indeed, this is a bug in the builtin handler for Windows. Thanks for the report. I can't test it here right now, but please check if editing build/builtin.lua and changing def:write("luaopen_"..name:gsub("%.", "_").."\n") ...to.. def:write("luaopen_"..name:gsub("%.", "_"):gsub(".*-", "").."\n") ...does the trick. BTW, is naming the module "lua51-lanes" really necessary, given that the libraries directory is usually already versioned? (as in /lib/lua/5.1/) -- Hisham ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Luarocks-developers mailing list Luarocks-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/luarocks-developers