From owner-freebsd-hackers@freebsd.org Wed Jun 15 11:31:27 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 D00E2A318D8 for ; Wed, 15 Jun 2016 11:31:27 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::22c]) (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 90694179E for ; Wed, 15 Jun 2016 11:31:27 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-qk0-x22c.google.com with SMTP id a186so14939797qkf.0 for ; Wed, 15 Jun 2016 04:31:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=Qq6Ej379AhLXASkbSnbZrLj2NKzPGwxQ3STahDTWPDU=; b=UyJWSrpVwmQgfDZp2jlNbNISZNypU1RfxFP5s+TnMcf6y0yE0KPkSZg/l2lvTbBCRZ iwkLwRYMOrPZ2zoH+AHx2+X/CCcekLfCu/e5BnJPHwh+Ljq/wn5tflUgfvBPyciNNW0d 7G1wdj0bNrIrpxnLS22SMytPQlwGecs4SyzQ4= 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:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Qq6Ej379AhLXASkbSnbZrLj2NKzPGwxQ3STahDTWPDU=; b=gTG6KOImI3h6/Q9S86pnQfnI88vIliwRa9mkkNFQuxW1CNg162SyuVrYOcO6d/kNY3 4hmhM1Zt1ZTMb56RNSqCwxHu4C7uAMqns3Rq4L+onvFnBCH46T5+pVcqeDJBAXQucFz2 znmqLLz70cnoDqIiSdMMhz2e6ZV8p05ZJioSD2e4KqbMZ90PgvfCwGuEOjeQ/6UnGoGI INzzTKvM1efYvoF6VoUtLeCBh6lff6K9bZuPwY+H9BMTLNrsEoXjKlRqioAsohYKvrFi AfE/Va9pH8qJZNqJUT3s9bhLfamTBwckXg9GX7PVUw3MUm12D1TfgFd+MPR3om/yj5qS uf9g== X-Gm-Message-State: ALyK8tLQL9lugNAsAlM9E9kCXTC4T+RrkLrcjbhKpZ8gAtUkzcskSQj2F64mgFluHfbZAA== X-Received: by 10.200.34.19 with SMTP id o19mr24992493qto.97.1465990286042; Wed, 15 Jun 2016 04:31:26 -0700 (PDT) Received: from [192.168.0.18] ([187.60.94.34]) by smtp.googlemail.com with ESMTPSA id k63sm5014426qte.9.2016.06.15.04.31.24 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Jun 2016 04:31:25 -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: freebsd-hackers@freebsd.org References: From: =?UTF-8?B?T3RhY8OtbGlv?= Message-ID: Date: Wed, 15 Jun 2016 08:31:10 -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:31:27 -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;