Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios 编译出错 library not found for -lGSDK #4

Closed
liyangmsn opened this issue Dec 21, 2019 · 7 comments
Closed

ios 编译出错 library not found for -lGSDK #4

liyangmsn opened this issue Dec 21, 2019 · 7 comments
Labels
good first issue Good for newcomers

Comments

@liyangmsn
Copy link

OTHER_LDFLAGS里已经有了-l"GSDK"

但是编译时候提示
library not found for -lGSDK

@thon-ju
Copy link
Owner

thon-ju commented Dec 21, 2019

@liyangmsn 可以如下操作
1、targets->build setting->other linker flags中删掉-IGSDK项及继承项
image
2、确保库引用了,targets->build phases->link binary with libraries中有GSDK.a
image

@liyangmsn
Copy link
Author

@thon-ju
应该还需要把podspec里的s.vendored_libraries = '**/*.a'去掉
这行代码会往other linker flags里添加-IGSDK

@thon-ju
Copy link
Owner

thon-ju commented Dec 24, 2019

@liyangmsn
理论上podspec里的
s.vendored_libraries = '**/*.a'
作用是新工程引用的时候回自动添加GSDK.a,去掉了,新工程需要手动添加GSDK.a库,但是实际上没有起效果。你还有更好方式推荐吗?

@liyangmsn
Copy link
Author

@thon-ju 不好意思 我查了一遍文档还是没有解决
目前所知vendored_libraries是将库引入
但是我看项目里也已经引入了 所以我感觉问题不在这里
我想问下这个GSDK是干嘛用的 没有相关文档

@thon-ju
Copy link
Owner

thon-ju commented Dec 24, 2019

@liyangmsn
这是gprinter的打印指令库,是不是可以吧这个库提交到pod的server,进行引用?我不是特别熟悉ios的机制,如果您比较清楚的话可以试试修改下

@liyangmsn
Copy link
Author

liyangmsn commented Dec 24, 2019

@thon-ju
找到原因了 引用方法没问题
库的文件名要以lib为前缀
https://stackoverflow.com/questions/19189463/cocoapods-podspec-issue

@thon-ju
Copy link
Owner

thon-ju commented Dec 25, 2019

@liyangmsn 经过测试,的确可以。非常感谢,这个问题我也找了好久,终于可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants