You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
We've seen this in a couple places now (like #1822 (comment)) and it does not seem to be limited to non-Travis builds.
Undefined symbols for architecture x86_64:
"mbgl::Map::fitBounds(std::__1::vector<mbgl::LatLng, std::__1::allocator<mbgl::LatLng> >, mbgl::$_1, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> >)", referenced from:
-[MGLMapView setVisibleCoordinates:count:edgePadding:animated:] in libMapboxGL.a(MGLMapView.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I went back through the routines around mbgl::Map::fitBounds to see if anything looked amiss. I think I have a few things; not sure how relevant they are.
We use INFINITY and std::fmax/std::fmin/std::log2 etc. but don't #import <cmath>.
Use of vec2<> without a type, like so:
vec2<> swPixel = pixelForLatLng(bounds.sw);
This isn't very explicit at the very least, but could it also be introducing some problems?
To clarify what is happening here, the build is finishing fully and appears fine, but folks using it externally sometimes see this link problem when trying to compile. This could be related to the way that we test GL inline vs. as a static library. Though I haven't seen this problem with our own static library (via Swift) usage.
vec2 is declared to be double by default. The remaining static analyzer warnings are covered upstream. Importing cmath is a good idea, plus vector if we aren't already somewhere. Is there anything unusual about how LatLng is defined?
This might be a conflict with -stdlib. Is this replicable if you try linking a sample app against libmbgl with -stdlib=libstdc++ (which is wrong, should be -stdlib=libc++)?
This is an Objective-C app, downloading RC 1 w/o symbols and using the binary install method. Went through the setup instructions, then tried to build and got the fitBounds compile error.
This was related to the declaration of EdgeInsets prior to 3318a3c, which created an anonymous struct that was causing problems with the fitBounds function symbols.
Activity
refs #1859: be sure to bring in <cmath>
incanus commentedon Jul 9, 2015
To clarify what is happening here, the build is finishing fully and appears fine, but folks using it externally sometimes see this link problem when trying to compile. This could be related to the way that we test GL inline vs. as a static library. Though I haven't seen this problem with our own static library (via Swift) usage.
1ec5 commentedon Jul 9, 2015
vec2is declared to bedoubleby default. The remaining static analyzer warnings are covered upstream. Importing cmath is a good idea, plus vector if we aren't already somewhere. Is there anything unusual about how LatLng is defined?springmeyer commentedon Jul 9, 2015
This might be a conflict with
-stdlib. Is this replicable if you try linking a sample app against libmbgl with-stdlib=libstdc++(which is wrong, should be-stdlib=libc++)?incanus commentedon Jul 9, 2015
Going to build a test project to replicate this first, that we can track in VCS and get to the bottom of this.
incanus commentedon Jul 9, 2015
Replicated:
https://github.com/incanus/LinkerTest
This is an Objective-C app, downloading RC 1 w/o symbols and using the binary install method. Went through the setup instructions, then tried to build and got the
fitBoundscompile error.incanus commentedon Jul 9, 2015
Link problem doesn't happen on the the
-symbolsversion (which is why we don't typically see it).refs #1859: use traditional struct declaration
Merge pull request #1865 from mapbox/traditionalize-edge-insets
refs #1859: use traditional struct declaration
incanus commentedon Jul 9, 2015
This was related to the declaration of
EdgeInsetsprior to 3318a3c, which created an anonymousstructthat was causing problems with thefitBoundsfunction symbols.