While opening a Bam file with the SeqAn library I get 'seqan::FileOpenError' When I try to open a simple bam file with the SeqAn library using the following code:

CharString bamFileInName = getAbsolutePath("/home/omair/TFG/Files/9827_2#49.bam")
BamFileIn bamFileIn(toCString(bamFileInName));


I get the following error:

terminate called after throwing an instance of 'seqan::FileOpenError'
  what():  Could not open file /home/omair/Programs/seqan//home/omair/TFG/Files/9827_2#49.bam: iostream error

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)


The file exists and the path is correct.
Remove the getAbsolutePath call — your path is already absolute. getAbsolutePath garbles it, as you can see in the error message.