Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Compile Issue on macOS 10.13 High Sierra and GCC 7.2.0 #5

Open
gabecfernandez opened this issue Oct 14, 2017 · 3 comments
Open

Comments

@gabecfernandez
Copy link

gabecfernandez commented Oct 14, 2017

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

@rbassett3
Copy link

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

rbassett3 added a commit to rbassett3/PGD that referenced this issue Dec 21, 2018
fixed compilation error: nkahmed#5
@aanastasiou
Copy link

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

@SaraTohidi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants