-
Notifications
You must be signed in to change notification settings - Fork 635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Build error: Failed compiling module mime\core.dll" on Windows #429
Comments
I'm not familiar with Windows build issues, but here are a few folks around that use it there so hopefully somebody can chime in. It looks like you're probably missing some library or header path so the builder doesn't know where to link some functions. |
Thanks for your kindly reply and advice |
Hi! I'm new to Lua and I just wanted to install luasockets via luarocks but I'm stuck on the same issue and no idea how to solve it. The issue seems to be the same, if not, my apologies: luarocks install luasocket
Installing https://luarocks.org/luasocket-3.1.0-1.src.rock
luasocket 3.1.0-1 depends on lua >= 5.1 (5.4-1 provided by VM: success)
x86_64-w64-mingw32-gcc -O2 -c -o src/luasocket.o -IC:\Dev\lua src/luasocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/timeout.o -IC:\Dev\lua src/timeout.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/buffer.o -IC:\Dev\lua src/buffer.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/io.o -IC:\Dev\lua src/io.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/auxiliar.o -IC:\Dev\lua src/auxiliar.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/options.o -IC:\Dev\lua src/options.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
src/options.c: In function 'opt_ip6_setmembership':
src/options.c:406:10: warning: implicit declaration of function 'inet_pton'; did you mean 'inet_aton'? [-Wimplicit-function-declaration]
if (!inet_pton(AF_INET6, lua_tostring(L, -1), &val.ipv6mr_multiaddr))
^~~~~~~~~
inet_aton
x86_64-w64-mingw32-gcc -O2 -c -o src/inet.o -IC:\Dev\lua src/inet.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/except.o -IC:\Dev\lua src/except.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/select.o -IC:\Dev\lua src/select.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/tcp.o -IC:\Dev\lua src/tcp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/udp.o -IC:\Dev\lua src/udp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/compat.o -IC:\Dev\lua src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/wsocket.o -IC:\Dev\lua src/wsocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -shared -o C:\Users\BLACKB~1\AppData\Local\Temp\luarocks_build-LuaSocket-3.1.0-1-3248744\socket\core.dll src/luasocket.o src/timeout.o src/buffer.o src/io.o src/auxiliar.o src/options.o src/inet.o src/except.o src/select.o src/tcp.o src/udp.o src/compat.o src/wsocket.o -lws2_32 C:\Dev\lua\lua54.dll -lm
x86_64-w64-mingw32-gcc -O2 -c -o src/mime.o -IC:\Dev\lua src/mime.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -O2 -c -o src/compat.o -IC:\Dev\lua src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
x86_64-w64-mingw32-gcc -shared -o C:\Users\BLACKB~1\AppData\Local\Temp\luarocks_build-LuaSocket-3.1.0-1-3248744\mime\core.dll src/mime.o src/compat.o -Lc:\windows\system32 C:\Dev\lua\lua54.dll -lm
C:/Dev/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x16d): undefined reference to `_execute_onexit_table'
C:/Dev/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x8): undefined reference to `_initialize_onexit_table'
C:/Dev/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/dllcrt2.o:crtdll.c:(.text+0x38b): undefined reference to `_register_onexit_function'
C:/Dev/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o):pseudo-reloc.c:(.text.unlikely+0x28): undefined reference to `__acrt_iob_func'
C:/Dev/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o):pseudo-reloc.c:(.text.unlikely+0x51): undefined reference to `__acrt_iob_func'
collect2.exe: error: ld returned 1 exit status
Error: Build error: Failed compiling module mime\core.dll |
Again I'm not on Windows and many people that are don't have this problem, so I suggest you guys talk a little bit and compare environments and figure out what is unique about your situation. Given that this failure is at link time one thing to check might be all the environment variables and default build flags in relation to gcc/ld, this might be an LTO related failure of something getting optimized to early. |
gcc -v C:\Users\77045>luarocks install luasay Error: No results matching query were found for Lua 5.4. C:\Users\77045>lua C:\Users\77045>luarocks install say C:\Users\77045>luarocks install say --force C:\Users\77045>luarocks install luasocket luasocket 3.1.0-1 depends on lua >= 5.1 (5.4-1 provided by VM: success) Error: Build error: Failed compiling module mime\core.dll |
@alerque this line: luasocket/luasocket-scm-3.rockspec Line 37 in e3ca4a7
seems to be the culprit. Do you recall why it was commented out? |
Nope, it came from #383 so maybe @goldenstein64 knows something. I'm reliant on contributors and reporters for Windows issues, I don't have any way to test them properly locally. |
It looks like I'm still able to compile v3.1.0, tested with MinGW from nuwen 18.0 and 19.0. This is the output I get:
gcc 13.2.0 specs:
and building with that flag uncommented leads to an error.
I'm gonna look at the build steps others provided, there may be a dependency being added/removed somewhere. And I'm also going to say that I'm not an expert with C or anything, I just tried something in that rockspec and that made it work for whatever reason. |
Now that I updated my LuaRocks, I'm getting the same error :)
I'm still not sure what could be causing it at the moment. |
I tried adding the same fix for diff --git a/rockspecs/luasocket-3.1.0-1.rockspec b/rockspecs/luasocket-3.1.0-1.rockspec
index 2d724ac..a386404 100644
--- a/rockspecs/luasocket-3.1.0-1.rockspec
+++ b/rockspecs/luasocket-3.1.0-1.rockspec
@@ -114,6 +114,7 @@ local function make_plat(plat)
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c"
modules["socket.core"].libraries = { "ws2_32" }
modules["socket.core"].libdirs = {}
+ modules["mime.core"].libdirs = {}
end
return { modules = modules }
end
I will make a PR. Someone please test this patch. |
luarocks install luasocket
Installing https://luarocks.org/luasocket-3.1.0-1.src.rock
luasocket 3.1.0-1 depends on lua >= 5.1 (5.4-1 provided by VM: success)
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/luasocket.o -IC:\Program Files\Lua/include src/luasocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/timeout.o -IC:\Program Files\Lua/include src/timeout.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/buffer.o -IC:\Program Files\Lua/include src/buffer.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/io.o -IC:\Program Files\Lua/include src/io.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/auxiliar.o -IC:\Program Files\Lua/include src/auxiliar.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/options.o -IC:\Program Files\Lua/include src/options.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/inet.o -IC:\Program Files\Lua/include src/inet.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/except.o -IC:\Program Files\Lua/include src/except.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/select.o -IC:\Program Files\Lua/include src/select.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/tcp.o -IC:\Program Files\Lua/include src/tcp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/udp.o -IC:\Program Files\Lua/include src/udp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/compat.o -IC:\Program Files\Lua/include src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/wsocket.o -IC:\Program Files\Lua/include src/wsocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -shared -o C:\Users\user\AppData\Local\Temp\luarocks_build-LuaSocket-3.1.0-1-7780209\socket\core.dll src/luasocket.o src/timeout.o src/buffer.o src/io.o src/auxiliar.o src/options.o src/inet.o src/except.o src/select.o src/tcp.o src/udp.o src/compat.o src/wsocket.o -lws2_32 C:\Program Files\Lua\lib\lua54.dll -lm
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/mime.o -IC:\Program Files\Lua/include src/mime.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/compat.o -IC:\Program Files\Lua/include src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -shared -o C:\Users\user\AppData\Local\Temp\luarocks_build-LuaSocket-3.1.0-1-7780209\mime\core.dll src/mime.o src/compat.o -Lc:\windows\system32 C:\Program Files\Lua\lib\lua54.dll -lm
ld.lld: error: undefined symbol: _initialize_onexit_table
>>> referenced by ../crt/crtdll.c:64
>>> C:/Program Files/LLVM/llvm-mingw-20240619-ucrt-x86_64/x86_64-w64-mingw32/lib/dllcrt2.o:(pre_c_init)
ld.lld: error: undefined symbol: _execute_onexit_table
>>> referenced by ../crt/crtdll.c:130
>>> C:/Program Files/LLVM/llvm-mingw-20240619-ucrt-x86_64/x86_64-w64-mingw32/lib/dllcrt2.o:(_CRT_INIT)
>>> referenced by ../crt/crtdll.c:130
>>> C:/Program Files/LLVM/llvm-mingw-20240619-ucrt-x86_64/x86_64-w64-mingw32/lib/dllcrt2.o:(__DllMainCRTStartup)
>>> referenced by ../crt/crtdll.c:130
>>> C:/Program Files/LLVM/llvm-mingw-20240619-ucrt-x86_64/x86_64-w64-mingw32/lib/dllcrt2.o:(__DllMainCRTStartup)
ld.lld: error: undefined symbol: _register_onexit_function
>>> referenced by ../crt/crtdll.c:207
>>> C:/Program Files/LLVM/llvm-mingw-20240619-ucrt-x86_64/x86_64-w64-mingw32/lib/dllcrt2.o:(atexit)
ld.lld: error: undefined symbol: __acrt_iob_func
>>> referenced by ../crt/pseudo-reloc.c:150
>>> libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o):(__report_error)
>>> referenced by ../crt/pseudo-reloc.c:151
>>> libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o):(__report_error)
clang-18: error: linker command failed with exit code 1 (use -v to see invocation)
Error: Build error: Failed compiling module mime\core.dll The fix above from goldenstein64 above compiled without any errors luarocks make
luasocket scm-3 depends on lua >= 5.1 (5.4-1 provided by VM: success)
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/mime.o -IC:\Program Files\Lua/include src/mime.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/compat.o -IC:\Program Files\Lua/include src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -shared -o C:\Users\user\AppData\Local\Temp\luarocks_build-LuaSocket-scm-3-1902310\mime\core.dll src/mime.o src/compat.o C:\Program Files\Lua\lib\lua54.dll -lm
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/luasocket.o -IC:\Program Files\Lua/include src/luasocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/timeout.o -IC:\Program Files\Lua/include src/timeout.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/buffer.o -IC:\Program Files\Lua/include src/buffer.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/io.o -IC:\Program Files\Lua/include src/io.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/auxiliar.o -IC:\Program Files\Lua/include src/auxiliar.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/options.o -IC:\Program Files\Lua/include src/options.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/inet.o -IC:\Program Files\Lua/include src/inet.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/except.o -IC:\Program Files\Lua/include src/except.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/select.o -IC:\Program Files\Lua/include src/select.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/tcp.o -IC:\Program Files\Lua/include src/tcp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/udp.o -IC:\Program Files\Lua/include src/udp.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/compat.o -IC:\Program Files\Lua/include src/compat.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -O2 -c -o src/wsocket.o -IC:\Program Files\Lua/include src/wsocket.c -DLUASOCKET_DEBUG -DWINVER=0x0501 -Ic:\windows\system32\include
"C:\Program Files\LLVM\llvm-mingw-20240619-ucrt-x86_64\bin\x86_64-w64-mingw32-gcc.exe" -shared -o C:\Users\user\AppData\Local\Temp\luarocks_build-LuaSocket-scm-3-1902310\socket\core.dll src/luasocket.o src/timeout.o src/buffer.o src/io.o src/auxiliar.o src/options.o src/inet.o src/except.o src/select.o src/tcp.o src/udp.o src/compat.o src/wsocket.o -lws2_32 C:\Program Files\Lua\lib\lua54.dll -lm
No existing manifest. Attempting to rebuild...
luasocket scm-3 is now installed in C:\Users\user/lua_modules (license: MIT) |
I have installed the lua54 version of window. And installed the luarocks of 3.11.0 version. Environment path have been added. When I use the shell command of luarocks install luasocket to install the luasoket package,It show the following issue.Is anybody meet the same issue? and How to solve it'?
The text was updated successfully, but these errors were encountered: