diff --git a/src/python-cellframe.c b/src/python-cellframe.c
index 35cd7a11e2eb18b9266c9fe2e027541c009e6fa2..9427da8d88a4ce0c669054aeeb539ca10d5d2db0 100644
--- a/src/python-cellframe.c
+++ b/src/python-cellframe.c
@@ -487,6 +487,7 @@ PyObject *python_cellframe_deinit(PyObject *self, PyObject *args){
     return PyLong_FromLong(0);
 }
 
+#ifdef DAP_SUPPORT_PYTHON_PLUGINS
 int main(int argc, char **argv) {
     wchar_t *program = Py_DecodeLocale(argv[0], NULL);
     if (program == NULL) {
@@ -511,3 +512,4 @@ int main(int argc, char **argv) {
     PyMem_RawFree(program);
     return 0;
 }
+#endif