PGD icon indicating copy to clipboard operation
PGD copied to clipboard

Fixing Compile Issue on macOS 10.13 High Sierra and GCC 7.2.0

Open gabecfernandez opened this issue 7 years ago • 3 comments

When compiling using gcc 7.2.0 on macOS 10.13 High Sierra, I encountered the following error:

graphlet_utils.cpp: In function 'bool fexists(const char*)':
graphlet_utils.cpp:42:12: error: cannot convert 'std::ifstream {aka std::basic_ifstream<char>}' to 'bool' in return
     return ifile;
            ^~~~~
make: *** [pgd] Error 1

I changed 'return ifile;' to be 'return (bool)ifile;' and was able to compile successfully.

Reference: https://stackoverflow.com/questions/38659115/make-fails-with-error-cannot-convert-stdistream-aka-stdbasic-istreamchar

gabecfernandez avatar Oct 14 '17 03:10 gabecfernandez

I second this issue. I have Ubuntu 18.04 and GCC 7.3 and can confirm that the above fix works for me.

rbassett3 avatar Dec 21 '18 22:12 rbassett3

It is a reasonable error (and subsequent fix) given the definition and use of fexists(). I came across it too on Linux.

aanastasiou avatar May 18 '20 14:05 aanastasiou

I had the same issue. I fixed it with the same approach "(bool)ifile". I have Ubuntu 18.04 and GCC 7.5.

SaraTohidi avatar May 28 '20 19:05 SaraTohidi