I'm trying to create a Python module on c ++, but my code does not want to compile when issuing an error. Did as on the official website.
static PyMethodDef iceserver_methods[] = {
{"colorize_BUFR", (PyCFunction)colorize_BUFR, METH_VARARGS, NULL},
{NULL, NULL}
};
static struct PyModuleDef iceIceModule = {
PyModuleDef_HEAD_INIT,
"ice_ice", /* name of module */
"icerver_doc", /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module,
or -1 if the module keeps state in global variables. */
iceserver_methods
};
extern "C" PyMODINIT_FUNC PyInit_iceModule(void)
{
return PyModule_Create(&iceIceModule);
}
Eror: /home/divinitytoffee/projects/adder/pythonModule.cpp:85: multiple definition of `PyInit_iceModule' CMakeFiles/adder.dir/main.cpp.o:/home/divinitytoffee/projects/adder/pythonModule.cpp:85: first defined here