首页 > 其他分享 >'filename.h' file not found with <angled> include, use "quotes" instead. 问

'filename.h' file not found with <angled> include, use "quotes" instead. 问

时间:2023-07-21 16:04:31浏览次数:29  
标签:Paths use headers Search library filename quotes Debug include


http://stackoverflow.com/questions/17465902/use-of-external-c-headers-in-objective-c

下面 有个解释的设置步骤 不过 不正确 好像还是最佳回答吧,正确的设置 为 




In my iOS project I need to use an external library written in C++. The C++ header files are all in one directory.

I've added these C++ headers to my Xcode project, and also specified a header search path (in Build Settings).

The issue is that these C++ headers include each other using < > angle brackets. This results in:

'filename.h' file not found with <angled> include, use "quotes" instead.

The weird thing is that Xcode does not complain about all headers. Also the same header #include'd in one file is fine, while an issue when #include'd in another. I think this is caused by the fact that these headers #include each other.

  1. Why doesn't doesn't the search path work?
  2. Is there a way to resolve this without modifying these header files?

Thanks!




c++  ios  objective-c  xcode  include-path




 



add a comment

share improve this question


edited Jul 4 '13 at 9:07









Jul 4 '13 at 8:50






meaning-matters

5,830 2 21 49




3 Answers



active oldest votes



up vote 12 down vote accepted


#include <bla.h>

is meant for standard library or framework headers, and the search strategy Is different than that used for

#include "bla.h"

See for example

As a workaround, you can set the Xcode build setting "Always Search User Paths" to YES.




 



add a comment

share improve this answer


edited Jul 4 '13 at 9:38









Jul 4 '13 at 9:28






Martin R

210k 17 346 422







up vote 7 down vote


Starting from a "blank" application project:

  1. Create a folder "Libraries" in your application's project - preferable as a sibling to your MyApp.xcodeproj file, but it can be anywhere. Create subfolders for each Configuration (Debug, Release, etc.) and possibly for each architecture (armv7, armv7s, arm64) unless the binary is universal binary archive containing all architectures.
  2. Get the headers of the third party library and the static library binaries (possibly more than one for different platforms, Configurations and architectures) and move them into the "Library" folder into corresponding subfolders (which you may need to create):
    For example, assuming you had a universal binary (armv7, armv7s, arm64) and Debug and Release versions of that library: Now, the folder structure is assumed to be as follows:
$(SRCROOT)/Libraries
    Debug-iphoneos
        include
            ThirdParty
                third_party.hh 
                ...
        libThirdParty.a             
    Release-iphoneos
        include
            ThirdParty
                third_party.hh 
                ...
        libThirdParty.a             
MyApp.xcodeproj
  1. "Library Search Paths" Build Setting:
    may
    Given the example, add the following library search paths for Debug and Release Configuration:
    Library Search Paths: $(SRCROOT)/Libraries/Debug-iphoneosLibrary Search Paths: $(SRCROOT)/Libraries/Release-iphoneos You may have different library search paths for particular Configuration and Target platform pairs. Set different path's in the build setting accordingly.
  2. "Header Search Paths" Build Setting:
    Given the example, add the following header search path to the Debug and the Release Configuration:
    Header Search Paths: $(SRCROOT)/Libraries/Debug-iphoneos/includeHeader Search Paths: $(SRCROOT)/Libraries/Release-iphoneos/include Likewise, you may have different paths for particular Config/Target pairs - although the headers may be the same.

-lc++

  1.  to the Other Linker Flagsbuild setting.
  2. Import the header in your files as follows:
#import <ThirdParty/third_party.hh>




 



add a comment

share improve this answer


edited Apr 17 '14 at 21:28









Jul 4 '13 at 10:05






CouchDeveloper

10.9k 2 17 41





up vote 1 down vote


In XCode after setting the "User Header Search Paths" to point to your library's directory, you also have to make sure that a field called "Always Search User Paths" is set to "Yes"

This solved the problem I was having: with <boost/signals2.hpp> file not found with <angled> include, use "quotes" instead.




