fl
unread,Jan 23, 2017, 6:50:01 PM1/23/17You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
Thanks Riccardo and Jorgen answering my previous question.
The smctc library is built OK now. When I compile an example .cpp file with the
lib, it has a new error, i.e. "‘max’ was not declared in this scope".
It is really strange to me. Is the example code
(../../include/sampler.hh) wrong on using function max()?
Or my build command line, which is copied and modified (adding a -I for GSL
header files), is incorrect?
Thanks,
.....................
~/workspace/smctc-1.0/examples/pf$ g++ -I/home/jeff/gsl/include -I ../../include -c pfexample.cc pffuncs.cc
In file included from ../../include/smctc.hh:104:0,
from pfexample.cc:1:
../../include/sampler.hh: In instantiation of ‘double smc::sampler<Space>::IterateEss() [with Space = cv_state]’:
../../include/sampler.hh:308:15: required from ‘void smc::sampler<Space>::Iterate() [with Space = cv_state]’
pfexample.cc:36:23: required from here
../../include/sampler.hh:338:24: error: ‘max’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
dMaxWeight = max(dMaxWeight, pParticles[i].GetLogWeight());
^
In file included from /usr/include/c++/5/bits/char_traits.h:39:0,
from /usr/include/c++/5/ios:40,
from /usr/include/c++/5/ostream:38,
from /usr/include/c++/5/iostream:39,
from ../../include/smctc.hh:99,
from pfexample.cc:1:
/usr/include/c++/5/bits/stl_algobase.h:265:5: note: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ declared here, later in the translation unit
max(const _Tp& __a, const _Tp& __b, _Compare __comp)