Closed LaySoft closed 1 year ago
Hi, @LaySoft!
To compile on Linux, use GCC with G++ command by:
g++ main.cpp cmdline.cpp ./common/*.cpp ./file/*.cpp ./libsac/*.cpp ./model/*.cpp ./pred/*.cpp -std=c++11 -static -O3 -osac
Feel free to reply with me. :)
Hi!
I tried your command, but many errors occured:
./file/wav.h:19:47: note: initializing argument 1 of 'size_t Chunks::PackMetaData(int&)' 19 | size_t PackMetaData(std::vector |
WriteData(metadata,metadatasize); | ^ |
|
---|---|---|---|---|
std::vector |
./file/wav.h:13:68: note: initializing argument 3 of 'void Chunks::Append(int, int, const int*, int)' 13 | void Append(uint32_t chunkid,uint32_t chunksize,const uint8_t *data,uint32_t len); | myChunks.Append(chunkid,chunksize,buf,chunksize); | ^~~ | |
---|---|---|---|---|
uint8_t [32] {aka unsigned char [32]} |
./file/wav.h:13:68: note: initializing argument 3 of 'void Chunks::Append(int, int, const int*, int)' 13 | void Append(uint32_t chunkid,uint32_t chunksize,const uint8_t *data,uint32_t len); | ReadData(vbuf,readsize); | ^~~~ | |
---|---|---|---|---|
std::vector |
./libsac/../file/file.h:28:48: note: initializing argument 1 of 'void AudioFile::WriteData(const int&, size_t)' 28 | void WriteData(const std::vector |
fin.ReadData(encoded[ch].GetBuf(),blocksize); | ||
---|---|---|---|---|
std::vector |
./libsac/../file/file.h:27:41: note: initializing argument 1 of 'void AudioFile::ReadData(int&, size_t)'
27 | void ReadData(std::vector ~~~~^~
In file included from ./libsac/../model/range.h:4,
from ./libsac/map.h:4,
from ./libsac/map.cpp:1:
./libsac/../model/../common/bufio.h:21:7: error: 'size_t' does not name a type
21 | size_t GetBufPos(){return bufpos;};
| ^~
./libsac/../model/../common/bufio.h:6:1: note: 'size_t' is defined in header '~
./libsac/../model/../common/bufio.h:24:6: note: 'size_t' is defined in header '~
./libsac/../model/../common/bufio.h: In member function 'void BufIO::PutByte(int)':
./libsac/../model/../common/bufio.h:14:13: error: 'bufpos' was not declared in this scope
14 | if (bufpos>=buf.size()) buf.resize(buf.size()2);
| ^~
./libsac/../model/../common/bufio.h:15:13: error: 'bufpos' was not declared in this scope
15 | buf[bufpos++]=val;
| ^~
./libsac/../model/../common/bufio.h: In member function 'int BufIO::GetByte()':
./libsac/../model/../common/bufio.h:18:13: error: 'bufpos' was not declared in this scope
18 | if (bufpos>=buf.size()) return -1;
| ^~
In file included from ./libsac/../model/range.h:4,
from ./libsac/vle.h:4,
from ./libsac/vle.cpp:1:
./libsac/../model/../common/bufio.h:21:7: error: 'size_t' does not name a type
21 | size_t GetBufPos(){return bufpos;};
| ^~
./libsac/../model/../common/bufio.h:6:1: note: 'size_t' is defined in header '~
./libsac/../model/../common/bufio.h:24:6: note: 'size_t' is defined in header '~
./libsac/../model/../common/bufio.h: In member function 'void BufIO::PutByte(int)':
./libsac/../model/../common/bufio.h:14:13: error: 'bufpos' was not declared in this scope
14 | if (bufpos>=buf.size()) buf.resize(buf.size()~
./libsac/../model/../common/bufio.h:15:13: error: 'bufpos' was not declared in this scope
15 | buf[bufpos++]=val;
| ^~
./libsac/../model/../common/bufio.h: In member function 'int BufIO::GetByte()':
./libsac/../model/../common/bufio.h:18:13: error: 'bufpos' was not declared in this scope
18 | if (bufpos>=buf.size()) return -1;
| ^~
In file included from ./model/range.h:4,
from ./model/range.cpp:1:
./model/../common/bufio.h:21:7: error: 'size_t' does not name a type
21 | size_t GetBufPos(){return bufpos;};
| ^~
./model/../common/bufio.h:6:1: note: 'size_t' is defined in header '~
./model/../common/bufio.h:24:6: note: 'size_t' is defined in header '~
./model/../common/bufio.h: In member function 'void BufIO::PutByte(int)':
./model/../common/bufio.h:14:13: error: 'bufpos' was not declared in this scope
14 | if (bufpos>=buf.size()) buf.resize(buf.size()*2);
| ^~
./model/../common/bufio.h:15:13: error: 'bufpos' was not declared in this scope
15 | buf[bufpos++]=val;
| ^~
./model/../common/bufio.h: In member function 'int BufIO::GetByte()':
./model/../common/bufio.h:18:13: error: 'bufpos' was not declared in this scope
18 | if (bufpos>=buf.size()) return -1;
| ^~
Hi, @LaySoft! I think you're using GCC 13 compiler on your computer, try @T-3B's forked repository: https://github.com/T-3B/sac. It has fixes and improvements with GCC 13 compilation issues and others too.
Thank you, it works with your compile command!
@LaySoft I've also uploaded binaries of SAC for Windows, Linux, Android (x86-64 and aarch64 CPU architectures). See here: https://github.com/T-3B/sac/releases/tag/0.6.3%2B
These builds are more optimized than yours (and will run faster), because of PGO and LTO. Feel free to close this issue or to ask me about anything.
How can I compile it on Linux?