8000 Fixing Compile Issue on macOS 10.13 High Sierra and GCC 7.2.0 · Issue #5 · nkahmed/PGD · GitHub
[go: up one dir, main page]

Skip to content

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

Open

Description

@gabecfernandez

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

Activity

  1. rbassett3 commented on Dec 21, 2018

    @rbassett3

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

  2. added a commit that references this issue on Dec 21, 2018
  3. aanastasiou commented on May 18, 2020

    @aanastasiou

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

  4. SaraTohidi commented on May 28, 2020

    @SaraTohidi

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0