ThePhD / sol2

Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
http://sol2.rtfd.io/
MIT License
4.18k stars 515 forks source link

how to use Sol with lua dll? #1533

Closed Intervel closed 1 year ago

Intervel commented 1 year ago

what macro to use?

i download lua from the official.

https://luabinaries.sourceforge.net/download.html i chose Windows x64 DLL and Includes(MingW-w64 6 Built)

got this binary dll

1

no lib file, only dll.

congard commented 1 year ago

sol is a CMake project. So the easiest way to use Lua is to use it via CMake.

Then just create CMakeLists.txt like this:

cmake_minimum_required(VERSION 3.26)
project(Sol2Test LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)

add_subdirectory(Lua)
include_directories(Lua/lua-5.4.6/include)

add_subdirectory(sol2)
include_directories(sol2/include)

add_executable(Sol2Test main.cpp)