Dear All,
I'm trying to wrap this C++ header:
which has a constructor SeqStreamIn( const char* filename )
My Nim code is
# Compile with
# nim cpp --cincludes:. --passL:"-lz" kseqpp
import os
const
seqio = "seqio.h"
type
SeqStreamInObj {.header: seqio, importcpp: "klibpp::SeqStreamIn".} = object
SeqStreamIn = ptr SeqStreamInObj
proc newSeqStreamIn*(fn: cstring): SeqStreamInObj {.importcpp: "klibpp::SeqStreamIn(#)".}
when isMainModule:
var iss = newSeqStreamIn("sample.fastq".cstring)
However, when I compile, I get an error, error: no matching function for call to ‘klibpp::SeqStreamIn::SeqStreamIn()’.
Any ideas of what I'm doing wrong?
You need to use this instead:
proc newSeqStreamIn*(fn: cstring): SeqStreamInObj {.importcpp: "klibpp::SeqStreamIn(@)".}
(I think, couldn't test it.)