ZDoom / ZMusic

GZDoom's music system as a standalone library
https://forum.zdoom.org/index.php
63 stars 33 forks source link

zmusic not compiling/building - error: ‘uint8_t’ does not name a type #46

Closed zmnpl closed 1 year ago

zmnpl commented 1 year ago

Hey, so while I come across this building the zmusic from the Arch Linux AUR it looks like the issue is coming from zmusic rather than the package build. Here is the error log when compiling:

n file included from /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/instrum.cpp:30: /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:129:15: error: ‘uint8_t’ does not name a type 129 | const uint8_t *mData; | ^~~~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:30:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’? 29 | #include <string> +++ |+#include <cstdint> 30 | /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:133:28: error: ‘uint8_t’ does not name a type 133 | MemoryReader(const uint8_t *data, long length) | ^~~~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:133:28: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’? /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h: In constructor ‘MusicIO::MemoryReader::MemoryReader(const int*, long int)’: /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:134:12: error: class ‘MusicIO::MemoryReader’ does not have any field named ‘mData’ 134 | : mData(data), mLength(length), mPos(0) | ^~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h: In member function ‘virtual char* MusicIO::MemoryReader::gets(char*, int)’: /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:146:29: error: ‘mData’ was not declared in this scope 146 | if (mData[mPos] == 0) | ^~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:151:29: error: ‘mData’ was not declared in this scope 151 | if (mData[mPos] != '\r') | ^~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h: In member function ‘virtual long int MusicIO::MemoryReader::read(void*, int32_t)’: /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:172:30: error: ‘mData’ was not declared in this scope 172 | memcpy(buff, mData + mPos, len); | ^~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h: At global scope: /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:209:21: error: ‘uint8_t’ was not declared in this scope 209 | std::vector<uint8_t> mVector; | ^~~~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:209:21: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’? /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:209:28: error: template argument 1 is invalid 209 | std::vector<uint8_t> mVector; | ^ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:209:28 : error: template argument 2 is invalid /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:219:28: error: ‘uint8_t’ does not name a type 219 | VectorReader(const uint8_t* data, size_t size) | ^~~~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:219:28: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’? /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h: In constructor ‘MusicIO::VectorReader::VectorReader(getFunc)’: /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:215:17: error: ‘mData’ was not declared in this scope 215 | mData = mVector.data(); | ^~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:215:33: error: request for member ‘data’ in ‘((MusicIO::VectorReader*)this)->MusicIO::VectorReader::mVector’, which is of non-class type ‘int’ 215 | mData = mVector.data(); | ^~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:216:41: error: request for member ‘size’ in ‘((MusicIO::VectorReader*)this)->MusicIO::VectorReader::mVector’, which is of non-class type ‘int’ 216 | mLength = (long)mVector.size(); | ^~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h: In constructor ‘MusicIO::VectorReader::VectorReader(const int*, size_t)’: /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:221:25: error: request for member ‘resize’ in ‘((MusicIO::VectorReader*)this)->MusicIO::VectorReader::mVector’, which is of non-class type ‘int’ 221 | mVector.resize(size); | ^~~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:222:32: error: request for member ‘data’ in ‘((MusicIO::VectorReader*)this)->MusicIO::VectorReader::mVector’, which is of non-class type ‘int’ 222 | memcpy(mVector.data(), data, size); | ^~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h: In member function ‘virtual MusicIO::FileInterface* MusicIO::SF2Reader::open_file(const char*)’: /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:376:50: error: ‘uint8_t’ was not declared in this scope 376 | return new MemoryReader((uint8_t*)mMainConfigForSF2.c_str(), (long)mMainConfigForSF2.length()); | ^~~~~~~ /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:376:50: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’? /home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/thirdparty/timidityplus/timiditypp/../../../source/zmusic/fileio.h:376:58: error: expected primary-expression before ‘)’ token 376 | return new MemoryReader((uint8_t*)mMainConfigForSF2.c_str(), (long)mMainConfigForSF2.length()); | ^ make[2]: *** [thirdparty/timidityplus/CMakeFiles/timidityplus.dir/build.make:174: thirdparty/timidityplus/CMakeFiles/timidityplus.dir/instrum.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:422: thirdparty/timidityplus/CMakeFiles/timidityplus.dir/all] Error 2 make: *** [Makefile:156: all] Error 2 make: Leaving directory '/home/username/.cache/paru/clone/zmusic/src/ZMusic-1.1.11/build' ==> ERROR: A failure occurred in build(). Aborting... error: failed to build 'zmusic-1.1.11-1': error: packages failed to build: zmusic-1.1.11-1

zmnpl commented 1 year ago

Hi, so I found that this is related to the gcc version. And Arch Linux just updated to v13. Don't think the issue lies here then.