MiniExcel
MiniExcel copied to clipboard
Lua: undefined symol: luaopen_miniexcel
I am using CentOS7 and Lua5.1.4 was initially installed.
Perhaps for this reason, CMake fails to find Lua.
I remove if (BUILD_LUA)
and find_package(Lua51 REQUIRED)
, and replace the ${LUA_INCLUDE_DIR}
as my local path.
Then I just
mkdir build
cd build
cmake ..
cmake --build .
Compile Error. I have to add -std=c++11 option, and add some head file including "string" and "stdio.h", then the commands work well and I get a .so
file libminiexcel.so
.
After that, I copy the file test.lua
into /build
, and run lua test.lua
, and it report a failure: Can't find miniexcel.
So I modify 'libminiexcel.so' as 'miniexcel.so
', then the lua program complains that
lua: error loading module 'miniexcel' from file 'miniexcel.so':
./miniexcel.so: undefined symol: luaopen_miniexcel
How to fix this? Thanks in advance.
I think I fixed. Retry please.
It looks good now though still lacking some head files.
I suggest adding #include<cstring>
to test.cpp
and LuaMiniExcel.cpp
.