[GH-ISSUE #659] Linux Mint Build ERROR: error: ‘byteswap’ is not a member of ‘std’ - SOLVED #155

Closed
opened 2026-02-27 21:04:52 +03:00 by kerem · 2 comments
Owner

Originally created by @GHFear on GitHub (Aug 30, 2024).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/659

I am compiling source using g++-13 on Linux Mint and it's failing on:
[ 81%] Building CXX object CMakeFiles/shadps4.dir/src/core/file_format/pkg.cpp.o

Have had the same problem for about a month, so it's likely something on my end
(perhaps older unsupported dependencies since it's Mint)
My buddy who is on Arch with g++-13 has never had a problem.
Here is a log.

shadps4build.log

EDIT: I created a patched fork that works out of the box for Linux Mint 22 users.
Link: https://github.com/GHFear/shadPS4/tree/main

I had to patch error.h and install more dependencies than for most Linux distributions, but it works with a 1-click build now. Just run setup.sh and watch it build. :)
Hope this can be of help to people.

Originally created by @GHFear on GitHub (Aug 30, 2024). Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/659 I am compiling source using g++-13 on Linux Mint and it's failing on: **[ 81%] Building CXX object CMakeFiles/shadps4.dir/src/core/file_format/pkg.cpp.o** Have had the same problem for about a month, so it's likely something on my end (perhaps older unsupported dependencies since it's Mint) My buddy who is on Arch with g++-13 has never had a problem. Here is a log. [shadps4build.log](https://github.com/user-attachments/files/16811053/shadps4build.log) **EDIT:** I created a patched fork that works out of the box for Linux Mint 22 users. **Link:** [https://github.com/GHFear/shadPS4/tree/main](https://github.com/GHFear/shadPS4/tree/main) I had to patch error.h and install more dependencies than for most Linux distributions, but it works with a 1-click build now. Just run setup.sh and watch it build. :) Hope this can be of help to people.
kerem closed this issue 2026-02-27 21:04:52 +03:00
Author
Owner

@abouvier commented on GitHub (Aug 30, 2024):

You are using GCC 11.4.0 at one point. Your aliases are not used by cmake.

<!-- gh-comment-id:2320077630 --> @abouvier commented on GitHub (Aug 30, 2024): You are using GCC 11.4.0 at one point. Your aliases are not used by cmake.
Author
Owner

@GHFear commented on GitHub (Aug 30, 2024):

You are using GCC 11.4.0 at one point. Your aliases are not used by cmake.

Thank you. I totally missed that.
I now set the compilers inside cmakelists.txt using these commands:

set(CMAKE_C_COMPILER "/usr/bin/gcc-13")
set(CMAKE_CXX_COMPILER "/usr/bin/g++-13")

and it now gets to 89% but errors at this location:

shadps4build.log

EDIT 1:
It's failing when building the avplayer library. (perhaps somebody reading this has had the same experience?)
I could probably go in and fix the errors myself, but I don't really want to edit the source code to make it compile.
At least not for the first compile.
I want to be able to start from the same source and work from there.

EDIT 2:
I fixed it by changing the definition of av_err2string(int errnum);
Write this code in the externals/ffmpeg-core/include/libavutil/error.hfile and rebuild project.

// Fix the av_err2str errors.
#ifdef av_err2str
#undef av_err2str
#include <string>
av_always_inline std::string av_err2string(int errnum) {
    char str[AV_ERROR_MAX_STRING_SIZE];
    return av_make_error_string(str, AV_ERROR_MAX_STRING_SIZE, errnum);
}
#define av_err2str(err) av_err2string(err).c_str()
#endif  // av_err2str

My cmake project now builds to 100%.

EDIT 3:
If you want to actually run ShadPS4 on Linux Mint, you need to upgrade to Mint 22 to get the proper dependencies (glibc version > 2.38) from Ubuntu.
I just tried it and that did the trick.

EDIT 4: I created a patched fork that works out of the box for Linux Mint 22 users.
Link: https://github.com/GHFear/shadPS4/tree/main

I had to patch error.h and install more dependencies than for most Linux distributions, but it works with a 1-click build now. Just run setup.sh and watch it build. :)
Hope this can be of help to people.

It's my first time building something of this scale with cmake on Linux.
Only ever used it for my own projects where I know exactly what's needed to make it build.
So this is quite a different experience.

<!-- gh-comment-id:2320987904 --> @GHFear commented on GitHub (Aug 30, 2024): > You are using GCC 11.4.0 at one point. Your aliases are not used by cmake. Thank you. I totally missed that. I now set the compilers inside cmakelists.txt using these commands: ``` set(CMAKE_C_COMPILER "/usr/bin/gcc-13") set(CMAKE_CXX_COMPILER "/usr/bin/g++-13") ``` and it now gets to 89% but errors at this location: [shadps4build.log](https://github.com/user-attachments/files/16816369/shadps4build.log) **EDIT 1:** It's failing when building the avplayer library. (perhaps somebody reading this has had the same experience?) I could probably go in and fix the errors myself, but I don't really want to edit the source code to make it compile. At least not for the first compile. I want to be able to start from the same source and work from there. **EDIT 2:** I fixed it by changing the definition of av_err2string(int errnum); Write this code in the `externals/ffmpeg-core/include/libavutil/error.h`file and rebuild project. ``` // Fix the av_err2str errors. #ifdef av_err2str #undef av_err2str #include <string> av_always_inline std::string av_err2string(int errnum) { char str[AV_ERROR_MAX_STRING_SIZE]; return av_make_error_string(str, AV_ERROR_MAX_STRING_SIZE, errnum); } #define av_err2str(err) av_err2string(err).c_str() #endif // av_err2str ``` My cmake project now builds to 100%. **EDIT 3:** If you want to actually run ShadPS4 on Linux Mint, you need to upgrade to Mint 22 to get the proper dependencies (glibc version > 2.38) from Ubuntu. I just tried it and that did the trick. **EDIT 4:** I created a patched fork that works out of the box for Linux Mint 22 users. **Link:** [https://github.com/GHFear/shadPS4/tree/main](https://github.com/GHFear/shadPS4/tree/main) I had to patch error.h and install more dependencies than for most Linux distributions, but it works with a 1-click build now. Just run setup.sh and watch it build. :) Hope this can be of help to people. It's my first time building something of this scale with cmake on Linux. Only ever used it for my own projects where I know exactly what's needed to make it build. So this is quite a different experience.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#155
No description provided.