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

did you forget to ‘#include <optional>’? #401

Open
OneMoreProblem opened this issue May 19, 2022 · 2 comments
Open

did you forget to ‘#include <optional>’? #401

OneMoreProblem opened this issue May 19, 2022 · 2 comments

Comments

@OneMoreProblem
Copy link

OneMoreProblem commented May 19, 2022

After make install i get an error:


/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:39:1: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
   38 | #include <cstdlib>
  +++ |+#include <optional>
   39 |
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:370:23: error: expected primary-expression before ‘>’ token
  370 |   std::optional<size_t> skippedLine;
      |                       ^
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:370:25: error: ‘skippedLine’ was not declared in this scope; did you mean ‘skipLine’?
  370 |   std::optional<size_t> skippedLine;
      |                         ^~~~~~~~~~~
      |                         skipLine
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp: In function ‘void convertEdgelist(const string&, const string&, bool)’:
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:533:32: error: ‘optional’ is not a member of ‘std’
  533 |                           std::optional<char>());
      |                                ^~~~~~~~
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:533:32: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
/home/r00662636/Galois/tools/graph-convert/graph-convert.cpp:533:41: error: expected primary-expression before ‘char’
  533 |                           std::optional<char>());
      |                                         ^~~~
make[2]: *** [tools/graph-convert/CMakeFiles/graph-convert.dir/build.make:76: tools/graph-convert/CMakeFiles/graph-convert.dir/graph-convert.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3573: tools/graph-convert/CMakeFiles/graph-convert.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

it can be fixed by adding #include <optional> at the beginning of file

@nicelhc13
Copy link
Contributor

Hi, Thank you for reporting this. I cannot reproduce this error. Could you please give us more information? (e.g. compiler version that you used)

@nicelhc13
Copy link
Contributor

Ok, I checked your versions from your previous issue. Thank you for reporting this. Our current release focused on gcc < 11 and I suspect a compatibility issue. We will support the newest GCC and OS soon. Thank you for reporting this and feel free to make a PR if you want.

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

2 participants