BRCode4Fun / Python-Interpreter

A Python interpreter built from scratch in C++
10 stars 3 forks source link

VS2022 on Windows LINk2019 #1

Open autoprog opened 2 months ago

autoprog commented 2 months ago

hi, how to compiler ypur code on Visual Studio 2022, c++ on Windows.

I testd, couse error file: Scope.hpp Scope(Scope* enclosing = nullptr) : enclosing(enclosing){}

~Scope() { / ignore... for (auto& [key, value] : values) { value->decRefCount(); } / } C2429 language feature 'structured associations' requires compiler flag '/std:c++17', //-------------------------------

force.. Links errors: Error LNK2019

unresolved external symbol, "public: __thiscall Lexer::Lexer(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (??0Lexer @@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z), referenced in the _main PyInterpreter function D:\Dev\cpy\PyInterpreter\ PyInterpreter.obj 1

and others.

call: lexer.scanTokens(); parser(tokens);
parser.parse();

help, thanks, Carlos.

AlexsanderDamaceno commented 1 month ago

Hi Carlos, have not seen before your doubt, in this case it looks that you should set your visual studio C++ compiler version to 17 or above version.