MiniExcel icon indicating copy to clipboard operation
MiniExcel copied to clipboard

Lua: undefined symol: luaopen_miniexcel

Open bacTlink opened this issue 8 years ago • 2 comments

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.

bacTlink avatar Aug 29 '16 08:08 bacTlink

I think I fixed. Retry please.

qcdong2016 avatar Aug 29 '16 16:08 qcdong2016

It looks good now though still lacking some head files. I suggest adding #include<cstring> to test.cpp and LuaMiniExcel.cpp.

bacTlink avatar Aug 30 '16 03:08 bacTlink