Hey @tals
I wanted to integrate my changes as discussed in #5, but I have problems getting the project running.
I am using Linux and the GCC compiler and I have some problems with compiling and linking.
I use the provided Makefile and have just replaced clang/clang++ by gcc / g++.
Compiler Errors
I could successfully fix the compiler errors, which were the following:
I had to rename "types.h" to "Types.h".
I had to the include "cstring" which is required for memmove and memcpy.
I got the error "designator order for field 'SF_INFO::samplerate' does not match declaration order in 'SF_INFO'".
This means there is a problem with the used shortcut definition of structs.
Instead of this:
SF_INFO info = {
.channels = channels,
.format = OUTPUT_FORMAT,
.samplerate = mCtx.info.samplerate,
};
I need to write it like this:
SF_INFO info = { };
info.channels = channels;
info.format = OUTPUT_FORMAT;
info.samplerate = mCtx.info.samplerate;
Did you have errors like these as well?
If not, I guess that clang is just more tolerant than gcc.
Fortunately, I could fix these compiler errors and get rid of some by adding the flag "-fpermissive" to the Makefile.
But there are still many compiler warnings, many things seem to be against the C++11 standard, so I guess we should do some major clean up.
Linker Errors
Unfortunately, I still have linker problems with libsndfile.
I installed it by the command "sudo apt-get install libsndfile-1-dev".
The linker can find the library, because the error "cannot find -lsndfile" has disappeared.
But still I get linker errors such as "undefined reference to 'sf_open'".
So even though the linker can find libsndfile, it cannot find the individual functions.
Surprisingly, I have the same problems with pthread, e.g.: "undefined reference to 'pthread_once'"
Do you have any idea how to fix that?
Thanks in advance.