I am running just a little code using libsndfile, in the emscripten environment
#include <iostream>
#include <sndfile.h>
int main()
{
SF_INFO info;
const char * path = "~/data/somefile.wav";
SNDFILE* sf = sf_open(path,SFM_READ, &info);
if(sf == NULL)
{
std::cout<< sf_strerror(sf) << std::endl;
return 1;
}
std::cout<<info.samplerate<<std::endl;
std::cout<<"Hello world" << std::endl;
}
So ideally if I run this with normal cmake
(Apple Clang compiler) everything works fine, the samplerate
and hello world
are printed, but when I run this with emcmake cmake
(em++ compiler) and run the compiled node main.js
file it says System error: no such file or directory
. Who can help me with this? Who has experienced such thing?