I used Interrogate supplied with Panda3D 1.10.16, in search of a way to return a list of Boolean flags from the C++ function, I decided to switch to Interrogate 0.8.1 from PyPI.
However, I found that the generated module cannot be compiled:
test_my_module_igate.cxx
D:/a/interrogate/interrogate/src/interrogatedb/py_support.h(112,50): error C2039: 'PythonWrapFunc': is not a member of 'TypeRegistry' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxpr
oj]
D:\Panda3D-1.10.16-x64\include\typeRegistry.h(36,29): message : see declaration of 'TypeRegistry' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
D:/a/interrogate/interrogate/src/interrogatedb/py_support.h(112,65): error C2061: syntax error: identifier 'PythonWrapFunc' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
D:\Panda3D-1.10.16-x64\include\interrogate_request.h(68,3): error C2371: 'InterrogateModuleDef': redefinition; different basic types [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxpro
j]
D:/a/interrogate/interrogate/src/interrogatedb/py_support.h(203,16): message : see declaration of 'InterrogateModuleDef' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
/d/Code/Cpp/ImGuiIntegration/Variant_6/module/test_my_module_igate.cxx(1412,52): error C2027: use of undefined type 'InterrogateModuleDef' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.
vcxproj]
D:/a/interrogate/interrogate/src/interrogatedb/py_support.h(203,16): message : see declaration of 'InterrogateModuleDef' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
test_my_module.cxx
D:/a/interrogate/interrogate/src/interrogatedb/py_support.h(112,50): error C2039: 'PythonWrapFunc': is not a member of 'TypeRegistry' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxpr
oj]
D:\Panda3D-1.10.16-x64\include\typeRegistry.h(36,29): message : see declaration of 'TypeRegistry' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
D:/a/interrogate/interrogate/src/interrogatedb/py_support.h(112,65): error C2061: syntax error: identifier 'PythonWrapFunc' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
D:/a/interrogate/interrogate/src/interrogatedb/py_panda.cxx(269,83): error C2039: 'wrap_python': is not a member of 'TypeHandle' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
D:\Panda3D-1.10.16-x64\include\typeRegistry.h(25,7): message : see declaration of 'TypeHandle' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
D:/a/interrogate/interrogate/src/interrogatedb/py_support.cxx(290,36): error C2039: 'PythonWrapFunc': is not a member of 'TypeRegistry' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcx
proj]
D:\Panda3D-1.10.16-x64\include\typeRegistry.h(36,29): message : see declaration of 'TypeRegistry' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
D:/a/interrogate/interrogate/src/interrogatedb/py_support.cxx(290,51): error C2061: syntax error: identifier 'PythonWrapFunc' [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
D:/a/interrogate/interrogate/src/interrogatedb/py_support.cxx(304,51): error C2065: 'wrap_func': undeclared identifier [D:\Code\Cpp\ImGuiIntegration\Variant_6\temp\test_my_module.vcxproj]
At the same time, this module generated by interrogate, supplied with Panda3D 1.10.16, compiles without problems.
I have created a minimal example.
#ifndef EXAMPLE_H
#define EXAMPLE_H
#include "dtoolbase.h"
#endif EXAMPLE_H
My interrogation commands.
interrogate.exe -v -spam -nomangle -D __inline -D CPPPARSER -D P3_INTERROGATE=1 -D __cplusplus=202302L -fnames -python-native -string -refcount -assert -S /d/Panda3D-1.10.16-x64/include/parser-inc -I /d/Panda3D-1.10.16-x64/include -oc module/test_my_module_igate.cxx -od module/test_my_module.in -srcdir src example.h -module test_my_module -library test_my_module
interrogate_module.exe -python-native -module test_my_module -import panda3d.core -library test_my_module -oc module/test_my_module.cxx module/test_my_module.in
CMake file.
cmake_minimum_required(VERSION 3.24)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
project(test_my_module VERSION 1.0)
set(PandaSDK D:/Panda3D-1.10.16-x64)
set(SOURCES
test_my_module_igate.cxx
test_my_module.cxx
)
link_directories(test_my_module ${PandaSDK}/lib)
link_directories(test_my_module ${PandaSDK}/python/libs)
include_directories(${PandaSDK}/include)
include_directories(${PandaSDK}/python/include)
include_directories(../src)
add_library(test_my_module SHARED ${SOURCES})
set_target_properties(test_my_module PROPERTIES SUFFIX ".pyd")
target_link_libraries(test_my_module libp3dtool)
target_link_libraries(test_my_module libp3interrogatedb)
target_link_libraries(test_my_module libp3dtoolconfig)
target_link_libraries(test_my_module libpanda)
target_link_libraries(test_my_module libpandaexpress)
add_custom_command( TARGET test_my_module
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
Release/test_my_module.pyd
${PandaSDK}/panda3d/test_my_module.pyd
)