2

I am trying to use Affectiva emotion sdk to make a demo program. However, when I call detector.setLicensePath(), an exception is thrown (see image below). Does anyone know how to resolve this?

The code is something similar to this:

const std::wstring AFFDEX_DATA_DIR = L"C:\\Program Files (x86)\\Affectiva\\Affdex SDK\\data";
…
…  
photoDetector.setLicensePath(AFFDEX_DATA_DIR);

enter image description here

Simon Baslé
  • 27,105
  • 5
  • 69
  • 70
Kuo Paul
  • 21
  • 1

2 Answers2

1

If setLicensePath and/or setClassifierPath returns a std::length_error exception, it means the SDK DLL you are using probably doesn't match the configuration you use to build your binary. For example, if you build in debug mode, but use the release version of the SDK DLL, you will get this exception. The configuration must match the version of the DLL you use. I've gotten this error myself and have just updated the documentation: http://developer.affectiva.com/windows/#configuring-a-detector

1

If you are using the last version, you need to give the license file (and not a folder):

const std::wstring AFFDEX_LICENSE_FILE = L"C:\\Program Files (x86)\\Affectiva\\Affdex SDK\\data\\affdex.license";
videoDetector.setLicensePath(AFFDEX_LICENSE_FILE);
Olivier A
  • 842
  • 4
  • 8