【问题标题】:Apple Mach-O Linker Error with Google Map SDK for iOS适用于 iOS 的 Google Map SDK 的 Apple Mach-O 链接器错误
【发布时间】:2026-02-09 02:00:01
【问题描述】:

我已经设置了 Google 文档中提到的所有框架。

并将架构设置为 armv7 并删除 armv7s。

当我构建应用程序时,出现下面提到的 11 个 Mach-O 错误。

有人知道如何解决这个问题吗?

架构 armv7 的未定义符号: “std::__1::basic_string, std::__1::allocator >::push_back(char)”,引用自: +[GMSPath polylineEncodedUnsigned:] 在 GoogleMaps(GMSPath.o) “std::__1::basic_string, std::__1::allocator >::reserve(unsigned long)”,引用自: gmscore::model::CollidableSet2D::StringValue() const in GoogleMaps(CollidableSet2D.o) “std::_1::_vector_base_common::__throw_length_error() const”,引用自: 谷歌地图中的 std::_1::vector >::allocate(unsigned long) (GMSTriangleList.o) void std::_1::vector >::__push_back_slow_path(gmscore::model::ModelTriangle const&&&) 在 GoogleMaps(GMSTriangleList.o) 谷歌地图中的 std::_1::vector >::allocate(unsigned long)(GMSTriangleList2D.o) void std::_1::vector >::__push_back_slow_path(gmscore::model::ModelTriangle2D const&&&) 在 GoogleMaps(GMSTriangleList2D.o) void std::_1::vector >::_push_back_slow_path(gmscore::vector::MutableStateTracker*&&) 在 GoogleMaps(GMSTilesEntityProvider.o) void std::_1::vector, std::__1::allocator > >::_push_back_slow_path >(gmscore::base::refffed_ptr&&) 在 GoogleMaps(GMSTilesEntityProvider.o) void std::_1::vector >::_push_back_slow_path(gmscore::model::Frustum2D const&&&) 在 GoogleMaps(GMSTilesEntityProvider.o) ... “std::__1::basic_string, std::__1::allocator >::basic_string(std::__1::basic_string, std::__1::allocator > const&)”,引用自: -[GMSStreetViewScene fallbackNavigationAtYaw:nextPanoOffset:] 在 GoogleMaps(GMSStreetViewScene.o) gmscore::vector::LabelSource::LabelSource(std::__1::basic_string, std::__1::allocator > const&, bool, bool, bool, GMSTileType*) 在 GoogleMaps(LabelSource.o) - [GMSStreetViewView didTapPanorama:] 在谷歌地图(GMSStreetViewView.o) - [GMSGLIndoorVectorTileProvider labelSourceWithLevelID:] 在 GoogleMaps(GMSGLIndoorVectorTileProvider.o) gmscore::streetview::StreetViewLink::StreetViewLink(float, std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&) 在谷歌地图(Overlay.o) GoogleMaps(Overlay.o) 中的 gmscore::streetview::Overlay::AddLink(gmscore::streetview::StreetViewLink const&) GoogleMaps(Overlay.o) 中的 gmscore::streetview::Overlay::OnScreenLink::OnScreenLink(gmscore::streetview::Overlay::OnScreenLink const&) ... “std::__1::basic_string, std::__1::allocator >::append(char const*)”,引用自: 谷歌地图中的 gmscore::model::ModelTriangle::StringValue() const (GMSTriangleList.o) 谷歌地图中的 std::__1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::_1::vector > const&)(GMSTriangleList.o) std::_1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::_1::vector > const&) 在 GoogleMaps(GMSTriangleList2D. o) - [GMSVectorMapResourceCache loadPolylineTextures:] 在 GoogleMaps(GMSVectorMapResourceCache.o) std::_1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::_1::vector > const&) 在 GoogleMaps(GMSPolyline2D. o) gmscore::model::Triangle2D::StringValue() const in GoogleMaps(Triangle2D.o) gmscore::model::CollidableSet2D::StringValue() const in GoogleMaps(CollidableSet2D.o) ... “std::_1::__vector_base_common::__throw_out_of_range() const”,引用自: - [GMSTriangleList triangleAtIndex:] 在 GoogleMaps(GMSTriangleList.o) +[GMSTriangleList unpacked3DWithInput:tileCoords:] 在 GoogleMaps(GMSTriangleList.o) -[GMSTriangleList2D triangleAtIndex:] 在 GoogleMaps(GMSTriangleList2D.o) +[GMSTriangleList2D unpacked2DWithInput:tileCoords:] 在 GoogleMaps(GMSTriangleList2D.o) +[GMSPolyline2D polylineWithPoint:point:] 在 GoogleMaps(GMSPolyline2D.o) +[GMSPolyline2D polylineWithRectangle2D:] 在 GoogleMaps(GMSPolyline2D.o) +[GMSPolyline2D unpacked2DWithInput:tileCoords:] 在 GoogleMaps(GMSPolyline2D.o) ... “std::__1::basic_string, std::__1::allocator >::operator=(std::__1::basic_string, std::__1::allocator > const&)”,引用自: gmscore::streetview::Overlay::GetLinkForYaw(float, gmscore::streetview::StreetViewLink*) const in GoogleMaps(Overlay.o) gmscore::streetview::Overlay::GetLinkForTap(gmscore::math::Vector2f const&, gmscore::math::Vector2f const&, gmscore::math::Matrix4f const&, float, gmscore::streetview::StreetViewLink*) const在谷歌地图(Overlay.o) std::__1::enable_if<__is_forward_iterator std::__1::allocator>*>::value, void>::type std::_1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > >::assign, std::__1::allocator >*>(std::_1::basic_string, std::__1: :allocator >*, std::__1::basic_string, std::__1::allocator >*) 在 GoogleMaps(LabelingBehavior.o) gmscore::renderer::Resource::set_name(std::__1::basic_string, std::__1::allocator > const&) 在 GoogleMaps(GeometryUtil.o) gmscore::renderer::TextureState::set_name(std::__1::basic_string, std::__1::allocator > const&) 在 GoogleMaps(TextureState.o) gmscore::vector::text::GLText::set_text(std::__1::basic_string, std::__1::allocator > const&) 在 GoogleMaps(TextOverlay.o) gmscore::renderer::ShaderProgram::SetShaderSources(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&) 在 GoogleMaps(着色器程序.o) ... “std::__1::basic_string, std::__1::allocator >::__init(char const*, unsigned long)”,引用自: 谷歌地图中的 gmscore::model::ModelTriangle::StringValue() const (GMSTriangleList.o) 谷歌地图中的 std::__1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::_1::vector > const&)(GMSTriangleList.o) std::_1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::_1::vector > const&) 在 GoogleMaps(GMSTriangleList2D. o) - [GMSStreetViewScene setPanoramaData:] 在 GoogleMaps(GMSStreetViewScene.o) - [GMSStreetViewScene recreateOverlay] 在 GoogleMaps(GMSStreetViewScene.o) - [GMSVectorMapResourceCache initWithEntityRenderingViewContext:uiScale:] 在 GoogleMaps(GMSVectorMapResourceCache.o) - [GMSVectorMapResourceCache createQuadVertexData] 在 GoogleMaps(GMSVectorMapResourceCache.o) ... “std::_1::basic_string, std::__1::allocator >::append(char const*, unsigned long)”,引用自: 谷歌地图中的 gmscore::model::ModelTriangle::StringValue() const (GMSTriangleList.o) 谷歌地图中的 std::__1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::_1::vector > const&)(GMSTriangleList.o) std::_1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::_1::vector > const&) 在 GoogleMaps(GMSTriangleList2D. o) std::_1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::_1::vector > const&) 在 GoogleMaps(GMSPolyline2D. o) GoogleMaps 中的 gmscore::vector::ModelRendererValue::ModelRendererValue(std::_1::basic_string, std::__1::allocator > const&, int, bool const&) (GMSColoredOverlayEntityProvider.o) GoogleMaps(Overlay.o) 中的 gmscore::vector::ModelRendererValue::ModelRendererValue(std::__1::basic_string, std::__1::allocator > const&, int) gmscore::model::Triangle2D::StringValue() const in GoogleMaps(Triangle2D.o) ... “std::__1::basic_string, std::__1::allocator >::~basic_string()”,引用自: - [GMSTriangleList 描述] 在 GoogleMaps(GMSTriangleList.o) 谷歌地图中的 gmscore::model::ModelTriangle::StringValue() const (GMSTriangleList.o) 谷歌地图中的 std::__1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::_1::vector > const&)(GMSTriangleList.o) -GoogleMaps中的[GMSTriangleList2D描述](GMSTriangleList2D.o) 谷歌地图中的 std::_1::basic_string, std::__1::allocator > gmscore::utils::gmsutils::CommaDelimitedStringValues(std::__1::vector > const&)(GMSTriangleList2D.o) - [GMSStreetViewScene setPanoramaData:] 在 GoogleMaps(GMSStreetViewScene.o) - [GMSStreetViewScene recreateOverlay] 在 GoogleMaps(GMSStreetViewScene.o) ... ld:未找到架构 armv7 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

【问题讨论】:

标签: ios google-maps


【解决方案1】:

这意味着您没有链接 C++ 标准库。通过转到 Project->Build Setting 并添加框架 libc++.dylib 来做到这一点。

【讨论】:

最近更新 更多