[GH-ISSUE #2870] [APP BUG]: Compiling from source fails on Arch Linux #921

Closed
opened 2026-02-27 21:08:54 +03:00 by kerem · 4 comments
Owner

Originally created by @wantija on GitHub (May 1, 2025).
Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/2870

Checklist

  • I have searched for a similar issue in this repository and did not find one.
  • I am using an official build obtained from releases or updated one of those builds using its in-app updater.

Describe the Bug

When trying to compile shadPS4 using instruction from the Linux compilation guide on Arch Linux with latest updates as-of today (GCC 15.1 was just downloaded from repos), compilation fails.

shadps4-compile.log

Reproduction Steps

Compile shadPS4 using the build steps on Arch Linux.

Expected Behavior

ShadPS4 should compile.

Specify OS Version

Arch Linux

CPU

R7 5800X

GPU

RX 6800XT

Amount of RAM in GB

32GB

Originally created by @wantija on GitHub (May 1, 2025). Original GitHub issue: https://github.com/shadps4-emu/shadPS4/issues/2870 ### Checklist - [x] I have searched for a similar issue in this repository and did not find one. - [x] I am using an official build obtained from [releases](https://github.com/shadps4-emu/shadPS4/releases) or updated one of those builds using its in-app updater. ### Describe the Bug When trying to compile shadPS4 using instruction from the Linux compilation guide on Arch Linux with latest updates as-of today (GCC 15.1 was just downloaded from repos), compilation fails. [shadps4-compile.log](https://github.com/user-attachments/files/19997049/shadps4-compile.log) ### Reproduction Steps Compile shadPS4 using the [build steps](https://github.com/shadps4-emu/shadPS4/blob/main/documents/building-linux.md) on Arch Linux. ### Expected Behavior ShadPS4 should compile. ### Specify OS Version Arch Linux ### CPU R7 5800X ### GPU RX 6800XT ### Amount of RAM in GB 32GB
kerem closed this issue 2026-02-27 21:08:54 +03:00
Author
Owner

@Davey-Hughes commented on GitHub (May 1, 2025):

Wanted to give some extra context, this is the error I'm getting:

[ 45%] Building CXX object CMakeFiles/shadps4.dir/src/core/devices/srandom_device.cpp.o
[ 45%] Building CXX object CMakeFiles/shadps4.dir/src/core/file_format/psf.cpp.o
/home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/urandom_device.cpp: In static member function ‘static std::shared_ptr<Core::Devices::BaseDevice> Core::Devices::URandomDevice::Create(u32, const char*, int, u16)’:
/home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/urandom_device.cpp:11:21: error: ‘time’ is not a member of ‘std’; did you mean ‘tie’?
   11 |     std::srand(std::time(nullptr));
      |                     ^~~~
      |                     tie
make[2]: *** [CMakeFiles/shadps4.dir/build.make:1104: CMakeFiles/shadps4.dir/src/core/devices/urandom_device.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/srandom_device.cpp: In static member function ‘static std::shared_ptr<Core::Devices::BaseDevice> Core::Devices::SRandomDevice::Create(u32, const char*, int, u16)’:
/home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/srandom_device.cpp:11:21: error: ‘time’ is not a member of ‘std’; did you mean ‘tie’?
   11 |     std::srand(std::time(nullptr));
      |                     ^~~~
      |                     tie
/home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/random_device.cpp: In static member function ‘static std::shared_ptr<Core::Devices::BaseDevice> Core::Devices::RandomDevice::Create(u32, const char*, int, u16)’:
/home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/random_device.cpp:11:21: error: ‘time’ is not a member of ‘std’; did you mean ‘tie’?
   11 |     std::srand(std::time(nullptr));
      |                     ^~~~
      |                     tie
make[2]: *** [CMakeFiles/shadps4.dir/build.make:1118: CMakeFiles/shadps4.dir/src/core/devices/srandom_device.cpp.o] Error 1
make[2]: *** [CMakeFiles/shadps4.dir/build.make:1090: CMakeFiles/shadps4.dir/src/core/devices/random_device.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:332: CMakeFiles/shadps4.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
error: failed to build 'shadps4-git-0.7.0.r48.g9ee5d06-1':
error: packages failed to build: shadps4-git-0.7.0.r48.g9ee5d06-1

I think it's just a matter of #import <ctime> whenever std::time() is used.

<!-- gh-comment-id:2844185741 --> @Davey-Hughes commented on GitHub (May 1, 2025): Wanted to give some extra context, this is the error I'm getting: ```[ 45%] Building CXX object CMakeFiles/shadps4.dir/src/core/devices/urandom_device.cpp.o [ 45%] Building CXX object CMakeFiles/shadps4.dir/src/core/devices/srandom_device.cpp.o [ 45%] Building CXX object CMakeFiles/shadps4.dir/src/core/file_format/psf.cpp.o /home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/urandom_device.cpp: In static member function ‘static std::shared_ptr<Core::Devices::BaseDevice> Core::Devices::URandomDevice::Create(u32, const char*, int, u16)’: /home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/urandom_device.cpp:11:21: error: ‘time’ is not a member of ‘std’; did you mean ‘tie’? 11 | std::srand(std::time(nullptr)); | ^~~~ | tie make[2]: *** [CMakeFiles/shadps4.dir/build.make:1104: CMakeFiles/shadps4.dir/src/core/devices/urandom_device.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... /home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/srandom_device.cpp: In static member function ‘static std::shared_ptr<Core::Devices::BaseDevice> Core::Devices::SRandomDevice::Create(u32, const char*, int, u16)’: /home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/srandom_device.cpp:11:21: error: ‘time’ is not a member of ‘std’; did you mean ‘tie’? 11 | std::srand(std::time(nullptr)); | ^~~~ | tie /home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/random_device.cpp: In static member function ‘static std::shared_ptr<Core::Devices::BaseDevice> Core::Devices::RandomDevice::Create(u32, const char*, int, u16)’: /home/davey/.cache/paru/clone/shadps4-git/src/shadps4/src/core/devices/random_device.cpp:11:21: error: ‘time’ is not a member of ‘std’; did you mean ‘tie’? 11 | std::srand(std::time(nullptr)); | ^~~~ | tie make[2]: *** [CMakeFiles/shadps4.dir/build.make:1118: CMakeFiles/shadps4.dir/src/core/devices/srandom_device.cpp.o] Error 1 make[2]: *** [CMakeFiles/shadps4.dir/build.make:1090: CMakeFiles/shadps4.dir/src/core/devices/random_device.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:332: CMakeFiles/shadps4.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 ==> ERROR: A failure occurred in build(). Aborting... error: failed to build 'shadps4-git-0.7.0.r48.g9ee5d06-1': error: packages failed to build: shadps4-git-0.7.0.r48.g9ee5d06-1 ``` I think it's just a matter of `#import <ctime>` whenever `std::time()` is used.
Author
Owner

@squidbus commented on GitHub (May 1, 2025):

Was about to ask, can you try adding it and make sure that fixes the issue? I'll commit a fix if so

<!-- gh-comment-id:2844186029 --> @squidbus commented on GitHub (May 1, 2025): Was about to ask, can you try adding it and make sure that fixes the issue? I'll commit a fix if so
Author
Owner

@Davey-Hughes commented on GitHub (May 1, 2025):

I use paru to build this AUR package so it took me a bit to figure out how to build this manually, but I can confirm that adding #import <ctime> to ./src/core/devices/random_device.cpp, ./src/core/devices/srandom_device.cpp, and ./src/core/devices/urandom_device.cpp did the trick.

<!-- gh-comment-id:2844198410 --> @Davey-Hughes commented on GitHub (May 1, 2025): I use paru to build [this AUR package](https://aur.archlinux.org/packages/shadps4-git) so it took me a bit to figure out how to build this manually, but I can confirm that adding `#import <ctime>` to `./src/core/devices/random_device.cpp`, `./src/core/devices/srandom_device.cpp`, and `./src/core/devices/urandom_device.cpp` did the trick.
Author
Owner

@squidbus commented on GitHub (May 1, 2025):

Thanks, fixed in github.com/shadps4-emu/shadPS4@4202d9d621

<!-- gh-comment-id:2844201672 --> @squidbus commented on GitHub (May 1, 2025): Thanks, fixed in https://github.com/shadps4-emu/shadPS4/commit/4202d9d621fea5fd5686656b296b97d64e3f3582
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#921
No description provided.