biometrics / openbr

Open Source Biometrics, Face Recognition
www.openbiometrics.org
Other
2.85k stars 773 forks source link

NodeJS compilation issues #475

Open mgcrea opened 8 years ago

mgcrea commented 8 years ago

Hey,

I'm trying to setup a working NodeJS binding.gyp file (to compile a C++ addon to use OpenBR from NodeJS) and I'm struggling on the following error:

Error: /srv/node/build/Release/openbr.node: undefined symbol: _ZN12QMapDataBase11shared_nullE

My current binding.gyp file is:

{
  "targets": [
    {
      "target_name": "openbr",
      "sources": [ "src/openbr.cc" ],
      "include_dirs": [
        "<!(node -e \"require('nan')\")",
        "/usr/include/x86_64-linux-gnu/qt5/QtCore",
        "/usr/include/x86_64-linux-gnu/qt5"
      ]
    }
  ]
}

However the QMapDataBase seems to be there:

# find / -name '*QMapDataBase*'
/usr/include/x86_64-linux-gnu/qt5/QtCore/QMapDataBase

Any ideas?

mgcrea commented 8 years ago

Solved thanks to https://github.com/arturadib/node-qt/blob/master/binding.gyp

mgcrea commented 8 years ago

Got new linking errors at runtime while trying to use the AgeEstimation Example:

symbol lookup error: /srv/node/build/Release/openbr.node: undefined symbol: _ZN2br7Context10initializeERiPPc7QStringb

My bindings.gyp looks like:

{
  "targets": [{
    "target_name": "openbr",
    "sources": [
      "src/openbr.cc"
    ],
    "include_dirs": [
      "<!(node -e \"require('nan')\")",
      "/usr/local/openbr",
      "/usr/local/include/opencv",
      "/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64"
    ],
    "conditions": [
      ["OS=='linux'", {
        "cflags": [
          "<!@(pkg-config --cflags Qt5Core Qt5Concurrent Qt5Gui Qt5Test)"
        ],
        "ldflags": [
          "<!@(pkg-config --libs-only-L --libs-only-other Qt5Core Qt5Concurrent Qt5Gui Qt5Test)"
        ],
        "libraries": [
          "<!@(pkg-config --libs-only-l Qt5Core Qt5Concurrent Qt5Gui Qt5Test)"
        ]
      }]
    ]
  }]
}