gpt4 book ai didi

c++ - xcode 包含路径冲突

转载 作者:行者123 更新时间:2023-11-28 08:24:13 24 4
gpt4 key购买 nike

在 MSVS 中,当我#include 时,它在与#include“someheader”包含的 header 不同的文件夹中进行搜索。同样的事情应该在 xcode 中,但它似乎不起作用。因此,我与与 std header (String.h 等)同名的本地 header 发生冲突,并且我不能包含 std header 。我试图更改项目选项“始终搜索用户路径”,但它仍然不起作用。此选项的帮助消息说它将解决我的问题,但是......

If enabled, both #include<header.h>-style and #include"header.h"-style directives willsearch the paths in "User HeaderSearch Paths" before "Header SearchPaths", with the consequence that userheaders (such as your own String.hheader) would have precedence oversystem headers when using #include<header.h>. This is done using the-iquote flag for the paths provided in "User Header Search Paths". Ifdisabled and your compiler fullysupports separate user paths, userheaders will only be accessible with

include "header.h"-style preprocessor directives.

For backwards compatibility reasons,this setting is enabled by default,but disabling it is stronglyrecommended.[ALWAYS_SEARCH_USER_PATHS]

你知道如何解决这个问题吗?我真的不想更改我的头文件名称或从项目设置中删除搜索路径并使用本地文件的相对路径 (../../.../SomeFolder/SomeHeader.h)。

最佳答案

我通过将所有 header 扩展名从 h 更改为 hpp 解决了这个问题......这不是一个真正的解决方案,但我保留了文件名并且我现在解决了这个问题:)

关于c++ - xcode 包含路径冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4619101/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com