标签:Paths,use,headers,Search,library,filename,quotes,Debug,include
From: https://blog.51cto.com/u_16124099/6801689

相关文章

  • OLAP系列之分析型数据库clickhouse单机版部署(一)
    一、概述官网:https://clickhouse.com/docs/zhClickHouse是Yandex于2016年开源的列式存储数据库(DBMS),主要用于在线分析处理查询(OLAP),能够使用SQL查询实时生成分析数据报告.clickhouse优势:与Hadoop、Spark这些巨无霸组件相比,ClickHouse很轻量级,其特点:1.列式存储数据库,数据......
  • __use_no_semihosting 与调用C库函数冲突
    在已经移植freetype代码(使用了大量的C库函数)中,将printf硬件重定向到串口后,#pragmaimport(__use_no_semihosting_swi)与调用C库函数冲突,错误如下:ERROR:L6915E:Libraryreportserror:__use_no_semihosting_swiwasrequested,but_sys_openwasreferenced勾选Options->Target......
  • useradd -r -g mysql mysql
    Linux用户管理命令useradd在Linux系统中,useradd命令用于创建用户账号。useradd命令具有丰富的选项和参数,可以根据不同的需求创建不同类型的用户账号。本文将介绍useradd命令中的常用选项和参数,并以useradd-r-gmysqlmysql为例进行说明。useradd命令的常用选项和参数常用选项......
  • You can’t specify target table ‘aaa′ for update in FROM clause
    Youcan’tspecifytargettable‘aaa′forupdateinFROMclause使用MySQL执行DELETEFROM时,若子查询的FROM子句和更新/删除对象使用同一张表,会出现错误。针对“同一张表”这个限制,撇开效率不谈,多数情况下都可以通过多加一层SELECT别名表来变通解决,如下:DELETEFRO......
  • NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Ma
    问题提示:NVIDIA-SMIhasfailedbecauseitcouldn'tcommunicatewiththeNVIDIAdriver.MakesurethatthelatestNVIDIAdriverisinstalledandrunning.解决:sudoaptinstalldkmssudodkmsinstall-mnvidia-v525.116.03#其中,525.116.03是之前安装nvidia驱......
  • 账号被停用,登陆ChatGPT报错“You do not have an account because it has been delete
    Youdonothaveanaccountbecauseithasbeendeletedordeactivated.Ifyoubelievethiswasanerror,pleasecontactusthroughourhelpcenterathelp.openai.com.说明:您没有帐户,因为该帐户已被删除或停用。如果您认为这是一个错误,请通过help.openai.com的帮助中心......
  • VTK mouse event -- 捕捉鼠标动作并发送信号:vtkCommand
    头文件申明:#pragmaonce#include<QObject>#include<vtkCallbackCommand.h>#include<vtkRenderWindow.h>#include<vtkRenderWindowInteractor.h>#include<vtkRenderer.h>#include<vtkSmartPointer.h>classMyMouseCallback:......
  • QSqlDatabasePrivate::removeDatabase: connection ‘myConnection’ is still in use
    1.解决QSqlDatabasePrivate::removeDatabase:connection‘myConnection’isstillinuse,allquerieswillceasetowork的问题该问题主要是因为没有关闭之前的数据库连接,然后又需要创建新的数据库连接导致。解决方案:必须释放该连接的所有查询,即删除所有与该连接有关的quer......
  • MySQL到ClickHouse数据同步方案
    MySQL同步到ClickHouse的方案可以看下面的说明,选择合适最近的同步方法。1. 对比结果概述整体上,NineData(官网:www.ninedata.cloud )的数据复制功能在功能、性能表现最突出。其次是Bifrost和ClickHouse自带的MaterializeMySQL。NineData在增量DDL的处理、字段映射的准确......
  • Learn about some useful truck diagnostic scanner tools
    Haveyoueverexperiencedthefrustrationofunexpectedbreakdownswithyourtruck?Ormaybeyou’retiredofpayingexpensivediagnosticfeesatyourlocaldealership.Well,worrynomore!Thetruckdiagnosticscannertoolisheretomakeyourlifeeasier......