From owner-freebsd-hackers@freebsd.org Wed Jun 15 01:40:55 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 5FB29B726B8 for ; Wed, 15 Jun 2016 01:40:55 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (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 1AF8B2B5F for ; Wed, 15 Jun 2016 01:40:55 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by mail-qk0-x22f.google.com with SMTP id c73so6668562qkg.2 for ; Tue, 14 Jun 2016 18:40:55 -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=F0Zmso9f0I3fqBlvhfCZYkQF+lKqvvZkq0kyBXTPk8I=; b=ZBC0JBEuV91JFy6z7M7pzP8u4udSXtZ8xzmYxslY30Awm3lgO/XxllcQFyuuY/F2r/ 1ffKmr+W46652r00OYz1Y/4Sfohu0D8iUIVoXsy9ABBUQMx/0W9P1fvMddO/B2NysE28 xZr7ueyO9vZ6YR+SAl2/p/+KH3XqTWJD20fPM= 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=F0Zmso9f0I3fqBlvhfCZYkQF+lKqvvZkq0kyBXTPk8I=; b=bQAtCdCtmypqymrWsOb9+6KTPWM7CaF6w9/t13Q/77n+A7xZKFJfMAyyDOGcy/h2Bv uaBw7PTZ+ZBpOdxZ9Xdyg5kOu1wb/UehTfVfwJssAEt/Qmc76BSv76e2MsbwvHP14jG4 QT+NUU4EOebjmRcWQsPtNxB/0/tOrWToitNLkzNfeQYjl8PjvGq54eqkAXwz+hFcV0zm +tMAFyN7Dawx0XqHvQbZW2gfnMYVdK0Qv3wh080OFZv1MMSPlmtoeMXga0pLzhUXFSL4 P6SYSyOnvuM5nN7bL90SpP945gf5xdFGXgV4UELnGuKakXh05jZGnhNpGqtgSvNRYtCC R4/g== X-Gm-Message-State: ALyK8tI9z9+Oj8Ew/X1tdi+/BGm+5YjtygKNR+2TRTmvEcBLUP+ctgNInZxYoLBHDcdT+g== X-Received: by 10.55.24.20 with SMTP id j20mr22638902qkh.168.1465954854180; Tue, 14 Jun 2016 18:40:54 -0700 (PDT) Received: from [192.168.0.18] ([187.60.94.34]) by smtp.googlemail.com with ESMTPSA id 131sm8952028qkf.17.2016.06.14.18.40.52 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Jun 2016 18:40:53 -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: Date: Tue, 14 Jun 2016 22:40:39 -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 01:40:55 -0000 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; ^ /usr/ports/graphics/orbslam2/work/ORB_SLAM2-132d92f/src/LoopClosing.cc:466:29: error: no viable overloaded operator[] for type 'KeyFrameAndPose' (aka 'map, Eigen::aligned_allocator > >') NonCorrectedSim3[pKFi]=g2oSiw; ~~~~~~~~~~~~~~~~^~~~~ /usr/ports/graphics/orbslam2/work/ORB_SLAM2-132d92f/src/LoopClosing.cc:470:39: error: use of undeclared identifier 'mit'; did you mean 'min'? for(KeyFrameAndPose::iterator mit=CorrectedSim3.begin(), mend=CorrectedSim3.end(); mit!=mend; mit++) ^~~ min /usr/include/c++/v1/algorithm:2562:1: note: 'min' declared here min(const _Tp& __a, const _Tp& __b, _Compare __comp)