q66 / cffi-lua

A portable C FFI for Lua 5.1+
MIT License
171 stars 24 forks source link

windows build issues #37

Closed DmitryOvsyannikov1978 closed 1 year ago

DmitryOvsyannikov1978 commented 1 year ago

Hello guys

Trying to build cffi-lua for windows x64. Prior to this have built lua (dll, lib, compirer and interpreter). Downloaded cffi-lua sources using MCVS 2022. Istalled Meson / Python etc

When trying ti build using meson / ninja a have got multiple issues, some of them I was able to resolve but not all. Please help.

c:\Users\79151\source\repos\cffi-lua\build>meson .. -Dlua_version=5.4 -Dlibffi=vendor The Meson build system Version: 1.0.0 Source dir: C:\Users\79151\source\repos\cffi-lua Build dir: C:\Users\79151\source\repos\cffi-lua\build Build type: native build Project name: cffi-lua Project version: 0.2.3 C++ compiler for the host machine: cl (msvc 19.34.31937 "��⨬������騩 ��������� Microsoft (R) C/C++ ���ᨨ 19.34.31937 ��� x64") C++ linker for the host machine: link link 14.34.31937.0 Host machine cpu family: x86_64 Host machine cpu: x86_64 Compiler for C++ supports arguments -Wshadow: NO Compiler for C++ supports arguments -Wold-style-cast: NO Did not find pkg-config by name 'pkg-config' Found Pkg-config: NO Found CMake: C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.EXE (3.24.202208181) Run-time dependency lua5.4 found: NO (tried pkgconfig and cmake) Run-time dependency lua-5.4 found: NO (tried pkgconfig and cmake) Run-time dependency lua54 found: NO (tried pkgconfig and cmake) Run-time dependency lua found: YES 5.4.4 Library ffi found: YES Library dl found: NO Computing int of "LUA_VERSION_NUM" with dependency lua: 504 Library lua found: NO Library lua5.4 found: NO Library lua54 found: YES Program lua54 found: YES (C:\Program Files\Lua54\lua54.EXE) WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300 Build targets in project: 2 NOTICE: Future-deprecated features used:

cffi-lua 0.2.3

User defined options libffi : vendor lua_version: 5.4

Found ninja-1.11.1 at "C:\Program Files\Meson\ninja.EXE" WARNING: Running the setup command as meson [options] instead of meson setup [options] is ambiguous and deprecated.

