PGD
PGD copied to clipboard
Fixing Compile Issue on macOS 10.13 High Sierra and GCC 7.2.0
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.
I second this issue. I have Ubuntu 18.04 and GCC 7.3 and can confirm that the above fix works for me.
It is a reasonable error (and subsequent fix) given the definition and use of fexists()
. I came across it too on Linux.
I had the same issue. I fixed it with the same approach "(bool)ifile". I have Ubuntu 18.04 and GCC 7.5.