melonDS icon indicating copy to clipboard operation
melonDS copied to clipboard

Tried compiling melonDS recently, 64 bit linux,

Open FrostKnight opened this issue 2 years ago • 11 comments

I have tried your instructions for linux on the main page:

/usr/bin/ld: /tmp/ccnyqbTG.ltrans0.ltrans.o: in function std::filesystem::__cxx11::path::path<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::filesystem::__cxx11::path>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::filesystem::__cxx11::path::format) [clone .constprop.585]': <artificial>:(.text+0xd992): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()' /usr/bin/ld: /tmp/ccnyqbTG.ltrans20.ltrans.o: in function FATStorage::CleanupDirectory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)': <artificial>:(.text+0x46ce): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()' /usr/bin/ld: :(.text+0x46d6): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: <artificial>:(.text+0x4985): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()' /usr/bin/ld: :(.text+0x498d): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: /tmp/ccnyqbTG.ltrans20.ltrans.o: in function FATStorage::DeleteHostDirectory(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, int)': :(.text+0x51f9): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()' /usr/bin/ld: <artificial>:(.text+0x5233): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: :(.text+0x52f7): undefined reference to std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)' /usr/bin/ld: <artificial>:(.text+0x5383): undefined reference to std::filesystem::__cxx11::directory_iterator::operator*() const' /usr/bin/ld: :(.text+0x54be): undefined reference to std::filesystem::__cxx11::directory_iterator::operator++()' /usr/bin/ld: <artificial>:(.text+0x569d): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()' /usr/bin/ld: :(.text+0x56f1): undefined reference to std::filesystem::permissions(std::filesystem::__cxx11::path const&, std::filesystem::perms, std::filesystem::perm_options, std::error_code&)' /usr/bin/ld: <artificial>:(.text+0x56f9): undefined reference to std::filesystem::remove(std::filesystem::__cxx11::path const&)' /usr/bin/ld: :(.text+0x59a8): undefined reference to std::filesystem::permissions(std::filesystem::__cxx11::path const&, std::filesystem::perms, std::filesystem::perm_options, std::error_code&)' /usr/bin/ld: <artificial>:(.text+0x59b0): undefined reference to std::filesystem::remove(std::filesystem::__cxx11::path const&)' /usr/bin/ld: :(.text+0x5af4): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: /tmp/ccnyqbTG.ltrans20.ltrans.o: in function FATStorage::ExportDirectory(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, int)': :(.text+0x60c5): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()' /usr/bin/ld: <artificial>:(.text+0x61a9): undefined reference to std::filesystem::permissions(std::filesystem::__cxx11::path const&, std::filesystem::perms, std::filesystem::perm_options, std::error_code&)' /usr/bin/ld: :(.text+0x64a4): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: <artificial>:(.text+0x66d0): undefined reference to std::filesystem::last_write_time(std::filesystem::__cxx11::path const&)' /usr/bin/ld: :(.text+0x6a83): undefined reference to std::filesystem::create_directory(std::filesystem::__cxx11::path const&, std::error_code&)' /usr/bin/ld: <artificial>:(.text+0x6c9b): undefined reference to std::filesystem::permissions(std::filesystem::__cxx11::path const&, std::filesystem::perms, std::filesystem::perm_options, std::error_code&)' /usr/bin/ld: /tmp/ccnyqbTG.ltrans20.ltrans.o: in function FATStorage::Save()': <artificial>:(.text+0x71bd): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()' /usr/bin/ld: :(.text+0x7216): undefined reference to std::filesystem::permissions(std::filesystem::__cxx11::path const&, std::filesystem::perms, std::filesystem::perm_options, std::error_code&)' /usr/bin/ld: <artificial>:(.text+0x721e): undefined reference to std::filesystem::remove(std::filesystem::__cxx11::path const&)' /usr/bin/ld: /tmp/ccnyqbTG.ltrans20.ltrans.o: in function FATStorage::Load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': <artificial>:(.text+0x8999): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()' /usr/bin/ld: :(.text+0x89a6): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: <artificial>:(.text+0x9306): undefined reference to std::filesystem::__cxx11::path::_M_split_cmpts()' /usr/bin/ld: :(.text+0x9324): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::recursive_directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)' /usr/bin/ld: <artificial>:(.text+0x9426): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: :(.text+0x948e): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: <artificial>:(.text+0x94de): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: :(.text+0x94e8): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: <artificial>:(.text+0x94f2): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: :(.text+0x9856): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::operator*() const' /usr/bin/ld: <artificial>:(.text+0x9913): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: :(.text+0x99bc): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::operator++()' /usr/bin/ld: <artificial>:(.text+0x99d4): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: :(.text+0x99f0): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: <artificial>:(.text+0x9a00): undefined reference to std::filesystem::file_size(std::filesystem::__cxx11::path const&)' /usr/bin/ld: :(.text+0x9a0b): undefined reference to std::filesystem::last_write_time(std::filesystem::__cxx11::path const&)' /usr/bin/ld: <artificial>:(.text+0x9f9a): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::recursive_directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)' /usr/bin/ld: :(.text+0xa04e): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: <artificial>:(.text+0xa0be): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: :(.text+0xa0e7): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: <artificial>:(.text+0xa0ef): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: :(.text+0xa0f9): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: <artificial>:(.text+0xa164): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::operator*() const' /usr/bin/ld: :(.text+0xa186): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::operator++()' /usr/bin/ld: <artificial>:(.text+0xa194): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: :(.text+0xa1ae): undefined reference to std::filesystem::status(std::filesystem::__cxx11::path const&)' /usr/bin/ld: <artificial>:(.text+0xa1ba): undefined reference to std::filesystem::file_size(std::filesystem::__cxx11::path const&)' /usr/bin/ld: /tmp/ccnyqbTG.ltrans20.ltrans.o: in function FATStorage::Load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) [clone .cold.10]': <artificial>:(.text.unlikely+0xa80): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: :(.text.unlikely+0xa8a): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: <artificial>:(.text.unlikely+0xa94): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: :(.text.unlikely+0xb67): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: <artificial>:(.text.unlikely+0xb6f): undefined reference to std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' /usr/bin/ld: /tmp/ccnyqbTG.ltrans20.ltrans.o::(.text.unlikely+0xb79): more undefined references to `std::filesystem::__cxx11::recursive_directory_iterator::~recursive_directory_iterator()' follow collect2: error: ld returned 1 exit status make[2]: *** [src/frontend/qt_sdl/CMakeFiles/melonDS.dir/build.make:536: melonDS] Error 1 make[2]: Leaving directory '/home/localuser/melonDS/melonDS' make[1]: *** [CMakeFiles/Makefile2:259: src/frontend/qt_sdl/CMakeFiles/melonDS.dir/all] Error 2 make[1]: Leaving directory '/home/localuser/melonDS/melonDS'

Keeps ending this way no matter how closely I follow this:

https://github.com/Arisotura/melonDS#linux

Curious, if there is a gcc problem, or if its a jit problem, or what, but yeah, something is weird here...

I wonder if I need to compile without jit, or if I am screwed, period...

:/

FrostKnight avatar May 09 '22 19:05 FrostKnight

What are you trying to build this on? distro, compiler, etc.?

nadiaholmquist avatar May 09 '22 20:05 nadiaholmquist

Hyperbola, gcc 8.4.0-5

I don't know if this is a problem or not, etc.

I wanted to compile this from source due to it having a fallback option if I don't have those ds binaries, etc...

Anywho, here is the website:

https://www.hyperbola.info/packages/

hope this helps?

FrostKnight avatar May 10 '22 04:05 FrostKnight

The issue is due to melon using std::filesystem, a c++17 feature. GCC's c++17 support was "experimental" until v9. v8 should be should be able to use std::filesystem though as long as it linked with -lstdc++fs.

CasualPokePlayer avatar May 10 '22 04:05 CasualPokePlayer

I wanted to compile this from source due to it having a fallback option if I don't have those ds binaries

You don't need to build for that. The BIOS and firmware replacements are a part of the latest stable release.

poudink avatar May 10 '22 06:05 poudink

I wanted to compile this from source due to it having a fallback option if I don't have those ds binaries

You don't need to build for that. The BIOS and firmware replacements are a part of the latest stable release.

Same result, in the latest stable as well...

Which very much confuses me...

Btw, what solution can help me build this properly, without that issue blocking me building it properly?

I run into issues even in the latest stable as well... Also, the glibc issue comes up if I use your binary build, instead of building it myself.

FrostKnight avatar May 10 '22 20:05 FrostKnight

Use a newer version of GCC or adjust the build system to link against stdc++fs. However if your system's version of Qt is as old as your compiler it probably still won't work.

nadiaholmquist avatar May 10 '22 20:05 nadiaholmquist

Use a newer version of GCC or adjust the build system to link against stdc++fs. However if your system's version of Qt is as old as your compiler it probably still won't work.

Hmm okay, how do I adjust the build system?

Btw, got qt 5.15, is that too old?

I don't know which version you support at this time aka...

FrostKnight avatar May 10 '22 20:05 FrostKnight

5.15 is the newest version so that's all good, though 5.10 and up should work.

For the build system you would want to edit src/CMakeLists.txt and add something like target_link_libraries(core PUBLIC stdc++fs) after the add_library.

nadiaholmquist avatar May 10 '22 21:05 nadiaholmquist

is hyperbola not arch-based? why is your gcc version so old?

poudink avatar May 11 '22 02:05 poudink

is hyperbola not arch-based? why is your gcc version so old?

It is an unusual distro, its hard to explain, but yeah, think hard fork of Arch, made to be stable and many other K.I.S.S friendly changes...

;)

5.15 is the newest version so that's all good, though 5.10 and up should work.

For the build system you would want to edit src/CMakeLists.txt and add something like target_link_libraries(core PUBLIC stdc++fs) after the add_library.

Hmm, if this works, cool!

I will try this as soon as I can...

Late right now, but thanks!

EDIT:

Seems I might be doing this wrong, dunno if this is needed, but I am either adding it in the wrong spot, or, I need to be more precise... gonna try a few things though.

FrostKnight avatar May 11 '22 04:05 FrostKnight

Just an update on how this is working:

Building usually fails still, at this:

[100%] Linking CXX executable ../../../melonDS etc...

I thought I had mentioned this on this thread, but I think I may have forgotten too.

cmake .. -DCMAKE_PREFIX_PATH=/usr -- The C compiler identification is GNU 8.4.0 -- The CXX compiler identification is GNU 8.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/cc -- Looking for pthread.h -- Looking for pthread.h - found -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes -- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") -- Checking for module 'epoxy' -- Found epoxy, version 1.5.4 -- Checking for module 'sdl2' -- Found sdl2, version 2.0.14 -- Checking for module 'slirp' -- Found slirp, version 4.4.0 -- Checking for module 'libarchive' -- Found libarchive, version 3.4.3 -- Configuring done -- Generating done -- Build files have been written to: /home/myusername/Downloads/melonDS-version

Any Version beyond 9.4, Master or newer, as far as I know, has the same problem. including the wifi version, which I tried to install just for the hell of it...

It seems to me that you have some mechanism that breaks it if the versions of specific software are too old...

Do you know how I could completely turn that off?

For GNU only... of course. It may not be a huge need, long term, but it is kind of annoying. Also, using your suggestion to melonDS/src/CMakeLists, still fails, for two reasons, needing to add another )

Or if I don't add the ) it seems to have some weird issue which makes it not realize that its not an issue...

Anyways... be back another time...

Last EDIT? I Think for tonight?

Tried the Modern CMake version, still failed.

Anywho respond if you can.

Also, if you end up making a new build, whether it be 0.9.5, or otherwise, could you make sure such options exist there as well?

Not a huge need, but at the least, even a side build would be nice. Aka, not using the non-free bios crap would be awesome for a stable build.

:)

FrostKnight avatar Sep 30 '22 03:09 FrostKnight