静态库在调试配置中构建,但不在发布配置中 [英] static library builds in debug configuration but not in release configuration

查看:50
本文介绍了静态库在调试配置中构建,但不在发布配置中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我为发布而构建时,我收到未找到词法/预处理器问题*.h""错误.

I get a 'Lexical/Preprocessor Issue "*.h" not found' error when I build for release.

但是,如果我将构建配置设置为 Debug,它就可以完美地构建.

But it builds perfect fine if I set the build configuration to Debug.

我在同一个工作区中有这个静态库项目,所以我假设每次我构建我的项目时都会像 CocoaPods 一样构建它.

I have this static library project in the same workspace, so I am assuming it builds every time I build my project just like CocoaPods.

当我查看 build 文件夹时,没有复制 .a 文件.但它用于调试配置.也许它试图在构建静态库之前调用一个标头.

When I look in the build folder, the .a file is not copied over. But it is there for the debug config. Maybe it is trying to call a header before the static library is built.

我已经查看了堆栈溢出的所有内容,我觉得我已经尝试了所有方法.这不是重复的.

I have looked all over stack overflow and I feel like I have tried everything. This is not a duplicate.

我在其他链接器标志中有 -ObjC.

I have -ObjC in other linker flags.

我已经检查了前缀标题

更新:调试和发布的用户标题搜索路径都是$(BUILT_PRODUCTS_DIR)"

Update: The User Header Search Path is "$(BUILT_PRODUCTS_DIR)" both debug and release

感谢您的帮助.

推荐答案

对于您的项目目标构建设置,查找搜索路径->标题搜索路径".在此处比较您的发布和调试设置.

For your project target Build Settings, look for "Search Paths->Header Search Path". Compare your Release and Debug settings here.

还要查看用于发布和调试的库项目的构建位置".

Also look into the "Build Location" for the library project for Release and Debug.

这篇关于静态库在调试配置中构建,但不在发布配置中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