Skip to content

[Question] ImportError: DLL load failed while importing #71

@mquasar

Description

@mquasar

I'm getting this error trying to use a C++ module that calls a third-party library to return a boolean value. If I simply return true all works well. But when I call the thid-party function I get the ImportError.

#include <RecFusion.h>
#include <pybind11/pybind11.h>

using namespace RecFusion;

bool isValidLicense() {
	return RecFusionSDK::setLicenseFile("License.dat");
	//return true;
}

namespace py = pybind11;

PYBIND11_MODULE(recfusionbind, m) {
	m.def("isValidLicense", &isValidLicense, R"pbdoc(
		Check if there is a valid license file.
	)pbdoc");

#ifdef VERSION_INFO
	m.attr("__version__") = VERSION_INFO;
#else
	m.attr("__version__") = "dev";
#endif
}

Here is the header of setLicenseFile:

static bool setLicenseFile (const char *filename)

I'm using VS 2019. Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions