xtensor-stack / xtensor

C++ tensors with broadcasting and lazy computing
BSD 3-Clause "New" or "Revised" License
3.33k stars 398 forks source link

xio std::abs(): Call of overloaded is ambiguous #1946

Open PeterMoresco opened 4 years ago

PeterMoresco commented 4 years ago

Hi, I've been playing around with xtensor and I've got an error on the line that prints the content to the screen. I've searched a little and didn't found any report of this, so I'm posting here for u guys to help me. Thanks. I'm currently using Ubuntu 18.04LTS, and compiled the file using g++ (7.4.0).

`#include

include "xtensor/xarray.hpp"

include "xtensor/xio.hpp"

include "xtensor/xview.hpp"

include

using namespace std;

int main() { xt::xarray a = xt::arange(324); // cout << a << endl; cout << "\n"; a.reshape({3, 2, 4});`

errorLogFile.txt

davidbrochart commented 4 years ago

@PeterMoresco this works in the CI: https://travis-ci.org/xtensor-stack/xtensor/jobs/654343139?utm_medium=notification&utm_source=github_status Are you sure the error comes from printing the array?

JohanMabille commented 4 years ago

How do you compile your example? Which flags do you use? Also on which platform are you compiling?

Can you add #include <cstdlib> at the beginning of your file and see if it fixes the problem?