mardi 6 avril 2021

How to fix error soft_int/src_int.h: No such file or directory?

I don't understand how I must fix it.

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

It's the screenshot that showing at a glance the folder hierarchy enter image description here

It's the empty file that contents an error.

#include <soft_int/src_int.h>

namespace {

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

}

This is the clout of root CMakeLists.txt file.

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})

I don't know how I do properly linking all this files. I know then I have a bad cmake code style. Pleas tell me, how I do it right and the good style

Aucun commentaire:

Enregistrer un commentaire