Ok, so I just downloaded the two archives and unzipped both them in the same directory as the MeltingSaga exectuable, but I still get the same error
.
[klafyvel@klafyvel bin]$ ./MeltingSaga
Data/GameScripts/ScrInit.lua:20: unexpected symbol near ';'
[string "protect("ID")"]:1: attempt to call global 'protect' (a nil value)
[string "protect("Private")"]:1: attempt to call global 'protect' (a nil value)
[string "protect("Public")"]:1: attempt to call global 'protect' (a nil value)
type mismatch
[string "table.insert(Core.ImportedLibs, "Console")"]:1: attempt to index global 'Core' (a nil value)
PANIC: unprotected error in call to Lua API (attempt to index a nil value)
Could you show me the content of your CMakeLists.txt ?
Of course :
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(MeltingSaga)
if(LM_STATIC_SFML)
SET(SFML_STATIC_LIBRARIES TRUE)
endif()
include_directories(include)
file(
GLOB_RECURSE
source_files
Source/*
)
add_executable(
MeltingSaga
${source_files}
)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
if(WIN32)
find_package(SFML 2 REQUIRED graphics window audio system network main)
else()
find_package(SFML 2 REQUIRED graphics window audio system network)
endif()
target_link_libraries(MeltingSaga ${SFML_LIBRARIES})
find_package(OpenGL REQUIRED)
target_link_libraries(MeltingSaga ${OPENGL_LIBRARIES})
include(cmake/FindLua.cmake)
include_directories(${LUA_INCLUDE_DIRS})
link_directories(${LUA_LIBRARY_DIRS})
include_directories("include")
target_link_libraries(MeltingSaga ${LUA_LIBRARIES})
target_compile_features(MeltingSaga PRIVATE cxx_range_for)
It is not really beautyfull but it works
.
I also replaced every
#include <Windows.h>
to
#ifdef _WIN32
#include <Windows.h>
#endif