From owner-freebsd-hackers@freebsd.org Wed Jun 15 09:54:40 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CD9BA1D729 for ; Wed, 15 Jun 2016 09:54:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED8C21A15 for ; Wed, 15 Jun 2016 09:54:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [172.16.0.93] (AMarseille-651-1-134-216.w2-4.abo.wanadoo.fr [2.4.133.216]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 4C1C37569; Wed, 15 Jun 2016 11:54:30 +0200 (CEST) Subject: Re: /usr/include/c++/v1/map:837:5: error: static_assert failed "Allocator::value_type must be same type as value_type" Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_779A4A73-2E48-4066-B76F-A91D53FA8573"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6b2 (ebbf3ef) From: Dimitry Andric In-Reply-To: Date: Wed, 15 Jun 2016 11:54:17 +0200 Cc: freebsd-hackers@freebsd.org Message-Id: References: To: =?utf-8?Q?Otac=C3=ADlio?= X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2016 09:54:40 -0000 --Apple-Mail=_779A4A73-2E48-4066-B76F-A91D53FA8573 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 15 Jun 2016, at 03:40, Otac=C3=ADlio = wrote: >=20 > Em 14/06/2016 18:14, Dimitry Andric escreveu: >> On 14 Jun 2016, at 06:05, Otac=C3=ADlio = wrote: >>> I'm getting this error when I try compile the ORB-SLAM2 library. = Some one can give me a hint about it? >>>=20 >>>=20 >>> /usr/include/c++/v1/map:837:5: error: static_assert failed = "Allocator::value_type must be same type as value_type" >>> static_assert((is_same::value), >> Typically, this is because the allocator for std::map must use a = const >> key, and libc++ now checks for this with a static assertion. >>=20 >> See for example this fix for www/node: >> = https://svnweb.freebsd.org/ports/head/www/node/files/patch-deps_v8_src_com= piler_instruction.h?view=3Dmarkup&pathrev=3D412412 >>=20 >> -Dimitry >>=20 > I think that this problem is more difficult that the example. Bellow = is the error message: >=20 > In file included from = /usr/ports/graphics/orbslam2/work/ORB_SLAM2-132d92f/src/LoopClosing.cc:21:= > In file included from = /usr/ports/graphics/orbslam2/work/ORB_SLAM2-132d92f/include/LoopClosing.h:= 24: > In file included from = /usr/ports/graphics/orbslam2/work/ORB_SLAM2-132d92f/include/KeyFrame.h:24:= > In file included from = /usr/ports/graphics/orbslam2/work/ORB_SLAM2-132d92f/include/MapPoint.h:25:= > In file included from = /usr/ports/graphics/orbslam2/work/ORB_SLAM2-132d92f/include/Frame.h:27: > In file included from /usr/local/include/DBoW2/BowVector.h:14: > /usr/include/c++/v1/map:837:5: error: static_assert failed = "Allocator::value_type must be same type as value_type" > static_assert((is_same::value), > ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > = /usr/ports/graphics/orbslam2/work/ORB_SLAM2-132d92f/src/LoopClosing.cc:436= :21: note: in instantiation of template class = 'std::__1::map, = Eigen::aligned_allocator > >' requested here > KeyFrameAndPose CorrectedSim3, NonCorrectedSim3; This patch should hopefully work. I do not have the port itself, so I = could not compile-test it. diff --git a/include/LoopClosing.h b/include/LoopClosing.h index b1736fe..5d80d02 100644 --- a/include/LoopClosing.h +++ b/include/LoopClosing.h @@ -47,7 +47,7 @@ public: typedef pair,int> ConsistentGroup; typedef map, - Eigen::aligned_allocator = > > KeyFrameAndPose; + Eigen::aligned_allocator = > > KeyFrameAndPose; public: -Dimitry --Apple-Mail=_779A4A73-2E48-4066-B76F-A91D53FA8573 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAldhJdQACgkQsF6jCi4glqOKLgCfXsAU9ZqrsJsbrjGY4aFwf7BK IhAAoJYQ+9tTLcAEZlJcNqlBG7GROK0g =2v8s -----END PGP SIGNATURE----- --Apple-Mail=_779A4A73-2E48-4066-B76F-A91D53FA8573--