<分区>
我正在尝试使用本教程在 Linux (openSuse) 上设置 C++ 开发环境 https://youtu.be/LKLuvoY6U0I?t=154
当我尝试构建 CMake 项目时,我得到了
使用不正确数量的参数调用了 add_executable
我的 CMakeLists.txt:
cmake_minimum_required (VERSION 3.5)
project (CppEnvTest)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++17")
set (source_dir "${PROJECT_SOURCE_DIR}/src/")
file (GLOB source_files "${source_dir}/*.cpp")
add_executable (CppEnvTest ${source_files})
我的build.sh:
#!/bin/sh
cmake -G "CodeLite - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
我的终端输出:
/Dev/CppEnvTest/src> ./build.sh
CMake Error at CMakeLists.txt:10 (add_executable):
add_executable called with incorrect number of arguments
-- Configuring incomplete, errors occurred!