Compiler Error when compiling .mojo file into binary on Linux Mint

Hi,

How do I fix this error on Linux Mint?

I already have libstdc++6

Thanks.

mojo build tinywm.mojo
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/…/…/…/…/x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::_Sp_make_shared_tag::_S_eq(std::type_info const&)@GLIBCXX_3.4.26' /usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::filesystem::__cxx11::path::parent_path() const@GLIBCXX_3.4.26’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/…/…/…/…/x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)@GLIBCXX_3.4.26' /usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::filesystem::create_directories(std::filesystem::__cxx11::path const&, std::error_code&)@GLIBCXX_3.4.26
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/…/…/…/…/x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::filesystem::__cxx11::path::_List::_Impl_deleter::operator()(std::filesystem::__cxx11::path::_List::_Impl*) const@GLIBCXX_3.4.26' /usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&, std::error_code&)@GLIBCXX_3.4.26
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/…/…/…/…/x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::filesystem::__cxx11::path::operator/=(std::filesystem::__cxx11::path const&)@GLIBCXX_3.4.26' /usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to operator new(unsigned long, std::align_val_t)@CXXABI_1.3.11
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/…/…/…/…/x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::filesystem::__cxx11::path::_List::_List()@GLIBCXX_3.4.26' /usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to operator delete(void*, unsigned long, std::align_val_t)@CXXABI_1.3.11
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/…/…/…/…/x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::condition_variable::wait(std::unique_lock<std::mutex>&)@GLIBCXX_3.4.30' /usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()@GLIBCXX_3.4.26
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/…/…/…/…/x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::filesystem::__cxx11::path::_List::_List(std::filesystem::__cxx11::path::_List const&)@GLIBCXX_3.4.26' /usr/local/lib/gcc/x86_64-pc-linux-gnu/6.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/james/tinywm_mojo/.magic/envs/default/lib/libKGENCompilerRTShared.so: undefined reference to std::__throw_bad_array_new_length()@GLIBCXX_3.4.29
collect2: error: ld returned 1 exit status
mojo: error: failed to link executable

Hey jws, did you set the -o output flag. It looks like you didn’t in this code block you shared eg mojo build -o tinywm.mojo

Doc links here