Open kkuivenhoven opened 4 years ago
It appears to me that there are dependencies that need to be installed. If you could be so kind as to list them, that'd be great :)
Also, I am on Fedora 29.
Also tried installing on my mac and ran into similar issues.
Ah okay. So I tried checking out different commits (on Fedora 29 - linux) and none of those compiled either. @daniel-shimon @itaysabato
Hi, haven't been here for a while 😅 Could you try compiling on master now according to the new compilation instructions (using cmake)?
Okay! What do I do after I clone it? I tried the following commands (separately):
cmake ..
gcc ..
while in the rpp/ folder. I'm also on a mac.
Like it says in the readme:
mkdir build
cd build
cmake ..
make
Make sure you're on the latest version of the project
Alright! I cloned the link and did the commands as instructed. I did get an error though which I'm not sure what's going on. My computer is also older too. A 2016 mac (currently running macOS Sierra - version 10.12.6) so I'm not sure if that's the problem or not.
Ok so apparently compiling static binaries isn't supported on MacOs!
To fix this we need to avoid setting -static
in the CmakeLists.txt
file when compiling on macos.
https://stackoverflow.com/a/41026154/7339373 seems to be how to check whether we're in macos in cmake.
You're welcome to make a pr!
And you can just delete the -static
line in the cmake file and try compiling again :)
That seemed to work! Thank you! I am assuming the below screen shot is the intended behavior.
I removed the entire folder and started from scratch (cloning repo). I submitted a PR with the changes made to CMakeLists.txt. The PR also shows which warnings pop up - I'm not sure if these warnings are normal to see. Thank you so much for all your help, Daniel.
Okay, so I'm trying to use the interactive console and I'm typing up the example you have and this is what I get:
Trying to install on fedora (linux) and this is the error I received:
`[fac@localhost rpp]$ g++ -std=c++17 -O3 src/.h src/.cpp -o rpp src/Interpreter.cpp: In member function ‘virtual Value Interpreter::evaluateBinary(BinaryExpression)’: src/Interpreter.cpp:61:28: error: cannot convert ‘std::shared_ptr’ to ‘Token’ in assignment
first->token = binary->op;
^~
src/Interpreter.cpp:63:29: error: cannot convert ‘std::shared_ptr’ to ‘Token ’ in assignment
second->token = binary->op;
^~
src/Interpreter.cpp:83:78: error: no matching function for call to ‘Interpreter::attributeError(std::shared_ptr&, std::cxx11::string, const char [15])’
attributeError(binary->op, first->toString(), AddOperator);
^
In file included from src/Interpreter.cpp:6:
src/Interpreter.h:199:10: note: candidate: ‘void Interpreter::attributeError(Token*, std::cxx11::string, std::cxx11::string)’
void attributeError(Token token, string callee, string name);
^’ to ‘Token ’
src/Interpreter.cpp:108:66: error: no matching function for call to ‘Interpreter::createString(std::shared_ptr&, std:: cxx11::string)’
return createString(binary->op, new string(value));
^
In file included from src/Interpreter.cpp:6:
src/Interpreter.h:194:12: note: candidate: ‘Value Interpreter::createString(Token, std::__cxx11::string)’
Value createString(Token token, string name);
^’ to ‘Token ’
src/Interpreter.h:195:19: note: candidate: ‘Value Interpreter::createString(std::__cxx11::string)’
inline Value createString(string name)
^&)’
runtimeError(binary->op);
^
In file included from src/Interpreter.cpp:6:
src/Interpreter.h:197:10: note: candidate: ‘void Interpreter::runtimeError(std::cxx11::string)’
void runtimeError(string message = "unsupported operator");
^’ to ‘std::cxx11::string’ {aka ‘std::cxx11::basic_string’}
src/Interpreter.h:204:17: note: candidate: ‘static void Interpreter::runtimeError(Token*, std:: cxx11::string)’
static void runtimeError(Token token, string message = "unsupported operator");
^’ to ‘Token ’
src/main.cpp: In function ‘int _execute(std::__cxx11::string&&, Interpreter&)’:
src/main.cpp:27:68: error: no matching function for call to ‘Interpreter::execute(std::vector)’
Value value = interpreter.execute(parser.parse());
^
In file included from src/main.cpp:6:
src/Interpreter.h:180:36: note: candidate: ‘template Value Interpreter::execute(std::vector<Statement>)’
template Value execute(vector<Statement> statements);
^’) to type ‘std::vector<Statement >’
Value* value = interpreter.execute(parser.parse());
~~~~~ src/Interpreter.h:199:10: note: no known conversion for argument 1 from ‘std::shared_ptr~~~ src/Interpreter.h:194:12: note: no known conversion for argument 1 from ‘std::shared_ptr~~~ src/Interpreter.h:195:19: note: candidate expects 1 argument, 2 provided src/Interpreter.cpp:116:28: error: no matching function for call to ‘Interpreter::runtimeError(std::shared_ptr~~~ src/Interpreter.h:197:10: note: no known conversion for argument 1 from ‘std::shared_ptr~~~ src/Interpreter.h:204:17: note: no known conversion for argument 1 from ‘std::shared_ptr~~ src/Interpreter.h:180:36: note: template argument deduction/substitution failed: src/main.cpp:27:66: note: cannot convert ‘parser.Parser::parse()’ (type ‘std::vector