I read the code AppDraftUtilsPy.cpp and try to modified it.
However I always get the First Error
" undefined reference to `Py::ExtensionModuleBase::module() const' "
But I have no idea about how to fix the problem
Here is my code for make the c++ command, for now The command did not do anything.
Could anyone give me some hints?
Code: Select all
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <CXX/Extensions.hxx>
#include <CXX/Objects.hxx>
namespace MyCommand {
class Module : public Py::ExtensionModule<Module>
{
public:
Module() : Py::ExtensionModule<Module>("MyCommand")
{
add_varargs_method("Command",&Module::Command,
"Nothing"
);
initialize("nothing"); // register with Python
}
virtual ~Module() {}
private:
Py::Object Command(const Py::Tuple& args)
{
return Py::None();
}
};
PyObject* initModule()
{
return (new Module)->module().ptr();
}
}