如何修复错误 soft_int/src_int.h: No such file or directory?

时间:2021-04-06 20:39:27

标签: c++11 cmake clion c++20

我不明白我必须如何修复它。

fatal error: soft_int/src_int.h: No such file or directory
    7 | #include <soft_int/src_int.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

这是一目了然显示文件夹层次结构的屏幕截图 enter image description here

这是包含错误的空文件。

#include <soft_int/src_int.h>

namespace {

MODULE("$Id: //path/path/... $");

}

这是根 CMakeLists.txt 文件的影响。

include_directories(src_int/interfaces/soft_int)

#------------------ SRC -------------------------------
set(SOURCES_FOR_INI_PARSER_ONE
        src/ini_parser_a/inifile.cpp
        src/ini_parser_a/inifile_perser_private.cpp)

set(HEADERS_FOR_INI_PARSERS_ONE
        src/ini_parser_a/inifile_perser_private.h
        src/interfaces/ini_parser_a/inifile.h
        src/interfaces/ini_parser_a/types.h)

set(SOURCES_FOR_INI_PARSER_TWO
        src/ini_parser_b/config_provider.cpp
        src/ini_parser_b/data_structures.cpp
        src/ini_parser_b/ini_file.cpp
        src/ini_parser_b/ini_parser.cpp
        src/ini_parser_b/type_checker.cpp)

set(HEADERS_FOR_INI_PARSERS_TWO
        src/ini_parser_b/ini_parser.h
        src/ini_parser_b/type_checker.h
        src/interfaces/ini_parser_b/any.h
        src/interfaces/ini_parser_b/config_provider.h
        src/interfaces/ini_parser_b/data_structures.h
        src/interfaces/ini_parser_b/ini_file.h
        src/interfaces/ini_parser_b/types.h)
#----------------- SOFT_INT ------------------------------

set(SOURCES_FOR_SOFT_INT
        src_int/soft_int/empty.cpp)

set(HEADERS_FOR_SOFT_INT
        src_int/include/hidden_functions.h
        src_int/include/internal_soft_int.h
        src_int/interfaces/soft_int/private/helpers.h
        src_int/interfaces/soft_int/crc64_a.h
        src_int/interfaces/soft_int/crc64_b.h
        src_int/interfaces/soft_int/exe_int.h
        src_int/interfaces/soft_int/exe_int_helper.h
        src_int/interfaces/soft_int/seq_ctrl.h
        src_int/interfaces/soft_int/src_int.h
        src_int/interfaces/soft_int/txt_int.h
        src_int/interfaces/soft_int/verify.h)

#------------------ SOFT_INT_A ---------------------------

SET(SOURCES_FOR_SOFT_INT_A
        src_int/soft_int_a/crc64_a.cpp
        src_int/soft_int_a/crc64_b.cpp
        src_int/soft_int_a/exe_int.cpp
        src_int/soft_int_a/hidden_functions.cpp
        src_int/soft_int_a/internal.cpp
        src_int/soft_int_a/seq_ctrl.cpp
        src_int/soft_int_a/src_int.cpp
        src_int/soft_int_a/text_int.cpp
        src_int/soft_int_a/unsafe.cpp
        src_int/soft_int_a/verify.cpp)

#------------------ SOFT_INT_B ---------------------------

set(SOURCES_FOR_SOFT_INT_B
        src_int/soft_int_b/crc64_a.cpp
        src_int/soft_int_b/crc64_b.cpp
        src_int/soft_int_b/crc_file_reader.cpp
        src_int/soft_int_b/exe_int.cpp
        src_int/soft_int_b/marker_detect.cpp
        src_int/soft_int_b/placeholder.cpp)

set(HEADERS_FOR_SOFT_INT_B
        src_int/soft_int_b/crc_file_reader.h
        src_int/soft_int_b/marker_detect.h)

#------------- here we linking the libs ------------------------------------

add_library(src STATIC ${SOURCES_FOR_INI_PARSER_ONE} ${SOURCES_FOR_INI_PARSER_TWO} ${HEADERS_FOR_INI_PARSERS_ONE} ${HEADERS_FOR_INI_PARSERS_TWO})
add_library(soft_int STATIC ${SOURCES_FOR_SOFT_INT} ${HEADERS_FOR_SOFT_INT})
add_library(soft_int_a STATIC ${SOURCES_FOR_SOFT_INT_A})
add_library(soft_int_b STATIC ${SOURCES_FOR_SOFT_INT_B} ${HEADERS_FOR_SOFT_INT_B})

我不知道如何正确链接所有这些文件。我知道我的 cmake 代码风格很糟糕。请告诉我,我是如何做的,以及好的风格

0 个答案:

没有答案