orosmatthew / hydrogen-cpp

A hobby programming language 🔥
MIT License
392 stars 38 forks source link

Latest commit doesn't compile #7

Closed POGnator closed 1 year ago

POGnator commented 1 year ago

When trying to compile the latest source, I get the following compiler error. I'm using WSL with Arch Linux on Windows 11.

[ 50%] Building CXX object CMakeFiles/hydro.dir/src/main.cpp.o
In file included from /mnt/c/Users/Gabriel/Documents/GitHub/hydrogen-cpp/src/main.cpp:7:
/mnt/c/Users/Gabriel/Documents/GitHub/hydrogen-cpp/src/./generation.hpp: In member function ‘void Generator::gen_term(const NodeTerm*)::TermVisitor::operator()(const NodeTermIdent*) const’:
/mnt/c/Users/Gabriel/Documents/GitHub/hydrogen-cpp/src/./generation.hpp:24:32: error: ‘find_if’ is not a member of ‘std’; did you mean ‘find’?
   24 |                 auto it = std::find_if(gen.m_vars.cbegin(), gen.m_vars.cend(), [&](const Var& var) {
      |                                ^~~~~~~
      |                                find
/mnt/c/Users/Gabriel/Documents/GitHub/hydrogen-cpp/src/./generation.hpp: In member function ‘void Generator::gen_stmt(const NodeStmt*)::StmtVisitor::operator()(const NodeStmtLet*) const’:
/mnt/c/Users/Gabriel/Documents/GitHub/hydrogen-cpp/src/./generation.hpp:130:32: error: ‘find_if’ is not a member of ‘st ’; did you mean ‘find’?
  130 |                 auto it = std::find_if(gen.m_vars.cbegin(), gen.m_vars.cend(), [&](const Var& var) {
      |                                ^~~~~~~
      |                                find
make[2]: *** [CMakeFiles/hydro.dir/build.make:76: CMakeFiles/hydro.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/hydro.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

I haven't tried using older source code so far.

orosmatthew commented 1 year ago

Might be that I need to include the <algorithm> header for certain compilers or versions

orosmatthew commented 1 year ago

Should be fixed with latest commit

POGnator commented 1 year ago

Can confirm, latest commit fixed this. Thank you! Keep up the good work.