Closed yuyuko-C closed 1 year ago
❌require "bee"
✔require "bee.filesystem"
大概是生成的Dll有问题. 我详细描述一下我的问题, 因为我不太清楚关键点在哪里所以看上去会提供许多无效信息, 请见谅. 请帮帮忙我
我的使用环境是英萌框架的Lua作图. 需要使用bee.filesystem
,bee.http
.
环境信息:
require "bee"
均会报错 error loading module
, 唯独只能在 w3x2lni-lua.exe 里返回 true 和 dll 所在路径. 如果 require "bee.filesystem"
, 在 w3x2lni-lua.exe 里返回 table
, 其他环境里会报错找不到此模块.于是转而使用 luamake
生成, 在完成 Install 的步骤后在 build/msvc/bin 里得到了三个文件
我将三个文件复制到 bee.lua 的目录下,
luamake
命令,
PS G:\Project\bee.lua-master> luamake
[1/17] Compile C++ build/obj/source_bee/lua_unicode.obj
[2/17] Compile C++ build/obj/source_bootstrap/progdir.obj
[3/17] Compile C++ build/obj/source_bee/lua_time.obj
[4/17] Compile C++ build/obj/source_bootstrap/main.obj
[5/17] Compile C++ build/obj/source_bee/lua_platform.obj
[6/17] lua bootstrap/forward_lua.lua 3rd/lua bootstrap/forward_lua.h bootstrap.exe msvc
[7/17] Compile C build/obj/lua54/forward_lua.obj
[8/17] Compile C++ build/obj/source_bee/lua_socket.obj
[9/17] Compile C++ build/obj/source_bee/lua_filewatch.obj
[10/17] Compile C++ build/obj/source_bee/lua_serialization.obj
[11/17] Compile C++ build/obj/source_bee/lua_subprocess.obj
[12/17] Compile C++ build/obj/source_bee/lua_thread.obj
[13/17] Compile C++ build/obj/source_bee/lua_filesystem.obj
[14/17] Link Exe build/bin/bootstrap.exe
正在创建库 build/obj/bootstrap.lib 和对象 build/obj/bootstrap.exp
正在生成代码
已完成代码的生成
[15/17] Link Dll build/bin/lua54.dll
正在创建库 build/obj/lua54/lua54.lib 和对象 build/obj/lua54/lua54.exp
正在生成代码
已完成代码的生成
[16/17] Copy bootstrap/main.lua build/bin/main.lua
[16/17] Run test.
OS: windows 10.0.19041.1706
Arch: x86_64
Compiler: MSVC 192930140.0
CRT: MSVC STL 202104L
DEBUG: false
...............................................................................................
Ran 95 tests in 2.365 seconds, 95 successes, 0 failures
OK
luamake -EXE lua
PS G:\Project\bee.lua-master> luamake -EXE lua
[1/20] Compile C build/obj/lua54/linit.obj
[2/20] Compile C++ build/obj/source_bee/lua_unicode.obj
[3/20] Compile C++ build/obj/source_bee/lua_serialization.obj
[4/20] Compile C build/obj/lua/utf8_crt.obj
[5/20] Compile C build/obj/lua/utf8_lua.obj
[6/20] Compile C build/obj/lua54/utf8_crt.obj
[7/20] Compile C++ build/obj/source_bee/lua_platform.obj
[8/20] Compile C++ build/obj/source_bee/lua_filewatch.obj
[9/20] Compile C++ build/obj/source_bee/lua_socket.obj
[10/20] Compile C++ build/obj/source_bee/lua_time.obj
[11/20] Compile C build/obj/luac/onelua.obj
FAILED: build/obj/luac/onelua.obj
cl /nologo /showIncludes -c 3rd/lua/onelua.c /Fobuild/obj/luac/onelua.obj /EHsc /Zc:__cplusplus /permissive- /O2 /Zc:inline /W3 /WX /MD /GL /D_WIN32_WINNT=0x0601 /DMAKE_LUAC /DNDEBUG
G:\Project\bee.lua-master\3rd\lua\luac.c(146): error C2088: “+”: 对于 union 非法
G:\Project\bee.lua-master\3rd\lua\luac.c(146): warning C4033: “combine”必须返回值
G:\Project\bee.lua-master\3rd\lua\luac.c(152): error C2088: “+”: 对于 union 非法
G:\Project\bee.lua-master\3rd\lua\luac.c(155): error C2088: “+”: 对于 union 非法
[12/20] Compile C build/obj/luac/utf8_crt.obj
[13/20] Compile C build/obj/lua54/onelua.obj
[14/20] Compile C++ build/obj/source_bee/lua_subprocess.obj
[15/20] Compile C++ build/obj/source_bee/lua_thread.obj
[16/20] Compile C++ build/obj/source_bee/lua_filesystem.obj
ninja: build stopped: subcommand failed.
至于昨天使用的 bee.dll 是虽然报错了但依然出现在 build/bin 文件夹里. 在我测试的三个环境里均会报错, 一定是一个无法使用的版本.
YDWE依赖的是旧版本的bee,你得去YDWE的repo里编译。
谢谢, 请问还能告知一下生成DLL报错的问题在哪里吗. 我不理解为什么两个命令一个可行一个不可行.
你更新到最新就好了
谢谢, 更新后的确可以正确生成DLL了.
YDWE的旧版bee应该是指的这个分支吧 bee.lua
我安装了ninja后执行 ninja -f ninja/msvc.ninja
后出现了一大堆的报错. 请问还有救吗?
PS G:\Project\bee.lua-31bd3fabd2dd3aed0f7ce84504ee647a29b9315d> ninja -f ninja/msvc.ninja
[1/69] Compile C build/msvc/obj/lua54/lapi.obj
FAILED: build/msvc/obj/lua54/lapi.obj
cl /nologo /showIncludes -c 3rd/lua/lapi.c /Fobuild/msvc/obj/lua54/lapi.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[2/69] Compile C build/msvc/obj/lua54/lauxlib.obj
FAILED: build/msvc/obj/lua54/lauxlib.obj
cl /nologo /showIncludes -c 3rd/lua/lauxlib.c /Fobuild/msvc/obj/lua54/lauxlib.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[3/69] Compile C build/msvc/obj/lua54/lbaselib.obj
FAILED: build/msvc/obj/lua54/lbaselib.obj
cl /nologo /showIncludes -c 3rd/lua/lbaselib.c /Fobuild/msvc/obj/lua54/lbaselib.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[4/69] Compile C build/msvc/obj/lua54/lcode.obj
FAILED: build/msvc/obj/lua54/lcode.obj
cl /nologo /showIncludes -c 3rd/lua/lcode.c /Fobuild/msvc/obj/lua54/lcode.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[5/69] Compile C build/msvc/obj/lua54/lcorolib.obj
FAILED: build/msvc/obj/lua54/lcorolib.obj
cl /nologo /showIncludes -c 3rd/lua/lcorolib.c /Fobuild/msvc/obj/lua54/lcorolib.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[6/69] Compile C build/msvc/obj/lua54/lctype.obj
FAILED: build/msvc/obj/lua54/lctype.obj
cl /nologo /showIncludes -c 3rd/lua/lctype.c /Fobuild/msvc/obj/lua54/lctype.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[7/69] Compile C build/msvc/obj/lua54/ldblib.obj
FAILED: build/msvc/obj/lua54/ldblib.obj
cl /nologo /showIncludes -c 3rd/lua/ldblib.c /Fobuild/msvc/obj/lua54/ldblib.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[8/69] Compile C build/msvc/obj/lua54/ldebug.obj
FAILED: build/msvc/obj/lua54/ldebug.obj
cl /nologo /showIncludes -c 3rd/lua/ldebug.c /Fobuild/msvc/obj/lua54/ldebug.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[9/69] Compile C build/msvc/obj/lua54/ldo.obj
FAILED: build/msvc/obj/lua54/ldo.obj
cl /nologo /showIncludes -c 3rd/lua/ldo.c /Fobuild/msvc/obj/lua54/ldo.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[10/69] Compile C build/msvc/obj/lua54/ldump.obj
FAILED: build/msvc/obj/lua54/ldump.obj
cl /nologo /showIncludes -c 3rd/lua/ldump.c /Fobuild/msvc/obj/lua54/ldump.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.
PS G:\Project\bee.lua-31bd3fabd2dd3aed0f7ce84504ee647a29b9315d> ninja -f ./ninja/msvc.ninja.
[1/69] Compile C build/msvc/obj/lua54/lapi.obj
FAILED: build/msvc/obj/lua54/lapi.obj
cl /nologo /showIncludes -c 3rd/lua/lapi.c /Fobuild/msvc/obj/lua54/lapi.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[2/69] Compile C build/msvc/obj/lua54/lauxlib.obj
FAILED: build/msvc/obj/lua54/lauxlib.obj
cl /nologo /showIncludes -c 3rd/lua/lauxlib.c /Fobuild/msvc/obj/lua54/lauxlib.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[3/69] Compile C build/msvc/obj/lua54/lbaselib.obj
FAILED: build/msvc/obj/lua54/lbaselib.obj
cl /nologo /showIncludes -c 3rd/lua/lbaselib.c /Fobuild/msvc/obj/lua54/lbaselib.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[4/69] Compile C build/msvc/obj/lua54/lcode.obj
FAILED: build/msvc/obj/lua54/lcode.obj
cl /nologo /showIncludes -c 3rd/lua/lcode.c /Fobuild/msvc/obj/lua54/lcode.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[5/69] Compile C build/msvc/obj/lua54/lcorolib.obj
FAILED: build/msvc/obj/lua54/lcorolib.obj
cl /nologo /showIncludes -c 3rd/lua/lcorolib.c /Fobuild/msvc/obj/lua54/lcorolib.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[6/69] Compile C build/msvc/obj/lua54/lctype.obj
FAILED: build/msvc/obj/lua54/lctype.obj
cl /nologo /showIncludes -c 3rd/lua/lctype.c /Fobuild/msvc/obj/lua54/lctype.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[7/69] Compile C build/msvc/obj/lua54/ldblib.obj
FAILED: build/msvc/obj/lua54/ldblib.obj
cl /nologo /showIncludes -c 3rd/lua/ldblib.c /Fobuild/msvc/obj/lua54/ldblib.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[8/69] Compile C build/msvc/obj/lua54/ldebug.obj
FAILED: build/msvc/obj/lua54/ldebug.obj
cl /nologo /showIncludes -c 3rd/lua/ldebug.c /Fobuild/msvc/obj/lua54/ldebug.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[9/69] Compile C build/msvc/obj/lua54/ldo.obj
FAILED: build/msvc/obj/lua54/ldo.obj
cl /nologo /showIncludes -c 3rd/lua/ldo.c /Fobuild/msvc/obj/lua54/ldo.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
[10/69] Compile C build/msvc/obj/lua54/ldump.obj
FAILED: build/msvc/obj/lua54/ldump.obj
cl /nologo /showIncludes -c 3rd/lua/ldump.c /Fobuild/msvc/obj/lua54/ldump.obj /EHsc /Zc:__cplusplus /O2 /GL /Zc:inline /W3 /permissive- /MD /D_WIN32_WINNT=0x0601 /DLUA_BUILD_AS_DLL /DNDEBUG
CreateProcess failed: The system cannot find the file specified.
ninja: build stopped: subcommand failed.
用YDWE的编译工具来编译
刚去试了一下, 发现完全不知道该怎么做... 不麻烦你了, 谢谢act.
刚去试了一下, 发现完全不知道该怎么做... 不麻烦你了, 谢谢act.
英萌不需要编译bee 如果你一定要编译,luamake也需要旧版本,然后路径加入path环境变量,编译应该是一次过的。另外,你改改就能用最新的bee.lua了。
使用的是
luamake -EXE lua
命令