2

I have a problem on Solaris using the Sun Studio compiler. It seems related to libCstd.

Consider the following code :

#include <list>
static bool f(double fFreq1, double fFreq2) { return false; }
int main()
{
    std::list< double > l;
    l.unique(f);
}

The error message I get is :

"uniq.cpp", line 6: Error: Could not find a match for std::list<double>::unique(bool(double,double)) needed in main().

But when I use references instead of values, it compiles just fine :

#include <list>
static bool f(const double& fFreq1, const double& fFreq2) { return false; }
int main()
{
    std::list< double > l;
    l.unique(f);
}

Compilation is ok for both using g++. Does anyone know what is going on ? Thanks !

grantc
  • 1,703
  • 12
  • 13
ghi
  • 21
  • 1

1 Answers1

0

Try building with -library=stlport4 as the standard C++ library is not standards compliant. See http://www.oracle.com/technetwork/server-storage/solarisstudio/documentation/cplusplus-faq-355066.html#LibComp5 for more info.

grantc
  • 1,703
  • 12
  • 13