Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Can't compile with 4.8.3 650 and gpp lib: (2 Items)
   
Can't compile with 4.8.3 650 and gpp lib  
Given 4.8.3 doesn't come with dinkum, hence I'm trying to switch go libstd++.  I've stumbling on  std::valarray. The 
code below compiles fine with 4.4.2 (cpp and gpp)  and with 4.8.3 cpp but with gpp I'm getting errors:

#include <cstdlib>
#include <cmath>
#include <valarray>

int main(int argc, char *argv[]) {

	std::valarray<int> tryme;

	tryme = std::abs(tryme);

	return 0;
}

tryme.cc: In function 'int main(int, char**)':
tryme.cc:10:16: error: no matching function for call to 'abs(std::valarray<int>&)'
  std::abs(tryme);
                ^
tryme.cc:10:16: note: candidates are:
In file included from /opt/qnx650/target/qnx6/usr/include/c++/4.8.3/cstdlib:34:0,
                 from tryme.cc:2:
/opt/qnx650/target/qnx6/usr/include/stdlib.h:115:12: note: int std::abs(int)
 extern int abs(int __j);
            ^
/opt/qnx650/target/qnx6/usr/include/stdlib.h:115:12: note:   no known conversion for argument 1 from 'std::valarray<int>
' to 'int'
In file included from /opt/qnx650/target/qnx6/usr/include/c++/4.8.3/cmath:36:0,
                 from tryme.cc:3:
/opt/qnx650/target/qnx6/usr/include/math.h:624:15: note: double std::abs(double)
 inline double abs(double _Left) // OVERLOADS
               ^
/opt/qnx650/target/qnx6/usr/include/math.h:624:15: note:   no known conversion for argument 1 from 'std::valarray<int>' 
to 'double'
/opt/qnx650/target/qnx6/usr/include/math.h:692:14: note: float std::abs(float)
 inline float abs(float _Left) // OVERLOADS
              ^
/opt/qnx650/target/qnx6/usr/include/math.h:692:14: note:   no known conversion for argument 1 from 'std::valarray<int>' 
to 'float'
/opt/qnx650/target/qnx6/usr/include/math.h:1042:20: note: long double std::abs(long double)
 inline long double abs(long double _Left) // OVERLOADS
                    ^
/opt/qnx650/target/qnx6/usr/include/math.h:1042:20: note:   no known conversion for argument 1 from 'std::valarray<int>'
 to 'long double'
cc: /opt/qnx650/host/linux/x86/usr/lib/gcc/i486-pc-nto-qnx6.5.0/4.8.3/cc1plus error 1

Thanks
Re: Can't compile with 4.8.3 650 and gpp lib  
Hum ssems like the valarray stuff is NOT from 4.8.3, if I overwrite the related files (valarray.*) with the one from 4.8
.3, there are conflig with ymath.h, which probably explain why it's not from 4.8.3 ;-)