c:\Users\79151\source\repos\cffi-lua\build>ninja all [1/10] Compiling C++ object cffi.dll.p/src_ast.cc.obj FAILED: cffi.dll.p/src_ast.cc.obj "cl" "-Icffi.dll.p" "-I." "-I.." "-I..\deps\include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:cplusplus" "/W4" "/EHs-c-" "/GR-" "/std:c++14" "/permissive-" "/O2" "/Zi" "-DCFFI_LUA_DLL" "-DFFI_LITTLE_ENDIAN" "/Fdcffi.dll.p\src_ast.cc.pdb" /Focffi.dll.p/src_ast.cc.obj "/c" ../src/ast.cc c:\Users\79151\source\repos\cffi-lua\src\lua.hh(23): fatal error C1083: Не удается открыть файл включение: lua.hpp: No such file or directory, [4/10] Compiling C++ object cffi.dll.p/src_ffilib.cc.obj FAILED: cffi.dll.p/src_ffilib.cc.obj "cl" "-Icffi.dll.p" "-I." "-I.." "-I..\deps\include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:cplusplus" "/W4" "/EHs-c-" "/GR-" "/std:c++14" "/permissive-" "/O2" "/Zi" "-DCFFI_LUA_DLL" "-DFFI_LITTLE_ENDIAN" "/Fdcffi.dll.p\src_ffilib.cc.pdb" /Focffi.dll.p/src_ffilib.cc.obj "/c" ../src/ffilib.cc c:\Users\79151\source\repos\cffi-lua\src\lua.hh(23): fatal error C1083: Не удается открыть файл включение: lua.hpp: No such file or directory, [5/10] Compiling C++ object cffi.dll.p/src_lib.cc.obj FAILED: cffi.dll.p/src_lib.cc.obj "cl" "-Icffi.dll.p" "-I." "-I.." "-I..\deps\include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:cplusplus" "/W4" "/EHs-c-" "/GR-" "/std:c++14" "/permissive-" "/O2" "/Zi" "-DCFFI_LUA_DLL" "-DFFI_LITTLE_ENDIAN" "/Fdcffi.dll.p\src_lib.cc.pdb" /Focffi.dll.p/src_lib.cc.obj "/c" ../src/lib.cc c:\Users\79151\source\repos\cffi-lua\src\lua.hh(23): fatal error C1083: Не удается открыть файл включение: lua.hpp: No such file or directory, [6/10] Compiling C++ object cffi.dll.p/src_parser.cc.obj FAILED: cffi.dll.p/src_parser.cc.obj "cl" "-Icffi.dll.p" "-I." "-I.." "-I..\deps\include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:cplusplus" "/W4" "/EHs-c-" "/GR-" "/std:c++14" "/permissive-" "/O2" "/Zi" "-DCFFI_LUA_DLL" "-DFFI_LITTLE_ENDIAN" "/Fdcffi.dll.p\src_parser.cc.pdb" /Focffi.dll.p/src_parser.cc.obj "/c" ../src/parser.cc c:\Users\79151\source\repos\cffi-lua\src\lua.hh(23): fatal error C1083: Не удается открыть файл включение: lua.hpp: No such file or directory, [7/10] Compiling C++ object cffi.dll.p/src_main.cc.obj FAILED: cffi.dll.p/src_main.cc.obj "cl" "-Icffi.dll.p" "-I." "-I.." "-I..\deps\include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:cplusplus" "/W4" "/EHs-c-" "/GR-" "/std:c++14" "/permissive-" "/O2" "/Zi" "-DCFFI_LUA_DLL" "-DFFI_LITTLE_ENDIAN" "/Fdcffi.dll.p\src_main.cc.pdb" /Focffi.dll.p/src_main.cc.obj "/c" ../src/main.cc c:\Users\79151\source\repos\cffi-lua\src\lua.hh(23): fatal error C1083: Не удается открыть файл включение: lua.hpp: No such file or directory, [8/10] Compiling C++ object cffi.dll.p/src_ffi.cc.obj FAILED: cffi.dll.p/src_ffi.cc.obj "cl" "-Icffi.dll.p" "-I." "-I.." "-I..\deps\include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:cplusplus" "/W4" "/EHs-c-" "/GR-" "/std:c++14" "/permissive-" "/O2" "/Zi" "-DCFFI_LUA_DLL" "-DFFI_LITTLE_ENDIAN" "/Fdcffi.dll.p\src_ffi.cc.pdb" /Focffi.dll.p/src_ffi.cc.obj "/c" ../src/ffi.cc c:\Users\79151\source\repos\cffi-lua\src\lua.hh(23): fatal error C1083: Не удается открыть файл включение: lua.hpp: No such file or directory, ninja: build stopped: subcommand failed.

c:\Users\79151\source\repos\cffi-lua\build>

In the subdirectory deps I have lua and ffi libs that I was able to build somehow

18.01.2023 11:30

. 18.01.2023 11:30 .. 18.01.2023 11:29 32 256 ffi-8.dll 18.01.2023 11:29 8 140 ffi.lib 18.01.2023 11:35 include 18.01.2023 00:15 18 432 lua.exe 18.01.2023 00:06 299 520 lua54.dll 18.01.2023 00:06 30 278 lua54.lib 5 файлов 388 626 байт

c:\Users\79151\source\repos\cffi-lua\deps>

DmitryOvsyannikov1978 commented 1 year ago

All the commans to build I run from x86_x64 Cross Tools Command Prompt for VS 2022

DmitryOvsyannikov1978 commented 1 year ago

Was able to build it after 2 additional steps.

1) Using vcpkg I've downloaded lua-5-4 and together with the binaries there was an include directory with 5 include files (lauxlib.h, lua.h, lua.hpp, luaconf.h, lualib.h)

2) I put these include file into cffi-lua\subprojects\libffi\include

After that the built was successful. Anyway it would be nice if somebody corrects me what I did wrong.

q66 commented 1 year ago

but your original error output tells you what's wrong? lua.hpp: No such file or directory,

likewise, the build instructions tell you exactly what to do, including to place the headers in the right place, which means you did not follow the instructions properly

DmitryOvsyannikov1978 commented 1 year ago

I disagree because as a user I know nothing about what headers I should add and where to take them from. Probably it makes sence to add them to the repository