CMake Error at data-plane/suricata-3.0/src/CMakeLists.txt:548 (TARGET_LINK_LIBRARIES): The keyword signature for target_link_libraries has already been used with the target "dp". All uses of target_link_libraries with a target must be either all-keyword or all-plain. The uses of the keyword signature are here: * data-plane/suricata-3.0/src/CMakeLists.txt:542 (TARGET_LINK_LIBRARIES)
时间: 2024-04-21 12:26:24 浏览: 32
这个错误是由于同一个目标 "dp" 在 CMakeLists.txt 文件的不同位置使用了不同的 target_link_libraries 形式。在这种情况下,你需要确保在该文件中所有使用 "dp" 的 target_link_libraries 调用都采用相同的语法形式,要么全部使用关键字形式,要么全部使用普通形式。
在你的情况中,可以查看 CMakeLists.txt 文件中第 542 行和第 548 行的 target_link_libraries 调用,并确保它们采用相同的语法形式。如果它们是不同的,则需要进行更改以使其匹配。例如,如果第 542 行使用了关键字形式,则第 548 行也应该使用关键字形式。
相关问题
CMake Error at data-plane/suricata-3.0/libnet/src/CMakeLists.txt:63 (ADD_LIBRARY): No SOURCES given to target: net
这个错误是因为在data-plane/suricata-3.0/libnet/src/CMakeLists.txt文件中的ADD_LIBRARY命令没有给定任何源文件(SOURCES),导致CMake无法构建这个库。解决这个问题的方法是在ADD_LIBRARY命令中添加源文件的路径,例如:
```
ADD_LIBRARY(net
source1.cpp
source2.cpp
)
```
其中source1.cpp和source2.cpp是你的源文件。你可以根据你的实际情况修改源文件的路径和名称。
CMake Error at data-plane/suricata-3.0/src/CMakeLists.txt:686 (TARGET_LINK_LIBRARIES): IMPORTED library can only be used with the INTERFACE keyword of target_link_libraries CMake Error at data-plane/suricata-3.0/src/CMakeLists.txt:687 (target_include_directories): target_include_directories may only set INTERFACE properties on IMPORTED targets
这个错误提示的意思是,在 `data-plane/suricata-3.0/src/CMakeLists.txt` 文件的第 686 行,使用了 `TARGET_LINK_LIBRARIES` 命令指定了一个 `IMPORTED` 库进行链接。然而,`IMPORTED` 库只能和 `INTERFACE` 关键字一起使用,而不能直接和 `TARGET_LINK_LIBRARIES` 命令一起使用。在第 687 行,使用了 `target_include_directories` 命令对一个 `IMPORTED` 目标设置了 `INTERFACE` 属性,然而这也是不正确的。
要解决这个问题,可以将 `TARGET_LINK_LIBRARIES` 命令改为使用 `INTERFACE` 关键字。例如:
```
target_link_libraries(your_target_name INTERFACE imported_library_name)
```
另外,对于 `IMPORTED` 目标,应该使用 `INTERFACE` 属性来设置其包含目录。例如:
```
set_target_properties(imported_library_name PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "/path/to/include/dir")
```
注意,这里需要将 `IMPORTED` 目标的名称替换为你实际使用的目标名称,以及将 `/path/to/include/dir` 替换为实际的包含目录路径。
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)