如何将lua5.1添加到CMakeLists.txt?错误:未找到 lua.hpp
How to add lua5.1 to CMakeLists.txt? error: lua.hpp is not found
我在CMakeLists中添加了以下行.txt:
find_package(Lua51 REQUIRED)
include_directories(${LUA_INCLUDE_DIRS})
target_link_libraries(cmqhd ${LUA_LIBRARIES} ${Boost_LIBRARIES} ${GOBJECT_LIBRARIES} -lntl -lm -lgmp )
我仍然收到错误:
In file included from /home/kirill/Dropbox/work/dev/cmqhd/source/main.cc:10:0:
/home/kirill/Dropbox/work/dev/cmqhd/source/lua_read.h:9:17: fatal error: lua.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/cmqhd.dir/source/main.cc.o] Error 1
make[1]: *** [CMakeFiles/cmqhd.dir/all] Error 2
make: *** [all] Error 2
文件 lua_read.h 具有以下标头:
#ifndef LUA_READ_H
#define LUA_READ_H
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <lua.hpp>
...
更新 (1)
g++ main.C -I/usr/include/lua5.1/ -llua5.1
编译
${LUA_INCLUDE_DIR}
而不是 ${LUA_INCLUDE_DIRS}
(dir, not dirS)
相关文章:
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- VS Code C++:不准确的系统包括路径错误(wchar.h,boost/lambda/lambda.hpp)
- 致命错误:找不到'boost/uuid/uuid.hpp'文件
- 造成致命错误:boost/fusion/iterator/equal_to.hpp 没有这样的文件或目录
- 错误: C1083: 无法打开包含文件:"boost/asio.hpp": 没有此类文件或目录
- C++ Boost-iostream:包含 filtering_streambuf.hpp 时出现神秘错误
- 使用Cygwin win32_api.hpp编译Boost Log中的错误
- 在thread.hpp上boost asio udp 螺纹= get_id()错误
- 致命错误:找不到 SFML/System.hpp' 文件
- 致命错误:opencv2/core.hpp:opencv4 中没有此类文件或目录编译终止
- 致命错误:opencv2/sfm.hpp:没有这样的文件或目录 #include < opencv2/sfm.hpp>
- C1001:编译器中包含 <boost/shared_ptr.hpp 时发生内部错误>
- 错误:opencv2/core/core.hpp:没有这样的文件或目录
- 编译错误与 boost/algorithm/string/trim.hpp.
- opencv 2.4.7在iOS错误背景_segm.hpp #include&lt; list&gt;未找到
- OpenCV 编译错误与非自由/feature2d.hpp.
- 错误 C1083 无法在 VS 2015 中打开包含文件:"opencv2\opencv.hpp"
- 致命错误:opencv2/nonfree/nofree.hpp:没有这样的文件或目录
- 在SWIG中包含OpenCV core.hpp时出现语法错误
- Opencv 2.4 编译错误与 objectdetect.hpp.