CMake 在源文件附近找不到头文件
CMake cannot find header file near the source one
我不想在我的系统中全局安装 sqlite,所以我从 https://www.sqlite.org/2018/sqlite-amalgamation-3240000.zip 下载了 sqlite3 文件,并将sqlite3.c
和 sqlite3.h 复制到项目文件夹中。
CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
project(learn_cpp)
set(CMAKE_CXX_STANDARD 11)
add_executable(learn_cpp main.cpp)
主要.cpp :
#include <iostream>
#include "sqlite3.h"
int main() {
return 0;
}
我没有按照CLion IDE中的建议从sqlite3.h
获得任何函数。
默认情况下,CMake 不会搜索当前目录中的头文件。要启用此行为,请设置CMAKE_INCLUDE_CURRENT_DIR变量:
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(learn_cpp main.cpp ...)
相关文章:
- C++ ZBar cmake 错误"找不到文件"时包括
- 如何修复使用VScode调试器gcc调试时的"找不到文件"错误
- C++找不到文件
- Windows Subsystem for Linux (WSL) 下的间歇性随机"找不到文件"错误
- Makefile在Linux中工作,但在Windows下不起作用,在子目录中找不到文件
- Nemiver 找不到文件 /build/glibc-LK5gWL/glibc-2.23/stdlib/random.c
- 在 Windows 10 上找不到 ./****.h 文件 qt5,C++
- 找不到文件或目录
- ld:找不到文件:/usr/lib/crt1.o
- sip:找不到文件"QtGui/QtGuimod.sip"
- 生成文件错误 - 找不到文件 - *.cpp
- 错误53:找不到文件,而是路径中存在所有DLL
- YAML::LoadFile(std::string const&) 找不到文件 [ROS 中的 yaml-cpp]
- 在英特尔C++编译器 (Linux) 的配置搜索路径中找不到文件可执行文件
- CMake 包含错误(找不到文件、未定义引用)
- 尝试包含id3lib标头时出现找不到文件错误
- 在iOS设备上找不到文件QT创建者C QstandardPaths :: StandardLocations(Qs
- 生成可执行文件时找不到文件,但在eclipse c 中运行正常
- Rcpp:将C++函数移植到 R 中,'Rcpp.h'找不到文件
- CodeBlocks MinGW版本找不到文件,必须手动包含在链接器中