CMion的CMake问题 - 错误:无法确定目标“XYZ”的链接语言

时间:2015-09-29 16:06:38

标签: c++ cmake clion

启动CLion会输出以下内容:

Error:Cannot find source file:
  sinclude/MathCompiler.h
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx
Error:CMake can not determine linker language for target: MathCompiler
Error:Cannot determine link language for target "MathCompiler".
Warning:Configuration Debug
Unable to determine product file path for target MathCompiler (Debug). Running and debugging will be unavailable.
Warning:Configuration Release
Unable to determine product file path for target MathCompiler (Release). Running and debugging will be unavailable.
Warning:Configuration RelWithDebInfo
Unable to determine product file path for target MathCompiler (RelWithDebInfo). Running and debugging will be unavailable.
Warning:Configuration MinSizeRel
Unable to determine product file path for target MathCompiler (MinSizeRel). Running and debugging will be unavailable.

自上次构建以来,我没有改变任何内容。

这是CMakeLists.txt

cmake_minimum_required(VERSION 3.3)
project(MathCompiler)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(SOURCE_FILES main.cpp cpp/MathCompiler.cpp include/MathCompiler.h cpp/MathException.cpp include/MathException.h cpp/MathematicString.cpp include/MathematicString.h include/str_cmp.h include/typedefs.h)
add_executable(MathCompiler ${SOURCE_FILES})

1 个答案:

答案 0 :(得分:2)

.h文件通常不包含在源文件列表中