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

Linker Error message when compiling with xCode 8 when using Carthage #227

Closed
MichalAlgor opened this issue Sep 15, 2016 · 22 comments · Fixed by #238 or badoo/Chatto#232
Closed

Linker Error message when compiling with xCode 8 when using Carthage #227

MichalAlgor opened this issue Sep 15, 2016 · 22 comments · Fixed by #238 or badoo/Chatto#232

Comments

@MichalAlgor
Copy link

MichalAlgor commented Sep 15, 2016

Hi
I'm using version form Swift3 branch and when I try to compile with xCode 8 I got:

"direct field offset for XLPagerTabStrip.ButtonBarPagerTabStripViewController.(buttonBarView.storage in _0CF27031E34C35EB5EAF50A7E0F72A93) : XLPagerTabStrip.ButtonBarView!?", referenced from: XLPagerTabStrip.ButtonBarPagerTabStripViewController.buttonBarView.setter : XLPagerTabStrip.ButtonBarView! in PGMediaContainerViewController.o

How can I get rid of this error so the compilation will finish with success ?

@chris-wickens
Copy link

I got this error when using Carthage. The only way I found around this for now is to drag the XLPagerTabStrip project into my workspace and link XLPagerTabStrip.framework to my project.

@MichalAlgor
Copy link
Author

Yes I got this using Carthage as well.

@MichalAlgor MichalAlgor changed the title Linker Error message when compiling with xCode 8 Linker Error message when compiling with xCode 8 when using Carthage Sep 16, 2016
@weyert
Copy link

weyert commented Sep 20, 2016

I am experiencing this issue as well. @Rekubot suggestion works but the best approach. Appears to be related to missing symbols for a specific architecture. As I am trying to compile my application using fastlane I am getting the following errors:

❌  Undefined symbols for architecture arm64
> Symbol: direct field offset for XLPagerTabStrip.ButtonBarPagerTabStripViewController.(buttonBarView.storage in _0CF27031E34C35EB5EAF50A7E0F72A93) : XLPagerTabStrip.ButtonBarView!?
> Referenced from: XLPagerTabStrip.ButtonBarPagerTabStripViewController.buttonBarView.setter : XLPagerTabStrip.ButtonBarView! in DiscoverGridController.o
❌  ld: symbol(s) not found for architecture arm64
❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

@rzulkoski
Copy link

I am having this issue as well. Any ideas?

@virtualrapha
Copy link
Contributor

1

@virtualrapha
Copy link
Contributor

@mtnbarreto @mats-claassen Any ideas on this one?

@mats-claassen
Copy link
Member

I tried installing XLPagerTabStrip with Carthage and it did build successfully. Are you using the latest version of Carthage (0.18)?

@MichalAlgor
Copy link
Author

Yes, I've updated the Carthage to see if it will fix the issue, rebuild the packages but still got this when compiling the project.

@virtualrapha
Copy link
Contributor

virtualrapha commented Sep 27, 2016

@mats-claassen Thank you for your suggestion. Indeed, I had an old version of Carthage installed. However, I still run into the issue even after updating to Carthage 0.18. I have a mixed Swift/ObjC-Project, maybe that's an issue...

bildschirmfoto 2016-09-27 um 15 08 46

@mats-claassen
Copy link
Member

mats-claassen commented Sep 27, 2016

I came across this issue now, when actually using a PagerTabStripController. I fixed it in fix/containerView branch but I am not sure my solution does not break other things. I would suggest you try using that branch.

I had seen this issue in another framework where "there were no symbols for a lazy variable". I suspect it might be a Swift error but I did not find a related radar...

@virtualrapha
Copy link
Contributor

@mats-claassen Thank you so much, I will try it out as soon as I can. I looked at your commit and I don't believe it would break something. Is there any chance that this will get merged and packaged into a 6.0.1 release?

@MichalAlgor
Copy link
Author

MichalAlgor commented Sep 27, 2016

@mats-claassen I still have my errors:
zrzut ekranu 2016-09-27 o 16 01 12

@virtualrapha
Copy link
Contributor

@mats-claassen My guess is, that this fix has to be implemented for buttonBarView and buttonBarItemSpec as well, since @MichalAlgor doesn't seem to get this error for your fixed containerView anymore.

@mats-claassen
Copy link
Member

Does this mean we cannot use lazy variables anymore?

@weyert
Copy link

weyert commented Sep 27, 2016

Great guys, appreciated you are taking the time to look into this.

@weyert
Copy link

weyert commented Sep 27, 2016

The strange thing I that when you add to our own project it all happily compiles. Only when it's an external framework it fails to work.

@mats-claassen
Copy link
Member

Exactly. The examples project works for example. So there should really be nothing wrong with the code

@virtualrapha
Copy link
Contributor

This issue is so weird 😔 Maybe, it's a Carthage thing. It currently stops me from using Swift 3 in my project which is so sad.

@mtnbarreto
Copy link
Member

let me look into it.

@mtnbarreto
Copy link
Member

@MichalAlgor @Rekubot @weyert @rzulkoski @raphaklr
I've updated the code to remove lazy properties..
Could you check if this branch works with carthage now... https://github.com/xmartlabs/XLPagerTabStrip/tree/fix/carthageLinkingError?

@virtualrapha
Copy link
Contributor

@mtnbarreto I tested it and I can confirm that it works now! Thank you so much for your time. Any chance that this gets merged soon?

@weyert
Copy link

weyert commented Sep 29, 2016

@mtnbarreto Yes, working for me too. Great thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants