title: Static linking C++ library with Nim C backend
body: <p>I'm trying to build library with external C++ library (uchardet). I use the nimterop library for that.</p>
  <pre><code># wrapper.nim
  import std/os
  import std/strformat
  import nimterop/build
  import nimterop/cimport
  
  const libName = &quot;uchardet&quot;
  const libVer = &quot;0.0.7&quot;
  const srcUrl = &amp;&quot;https://www.freedesktop.org/software/{libName}/releases/{libName}-{libVer}.tar.xz&quot;
  const baseDir = getProjectCacheDir(libName)
  const srcDir = baseDir / libName &amp; &quot;-&quot; &amp; libVer / &quot;src&quot;
  
  static:
    cDebug()
    cDisableCaching()
    downloadUrl(srcUrl, baseDir)
    extractTar(baseDir / lastPathPart(srcUrl), &quot;.&quot;)
    putEnv(&quot;LANG&quot;, &quot;C&quot;)
  
  cOverride:
    type uchardet_t* = pointer
  
  cCompile(srcDir / &quot;*.cpp&quot;, exclude=&quot;tools&quot;)
  cImport(srcDir / &quot;uchardet.h&quot;)
  
  when isMainModule:
    let u = uchardet_new()
    uchardet_delete(u)
  </code></pre>
  <p>This all right if compiled with C++ backend:</p>
  <pre class="lang-sh prettyprint-override"><code>nim cpp -r wrapper.nim
  </code></pre>
  <p>But not with:</p>
  <pre class="lang-sh prettyprint-override"><code>nim c -r wrapper.nim
  </code></pre>
  <p>Output:</p>
  <pre class="lang-sh prettyprint-override"><code># Saved to /home/unikum/.cache/nim/nimterop/toastCache/nimterop_3113589211.nim
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/CharDistribution.cpp.o:(.data.rel.ro._ZTI25EUCJPDistributionAnalysis[_ZTI25EUCJPDistributionAnalysis]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/CharDistribution.cpp.o:(.data.rel.ro._ZTI24SJISDistributionAnalysis[_ZTI24SJISDistributionAnalysis]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/CharDistribution.cpp.o:(.data.rel.ro._ZTI24Big5DistributionAnalysis[_ZTI24Big5DistributionAnalysis]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/CharDistribution.cpp.o:(.data.rel.ro._ZTI26GB2312DistributionAnalysis[_ZTI26GB2312DistributionAnalysis]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/CharDistribution.cpp.o:(.data.rel.ro._ZTI25EUCKRDistributionAnalysis[_ZTI25EUCKRDistributionAnalysis]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/CharDistribution.cpp.o:(.data.rel.ro._ZTI25EUCTWDistributionAnalysis[_ZTI25EUCTWDistributionAnalysis]+0x0): more undefined references to `vtable for __cxxabiv1::__si_class_type_info' follow
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/CharDistribution.cpp.o:(.data.rel.ro._ZTI24CharDistributionAnalysis[_ZTI24CharDistributionAnalysis]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/JpCntx.cpp.o:(.data.rel.ro._ZTI20EUCJPContextAnalysis[_ZTI20EUCJPContextAnalysis]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/JpCntx.cpp.o:(.data.rel.ro._ZTI19SJISContextAnalysis[_ZTI19SJISContextAnalysis]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/JpCntx.cpp.o:(.data.rel.ro._ZTI23JapaneseContextAnalysis[_ZTI23JapaneseContextAnalysis]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsBig5Prober.cpp.o: in function `nsCharSetProber::~nsCharSetProber()':
  nsBig5Prober.cpp:(.text._ZN15nsCharSetProberD0Ev[_ZN15nsCharSetProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsBig5Prober.cpp.o: in function `nsBig5Prober::~nsBig5Prober()':
  nsBig5Prober.cpp:(.text._ZN12nsBig5ProberD2Ev[_ZN12nsBig5ProberD5Ev]+0x30): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsBig5Prober.cpp.o: in function `nsBig5Prober::~nsBig5Prober()':
  nsBig5Prober.cpp:(.text._ZN12nsBig5ProberD0Ev[_ZN12nsBig5ProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsBig5Prober.cpp.o:(.data.rel.ro._ZTI12nsBig5Prober[_ZTI12nsBig5Prober]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsBig5Prober.cpp.o:(.data.rel.ro._ZTI15nsCharSetProber[_ZTI15nsCharSetProber]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEUCJPProber.cpp.o: in function `nsEUCJPProber::~nsEUCJPProber()':
  nsEUCJPProber.cpp:(.text._ZN13nsEUCJPProberD2Ev[_ZN13nsEUCJPProberD5Ev]+0x30): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEUCJPProber.cpp.o: in function `nsEUCJPProber::~nsEUCJPProber()':
  nsEUCJPProber.cpp:(.text._ZN13nsEUCJPProberD0Ev[_ZN13nsEUCJPProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEUCJPProber.cpp.o:(.data.rel.ro._ZTI13nsEUCJPProber[_ZTI13nsEUCJPProber]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEUCKRProber.cpp.o: in function `nsEUCKRProber::~nsEUCKRProber()':
  nsEUCKRProber.cpp:(.text._ZN13nsEUCKRProberD2Ev[_ZN13nsEUCKRProberD5Ev]+0x30): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEUCKRProber.cpp.o: in function `nsEUCKRProber::~nsEUCKRProber()':
  nsEUCKRProber.cpp:(.text._ZN13nsEUCKRProberD0Ev[_ZN13nsEUCKRProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEUCKRProber.cpp.o:(.data.rel.ro._ZTI13nsEUCKRProber[_ZTI13nsEUCKRProber]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEUCTWProber.cpp.o: in function `nsEUCTWProber::~nsEUCTWProber()':
  nsEUCTWProber.cpp:(.text._ZN13nsEUCTWProberD2Ev[_ZN13nsEUCTWProberD5Ev]+0x30): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEUCTWProber.cpp.o: in function `nsEUCTWProber::~nsEUCTWProber()':
  nsEUCTWProber.cpp:(.text._ZN13nsEUCTWProberD0Ev[_ZN13nsEUCTWProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEUCTWProber.cpp.o:(.data.rel.ro._ZTI13nsEUCTWProber[_ZTI13nsEUCTWProber]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEscCharsetProber.cpp.o: in function `nsEscCharSetProber::nsEscCharSetProber(unsigned int)':
  nsEscCharsetProber.cpp:(.text+0x5d): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsEscCharsetProber.cpp:(.text+0x84): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsEscCharsetProber.cpp:(.text+0xb5): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsEscCharsetProber.cpp:(.text+0xe6): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEscCharsetProber.cpp.o: in function `nsEscCharSetProber::~nsEscCharSetProber()':
  nsEscCharsetProber.cpp:(.text+0x189): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEscCharsetProber.cpp.o: in function `nsEscCharSetProber::~nsEscCharSetProber()':
  nsEscCharsetProber.cpp:(.text+0x1cb): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEscCharsetProber.cpp.o:(.data.rel.ro._ZTI18nsEscCharSetProber[_ZTI18nsEscCharSetProber]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsEscCharsetProber.cpp.o:(.data.rel.local.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): undefined reference to `__gxx_personality_v0'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsGB2312Prober.cpp.o: in function `nsGB18030Prober::~nsGB18030Prober()':
  nsGB2312Prober.cpp:(.text._ZN15nsGB18030ProberD2Ev[_ZN15nsGB18030ProberD5Ev]+0x30): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsGB2312Prober.cpp.o: in function `nsGB18030Prober::~nsGB18030Prober()':
  nsGB2312Prober.cpp:(.text._ZN15nsGB18030ProberD0Ev[_ZN15nsGB18030ProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsGB2312Prober.cpp.o:(.data.rel.ro._ZTI15nsGB18030Prober[_ZTI15nsGB18030Prober]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsHebrewProber.cpp.o: in function `nsHebrewProber::~nsHebrewProber()':
  nsHebrewProber.cpp:(.text._ZN14nsHebrewProberD0Ev[_ZN14nsHebrewProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsHebrewProber.cpp.o:(.data.rel.ro._ZTI14nsHebrewProber[_ZTI14nsHebrewProber]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsLatin1Prober.cpp.o: in function `nsLatin1Prober::~nsLatin1Prober()':
  nsLatin1Prober.cpp:(.text._ZN14nsLatin1ProberD0Ev[_ZN14nsLatin1ProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsLatin1Prober.cpp.o:(.data.rel.ro._ZTI14nsLatin1Prober[_ZTI14nsLatin1Prober]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o: in function `nsMBCSGroupProber::nsMBCSGroupProber(unsigned int)':
  nsMBCSGroupProber.cpp:(.text+0x58): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsMBCSGroupProber.cpp:(.text+0x7f): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsMBCSGroupProber.cpp:(.text+0xa8): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsMBCSGroupProber.cpp:(.text+0xdb): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsMBCSGroupProber.cpp:(.text+0x10e): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o:nsMBCSGroupProber.cpp:(.text+0x141): more undefined references to `operator new(unsigned long)' follow
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o: in function `nsMBCSGroupProber::nsMBCSGroupProber(unsigned int)':
  nsMBCSGroupProber.cpp:(.text+0x1aa): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsMBCSGroupProber.cpp:(.text+0x1c2): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsMBCSGroupProber.cpp:(.text+0x1d7): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsMBCSGroupProber.cpp:(.text+0x1ec): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsMBCSGroupProber.cpp:(.text+0x201): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o:nsMBCSGroupProber.cpp:(.text+0x216): more undefined references to `operator delete(void*, unsigned long)' follow
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o: in function `nsSJISProber::nsSJISProber(bool)':
  nsMBCSGroupProber.cpp:(.text._ZN12nsSJISProberC2Eb[_ZN12nsSJISProberC5Eb]+0x5d): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o: in function `nsUTF8Prober::nsUTF8Prober()':
  nsMBCSGroupProber.cpp:(.text._ZN12nsUTF8ProberC2Ev[_ZN12nsUTF8ProberC5Ev]+0x38): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o: in function `nsEUCJPProber::nsEUCJPProber(bool)':
  nsMBCSGroupProber.cpp:(.text._ZN13nsEUCJPProberC2Eb[_ZN13nsEUCJPProberC5Eb]+0x5d): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o: in function `nsGB18030Prober::nsGB18030Prober(bool)':
  nsMBCSGroupProber.cpp:(.text._ZN15nsGB18030ProberC2Eb[_ZN15nsGB18030ProberC5Eb]+0x4d): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o: in function `nsEUCKRProber::nsEUCKRProber(bool)':
  nsMBCSGroupProber.cpp:(.text._ZN13nsEUCKRProberC2Eb[_ZN13nsEUCKRProberC5Eb]+0x4d): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o:nsMBCSGroupProber.cpp:(.text._ZN12nsBig5ProberC2Eb[_ZN12nsBig5ProberC5Eb]+0x4d): more undefined references to `operator new(unsigned long)' follow
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o:(.data.rel.ro._ZTI17nsMBCSGroupProber[_ZTI17nsMBCSGroupProber]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSBCSGroupProber.cpp.o: in function `nsSBCSGroupProber::nsSBCSGroupProber()':
  nsSBCSGroupProber.cpp:(.text+0x2f): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsSBCSGroupProber.cpp:(.text+0x56): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsSBCSGroupProber.cpp:(.text+0x7d): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsSBCSGroupProber.cpp:(.text+0xa4): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsSBCSGroupProber.cpp:(.text+0xcb): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSBCSGroupProber.cpp.o:nsSBCSGroupProber.cpp:(.text+0xf2): more undefined references to `operator new(unsigned long)' follow
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSBCSGroupProber.cpp.o: in function `nsSBCSGroupProber::nsSBCSGroupProber()':
  nsSBCSGroupProber.cpp:(.text+0x112b): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsSBCSGroupProber.cpp:(.text+0x1143): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsSBCSGroupProber.cpp:(.text+0x115b): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsSBCSGroupProber.cpp:(.text+0x1173): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsSBCSGroupProber.cpp:(.text+0x118b): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSBCSGroupProber.cpp.o:nsSBCSGroupProber.cpp:(.text+0x11a3): more undefined references to `operator delete(void*, unsigned long)' follow
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSBCSGroupProber.cpp.o:(.data.rel.ro._ZTI17nsSBCSGroupProber[_ZTI17nsSBCSGroupProber]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSBCharSetProber.cpp.o: in function `nsSingleByteCharSetProber::~nsSingleByteCharSetProber()':
  nsSBCharSetProber.cpp:(.text._ZN25nsSingleByteCharSetProberD0Ev[_ZN25nsSingleByteCharSetProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSBCharSetProber.cpp.o:(.data.rel.ro._ZTI25nsSingleByteCharSetProber[_ZTI25nsSingleByteCharSetProber]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSJISProber.cpp.o: in function `nsSJISProber::~nsSJISProber()':
  nsSJISProber.cpp:(.text._ZN12nsSJISProberD2Ev[_ZN12nsSJISProberD5Ev]+0x30): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSJISProber.cpp.o: in function `nsSJISProber::~nsSJISProber()':
  nsSJISProber.cpp:(.text._ZN12nsSJISProberD0Ev[_ZN12nsSJISProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsSJISProber.cpp.o:(.data.rel.ro._ZTI12nsSJISProber[_ZTI12nsSJISProber]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsUTF8Prober.cpp.o: in function `nsUTF8Prober::~nsUTF8Prober()':
  nsUTF8Prober.cpp:(.text._ZN12nsUTF8ProberD2Ev[_ZN12nsUTF8ProberD5Ev]+0x30): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsUTF8Prober.cpp.o: in function `nsUTF8Prober::~nsUTF8Prober()':
  nsUTF8Prober.cpp:(.text._ZN12nsUTF8ProberD0Ev[_ZN12nsUTF8ProberD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsUTF8Prober.cpp.o:(.data.rel.ro._ZTI12nsUTF8Prober[_ZTI12nsUTF8Prober]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsUniversalDetector.cpp.o: in function `nsUniversalDetector::~nsUniversalDetector()':
  nsUniversalDetector.cpp:(.text+0x145): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsUniversalDetector.cpp.o: in function `nsUniversalDetector::HandleData(char const*, unsigned int)':
  nsUniversalDetector.cpp:(.text+0x484): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsUniversalDetector.cpp:(.text+0x4dc): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsUniversalDetector.cpp:(.text+0x521): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsUniversalDetector.cpp:(.text+0x602): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: nsUniversalDetector.cpp:(.text+0x779): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsUniversalDetector.cpp:(.text+0x794): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsUniversalDetector.cpp:(.text+0x7af): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: nsUniversalDetector.cpp:(.text+0x7ca): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/nsUniversalDetector.cpp.o:(.data.rel.ro._ZTI19nsUniversalDetector[_ZTI19nsUniversalDetector]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/uchardet.cpp.o: in function `uchardet_new':
  uchardet.cpp:(.text+0xd): undefined reference to `operator new(unsigned long)'
  /usr/bin/ld: uchardet.cpp:(.text+0x2d): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/uchardet.cpp.o: in function `HandleUniversalDetector::~HandleUniversalDetector()':
  uchardet.cpp:(.text._ZN23HandleUniversalDetectorD0Ev[_ZN23HandleUniversalDetectorD5Ev]+0x25): undefined reference to `operator delete(void*, unsigned long)'
  /usr/bin/ld: /home/unikum/.cache/nim/wrapper_d/uchardet.cpp.o:(.data.rel.ro._ZTI23HandleUniversalDetector[_ZTI23HandleUniversalDetector]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
  collect2: error: ld returned 1 exit status
  Error: execution of an external program failed: 'gcc   -o /run/media/unikum/UNIKUM-STORAGE/private/prog/nim/nim-uchardet/wrapper  /home/unikum/.cache/nim/wrapper_d/CharDistribution.cpp.o /home/unikum/.cache/nim/wrapper_d/JpCntx.cpp.o /home/unikum/.cache/nim/wrapper_d/nsBig5Prober.cpp.o /home/unikum/.cache/nim/wrapper_d/nsCharSetProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsEUCJPProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsEUCKRProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsEUCTWProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsEscCharsetProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsEscSM.cpp.o /home/unikum/.cache/nim/wrapper_d/nsGB2312Prober.cpp.o /home/unikum/.cache/nim/wrapper_d/nsHebrewProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsLatin1Prober.cpp.o /home/unikum/.cache/nim/wrapper_d/nsMBCSGroupProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsMBCSSM.cpp.o /home/unikum/.cache/nim/wrapper_d/nsSBCSGroupProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsSBCharSetProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsSJISProber.cpp.o /home/unikum/.cache/nim/wrapper_d/nsUTF8Prober.cpp.o /home/unikum/.cache/nim/wrapper_d/nsUniversalDetector.cpp.o /home/unikum/.cache/nim/wrapper_d/uchardet.cpp.o /home/unikum/.cache/nim/wrapper_d/LangArabicModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangBulgarianModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangCroatianModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangCzechModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangDanishModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangEsperantoModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangEstonianModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangFinnishModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangFrenchModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangGermanModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangGreekModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangHebrewModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangHungarianModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangIrishModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangItalianModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangLatvianModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangLithuanianModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangMalteseModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangPolishModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangPortugueseModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangRomanianModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangRussianModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangSlovakModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangSloveneModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangSpanishModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangSwedishModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangThaiModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangTurkishModel.cpp.o /home/unikum/.cache/nim/wrapper_d/LangVietnameseModel.cpp.o /home/unikum/.cache/nim/wrapper_d/stdlib_digitsutils.nim.c.o /home/unikum/.cache/nim/wrapper_d/stdlib_dollars.nim.c.o /home/unikum/.cache/nim/wrapper_d/stdlib_system.nim.c.o /home/unikum/.cache/nim/wrapper_d/stdlib_times.nim.c.o /home/unikum/.cache/nim/wrapper_d/stdlib_os.nim.c.o /home/unikum/.cache/nim/wrapper_d/@m..@s..@s..@s..@s..@s..@s..@s..@shome@sunikum@s.nimble@spkgs@snimterop-0.6.13@snimterop@sglobals.nim.c.o /home/unikum/.cache/nim/wrapper_d/@mwrapper.nim.c.o  -lm -lm -lrt   -ldl'
  </code></pre>
  <p>Also it works with dynamic library linking.</p>
  <p>Is there any chance to make it work with C backend?</p>