I am trying to write a simple program that uses
vorbisfile shared library. But I get a segmentation error when I execute my program. My code is:
Code:
#include <iostream>
using namespace std;
#include <ogg/ogg.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
#include <vorbis/vorbisfile.h>
int main() {
OggVorbis_File * song;
vorbis_info * songInfo;
int result = ov_fopen("./song.ogg", song);
if (result!=0){
cout<<"failed";
return 1;
}
...
return 0;
}
I am compiling the program with the following line:
g++ -lvorbisfile ogg.cpp
and I receive a Segmentation fault error if the song exists when the application is run. Can you help me with this?