From owner-freebsd-hackers@freebsd.org Wed Jun 15 11:32:05 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 C42ABA31A43 for ; Wed, 15 Jun 2016 11:32:05 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com [IPv6:2607:f8b0:400d:c04::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7933D1A3F for ; Wed, 15 Jun 2016 11:32:05 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-qg0-x232.google.com with SMTP id v48so9721822qgd.2 for ; Wed, 15 Jun 2016 04:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=/Lsio3bCRmQY21aDDlZXX8vX4aC0Lq9AIBHv6Qx97PI=; b=XzruqhIMAwCpsScZcdDxKEHrEsXSlrWDyVUgcLk77fX3ZIJDk6I8OVJbx+vA3OVGu8 PJYpWPdcBxavXx7JoIKYWTiBznmCVRRYilShEKyNTz8VxeXi/W4+hV7OlNxdbkjBmIVM Q2HHvfsc04xcHSkJ4X7TeFtXwYHwhAFseeHQ8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=/Lsio3bCRmQY21aDDlZXX8vX4aC0Lq9AIBHv6Qx97PI=; b=REboNwvCMrPz6IkZU85cCY6UOOsqLwrTsSk/D+IT4m7kOJ4XVJSxv4uaNCs3Vd8wu9 IwaAQ4wdQaPuFmfgdIzLHZzibVxK9NuJibf3PnOEqn+aZeGHunhEW7Nk0wfO6G9AghnT iAVc6BQE1Ho1IhShP83ymalw8dCEpKr+Xag6cubalJ6B9GEwiWAKDL+2cYb/g/bPFnlp 8nTn9t1ZQNhzGwJiRrvhEYTwyVj+MCK6vDHz94jtV9gOSUOvhjQd/68xawRaoNBj6Aur j5VrviU4C4YfIAumYVsZLhV3j7erQ4ELXc+/VeDp9ZRW67lk3R38EwL9EioX9Rny7U3D v2/w== X-Gm-Message-State: ALyK8tKoUUBgEVKfENYbIhjUMJQlx4i6kplCkhDD58k+oxtpQN3f9haFzZjGzQBsYyZ14A== X-Received: by 10.140.157.4 with SMTP id d4mr24909726qhd.77.1465990324562; Wed, 15 Jun 2016 04:32:04 -0700 (PDT) Received: from [192.168.0.18] ([187.60.94.34]) by smtp.googlemail.com with ESMTPSA id 8sm9294196qhi.35.2016.06.15.04.32.02 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2016 04:32:03 -0700 (PDT) Subject: Re: /usr/include/c++/v1/map:837:5: error: static_assert failed "Allocator::value_type must be same type as value_type" To: Dimitry Andric References: Cc: freebsd-hackers@freebsd.org From: =?UTF-8?B?T3RhY8OtbGlv?= Message-ID: <04b30242-60d2-340f-e944-a8fabc83fdcf@bsd.com.br> Date: Wed, 15 Jun 2016 08:31:49 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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 11:32:05 -0000 Em 15/06/2016 06:54, Dimitry Andric escreveu: > On 15 Jun 2016, at 03:40, Otacílio wrote: >> Em 14/06/2016 18:14, Dimitry Andric escreveu: >>> On 14 Jun 2016, at 06:05, Otacílio wrote: >>>> I'm getting this error when I try compile the ORB-SLAM2 library. Some one can give me a hint about it? >>>> >>>> >>>> /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. >>> >>> See for example this fix for www/node: >>> https://svnweb.freebsd.org/ports/head/www/node/files/patch-deps_v8_src_compiler_instruction.h?view=markup&pathrev=412412 >>> >>> -Dimitry >>> >> I think that this problem is more difficult that the example. Bellow is the error message: >> >> 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 > Dear I have applied your patch, but the bug stay there :( 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 is the source code of LoopClosing.h after patch: #ifndef LOOPCLOSING_H #define LOOPCLOSING_H #include "KeyFrame.h" #include "LocalMapping.h" #include "Map.h" #include "ORBVocabulary.h" #include "Tracking.h" #include "KeyFrameDatabase.h" #include #include #include namespace ORB_SLAM2 { class Tracking; class LocalMapping; class KeyFrameDatabase; class LoopClosing { public: typedef pair,int> ConsistentGroup; typedef map, Eigen::aligned_allocator > > KeyFrameAndPose;