[GH-ISSUE #2] Cannot build on ArchLinux 64bit #1

Closed
opened 2026-03-17 03:00:51 +03:00 by kerem · 8 comments
Owner

Originally created by @minhnhdo on GitHub (Nov 2, 2012).
Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/2

Solution:

  • Directly #include <cstring> or #include <cstdio> into the offending files

or

  • Centralize the missing #includes into one file and include this file in the offending files

Error log:

$ ./b.sh 
-- Configuring done
-- Generating done
-- Build files have been written to: /media/data/Documents/Workplace/ppsspp/SDL/build
[  0%] [  0%] Building CXX object gfx/CMakeFiles/gfx.dir/texture_gen.cpp.o
Building CXX object base/CMakeFiles/base.dir/PCMain.cpp.o
Scanning dependencies of target core
/media/data/Documents/Workplace/ppsspp/native/gfx/texture_gen.cpp: In function ‘uint8_t* generateTexture(const char*, int&, int&, int&, bool&)’:
/media/data/Documents/Workplace/ppsspp/native/gfx/texture_gen.cpp:17:21: error: ‘strlen’ was not declared in this scope
/media/data/Documents/Workplace/ppsspp/native/gfx/texture_gen.cpp:22:41: error: ‘strcmp’ was not declared in this scope
make[2]: *** [gfx/CMakeFiles/gfx.dir/texture_gen.cpp.o] Error 1
make[1]: *** [gfx/CMakeFiles/gfx.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[  0%] [  1%] Building CXX object Core/CMakeFiles/core.dir/Debugger/Breakpoints.cpp.o
Building CXX object Core/CMakeFiles/core.dir/MIPS/MIPSDebugInterface.cpp.o
/media/data/Documents/Workplace/ppsspp/native/base/PCMain.cpp: In function ‘int main(int, char**)’:
/media/data/Documents/Workplace/ppsspp/native/base/PCMain.cpp:235:40: error: ‘getuid’ was not declared in this scope
make[2]: *** [base/CMakeFiles/base.dir/PCMain.cpp.o] Error 1
make[1]: *** [base/CMakeFiles/base.dir/all] Error 2
[  2%] Building CXX object Core/CMakeFiles/core.dir/MIPS/MIPSDisVFPU.cpp.o
/media/data/Documents/Workplace/ppsspp/Core/Debugger/Breakpoints.cpp: In member function ‘void MemCheck::Action(u32, u32, bool, int, u32)’:
/media/data/Documents/Workplace/ppsspp/Core/Debugger/Breakpoints.cpp:42:161: error: ‘printf’ was not declared in this scope
In file included from /media/data/Documents/Workplace/ppsspp/Core/Debugger/Breakpoints.cpp:21:0:
/media/data/Documents/Workplace/ppsspp/SDL/../Common/FixedSizeUnorderedSet.h: In instantiation of ‘bool FixedSizeUnorderedSet<T, maxCount>::insert(T) [with T = BreakPoint; long unsigned int maxCount = 16ul]’:
/media/data/Documents/Workplace/ppsspp/Core/Debugger/Breakpoints.cpp:124:27:   required from here
/media/data/Documents/Workplace/ppsspp/SDL/../Common/FixedSizeUnorderedSet.h:13:5: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
make[2]: *** [Core/CMakeFiles/core.dir/Debugger/Breakpoints.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /media/data/Documents/Workplace/ppsspp/Core/MIPS/MIPSDebugInterface.cpp:20:0:
/media/data/Documents/Workplace/ppsspp/Core/MIPS/../Debugger/DebugInterface.h: In member function ‘virtual void DebugInterface::DisAsm(u32, u32, int, char*)’:
/media/data/Documents/Workplace/ppsspp/Core/MIPS/../Debugger/DebugInterface.h:50:93: error: ‘sprintf’ was not declared in this scope
/media/data/Documents/Workplace/ppsspp/Core/MIPS/../Debugger/DebugInterface.h: In member function ‘virtual void DebugInterface::PrintRegValue(int, int, char*)’:
/media/data/Documents/Workplace/ppsspp/Core/MIPS/../Debugger/DebugInterface.h:58:42: error: ‘sprintf’ was not declared in this scope
make[2]: *** [Core/CMakeFiles/core.dir/MIPS/MIPSDebugInterface.cpp.o] Error 1
make[1]: *** [Core/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2
Originally created by @minhnhdo on GitHub (Nov 2, 2012). Original GitHub issue: https://github.com/hrydgard/ppsspp/issues/2 Solution: - Directly `#include <cstring>` or `#include <cstdio>` into the offending files _or_ - Centralize the missing `#include`s into one file and include this file in the offending files Error log: ``` $ ./b.sh -- Configuring done -- Generating done -- Build files have been written to: /media/data/Documents/Workplace/ppsspp/SDL/build [ 0%] [ 0%] Building CXX object gfx/CMakeFiles/gfx.dir/texture_gen.cpp.o Building CXX object base/CMakeFiles/base.dir/PCMain.cpp.o Scanning dependencies of target core /media/data/Documents/Workplace/ppsspp/native/gfx/texture_gen.cpp: In function ‘uint8_t* generateTexture(const char*, int&, int&, int&, bool&)’: /media/data/Documents/Workplace/ppsspp/native/gfx/texture_gen.cpp:17:21: error: ‘strlen’ was not declared in this scope /media/data/Documents/Workplace/ppsspp/native/gfx/texture_gen.cpp:22:41: error: ‘strcmp’ was not declared in this scope make[2]: *** [gfx/CMakeFiles/gfx.dir/texture_gen.cpp.o] Error 1 make[1]: *** [gfx/CMakeFiles/gfx.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 0%] [ 1%] Building CXX object Core/CMakeFiles/core.dir/Debugger/Breakpoints.cpp.o Building CXX object Core/CMakeFiles/core.dir/MIPS/MIPSDebugInterface.cpp.o /media/data/Documents/Workplace/ppsspp/native/base/PCMain.cpp: In function ‘int main(int, char**)’: /media/data/Documents/Workplace/ppsspp/native/base/PCMain.cpp:235:40: error: ‘getuid’ was not declared in this scope make[2]: *** [base/CMakeFiles/base.dir/PCMain.cpp.o] Error 1 make[1]: *** [base/CMakeFiles/base.dir/all] Error 2 [ 2%] Building CXX object Core/CMakeFiles/core.dir/MIPS/MIPSDisVFPU.cpp.o /media/data/Documents/Workplace/ppsspp/Core/Debugger/Breakpoints.cpp: In member function ‘void MemCheck::Action(u32, u32, bool, int, u32)’: /media/data/Documents/Workplace/ppsspp/Core/Debugger/Breakpoints.cpp:42:161: error: ‘printf’ was not declared in this scope In file included from /media/data/Documents/Workplace/ppsspp/Core/Debugger/Breakpoints.cpp:21:0: /media/data/Documents/Workplace/ppsspp/SDL/../Common/FixedSizeUnorderedSet.h: In instantiation of ‘bool FixedSizeUnorderedSet<T, maxCount>::insert(T) [with T = BreakPoint; long unsigned int maxCount = 16ul]’: /media/data/Documents/Workplace/ppsspp/Core/Debugger/Breakpoints.cpp:124:27: required from here /media/data/Documents/Workplace/ppsspp/SDL/../Common/FixedSizeUnorderedSet.h:13:5: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] make[2]: *** [Core/CMakeFiles/core.dir/Debugger/Breakpoints.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... In file included from /media/data/Documents/Workplace/ppsspp/Core/MIPS/MIPSDebugInterface.cpp:20:0: /media/data/Documents/Workplace/ppsspp/Core/MIPS/../Debugger/DebugInterface.h: In member function ‘virtual void DebugInterface::DisAsm(u32, u32, int, char*)’: /media/data/Documents/Workplace/ppsspp/Core/MIPS/../Debugger/DebugInterface.h:50:93: error: ‘sprintf’ was not declared in this scope /media/data/Documents/Workplace/ppsspp/Core/MIPS/../Debugger/DebugInterface.h: In member function ‘virtual void DebugInterface::PrintRegValue(int, int, char*)’: /media/data/Documents/Workplace/ppsspp/Core/MIPS/../Debugger/DebugInterface.h:58:42: error: ‘sprintf’ was not declared in this scope make[2]: *** [Core/CMakeFiles/core.dir/MIPS/MIPSDebugInterface.cpp.o] Error 1 make[1]: *** [Core/CMakeFiles/core.dir/all] Error 2 make: *** [all] Error 2 ```
kerem closed this issue 2026-03-17 03:00:58 +03:00
Author
Owner

@hrydgard commented on GitHub (Nov 2, 2012):

Keep sending pull requests with fixes :)

<!-- gh-comment-id:10020713 --> @hrydgard commented on GitHub (Nov 2, 2012): Keep sending pull requests with fixes :)
Author
Owner

@minhnhdo commented on GitHub (Nov 2, 2012):

Do you want me to include the missing header into each file? Or do you prefer a centralized include?

<!-- gh-comment-id:10020751 --> @minhnhdo commented on GitHub (Nov 2, 2012): Do you want me to include the missing header into each file? Or do you prefer a centralized include?
Author
Owner

@hrydgard commented on GitHub (Nov 2, 2012):

Oh sorry, missed that you were asking a question.

Please add them to all of the files, centralized includes tend to grow over time and slow down the build.

It's odd that this include problem isn't an issue on Mac or Android, it builds fine on those..

<!-- gh-comment-id:10020887 --> @hrydgard commented on GitHub (Nov 2, 2012): Oh sorry, missed that you were asking a question. Please add them to all of the files, centralized includes tend to grow over time and slow down the build. It's odd that this include problem isn't an issue on Mac or Android, it builds fine on those..
Author
Owner

@minhnhdo commented on GitHub (Nov 2, 2012):

I suspect the compiler implicitly links the program with stdlib functions

<!-- gh-comment-id:10020963 --> @minhnhdo commented on GitHub (Nov 2, 2012): I suspect the compiler implicitly links the program with stdlib functions
Author
Owner

@minhnhdo commented on GitHub (Nov 3, 2012):

after fixing a bunch of missing #includes and missing CMake linking directives, I'm able to run the program. However, running the program (./SDL/build/ppsspp) would only give me a blocky splash screen in the emulator, followed by a blocky menu. Is this intended?

<!-- gh-comment-id:10035554 --> @minhnhdo commented on GitHub (Nov 3, 2012): after fixing a bunch of missing `#include`s and missing CMake linking directives, I'm able to run the program. However, running the program (`./SDL/build/ppsspp`) would only give me a blocky splash screen in the emulator, followed by a blocky menu. Is this intended?
Author
Owner

@hrydgard commented on GitHub (Nov 3, 2012):

No, it should work - it needs assets/ui_atlas.zim to be accessible though so you need to run it from the right directory. I hope to find some way to build the graphics into the binary later.

(try running ./buildassets.sh in /SDL to copy over the atlas from the android directory. yeah I know this is a bit silly)

<!-- gh-comment-id:10044461 --> @hrydgard commented on GitHub (Nov 3, 2012): No, it should work - it needs assets/ui_atlas.zim to be accessible though so you need to run it from the right directory. I hope to find some way to build the graphics into the binary later. (try running ./buildassets.sh in /SDL to copy over the atlas from the android directory. yeah I know this is a bit silly)
Author
Owner

@minhnhdo commented on GitHub (Nov 4, 2012):

it runs perfectly after I have copied the assets/ folder into the same folder containing ppsspp executable.

<!-- gh-comment-id:10046230 --> @minhnhdo commented on GitHub (Nov 4, 2012): it runs perfectly after I have copied the `assets/` folder into the same folder containing `ppsspp` executable.
Author
Owner

@Jack54guythecoder commented on GitHub (Aug 15, 2025):

So, technically this is the first issue EVER......

WOW.

<!-- gh-comment-id:3190377473 --> @Jack54guythecoder commented on GitHub (Aug 15, 2025): So, technically this is the first issue EVER...... WOW.
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/ppsspp#1
No description provided.