tpaviot / pythonocc-core

Python package for 3D geometry CAD/BIM/CAM
GNU Lesser General Public License v3.0
1.38k stars 379 forks source link

[Question] Is it possible to receive pythonocc-core objects inside my own SWIG wrapper? #877

Open Dogrtt opened 4 years ago

Dogrtt commented 4 years ago

I write small C++ lib that use OpenCASCADE, and I wanna provide possibility to accept and return pythonocc-core objects inside my own SWIG wrapper. For now if I got some method in C++ class that return TopoDS_Shape *, in Python I receive <Swig Object of type 'TopoDS_Shape *' at 0x00000204F9E32060>, but I wanna work with pythonocc-core classes. Is it possible to achieve that? Should I somehow describe %typemap of returned pointer?

rainman110 commented 4 years ago

Yes, it's definitely possible. We do the same for our c++ library tigl and achieve full interoperability with pythonocc.

Look at our implementation here : https://github.com/DLR-SC/tigl/tree/master/bindings/python_internal

rainman110 commented 4 years ago

The take home message is, that you have to import the TopoDS.i file from pythonocc-core in your Swig interface file. This makes TopoDS_Shape objects known to the swig type system

Dogrtt commented 4 years ago

@rainman110 Thank you for advise. I take a look into tigl bindings, but some things is not clear for me. I didn't find where you %include <TopoDS.i> and how are you find PythonOCC libs by find_package(PythonOCC)? Anyway, thank you, it looks like I should spend a little bit more time to get the point.

rainman110 commented 4 years ago

Strange, you are right. It was defeinitely required once. This was the first version where it is still included: https://github.com/DLR-SC/tigl/blob/8116ca324b87e1d35eaf60582eb51a78beb9912b/bindings/python_internal/geometry.i

Maybe use this as an example.

and how are you find PythonOCC libs by find_package(PythonOCC)?

I wrote a cmake find script: https://github.com/DLR-SC/tigl/blob/master/cmake/FindPythonOCC.cmake

Dogrtt commented 4 years ago

@rainman110 Yeah, thank you, I'm figured out how it should be included, but now I got a lot of errors on FooParserPYTHON_wrap.cxx building step. Almost all of them is about syntax errors and undeclared identifiers.

  [6/10] Building CXX object wrapper\CMakeFiles\_foo_parser.dir\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx.obj
  FAILED: wrapper/CMakeFiles/_foo_parser.dir/CMakeFiles/_foo_parser.dir/FooParserPYTHON_wrap.cxx.obj 
  C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\cl.exe  /nologo /TP -D_foo_parser_EXPORTS -IF:\Programs\OCCT\opencascade-7.4.0\inc -I..\..\..\wrapper -IF:\Programs\Python38\include -IG:\pythonocc-core-master\src\SWIG_files\wrapper /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG /showIncludes /Fowrapper\CMakeFiles\_foo_parser.dir\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx.obj /Fdwrapper\CMakeFiles\_foo_parser.dir\ /FS -c wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3339): error C2065: 'OCC_CATCH_SIGNALS': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3340): error C2143: syntax error: missing ';' before 'delete'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3344): error C3861: 'process_exception': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3385): error C2065: 'OCC_CATCH_SIGNALS': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3386): error C2146: syntax error: missing ';' before identifier 'result'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3390): error C3861: 'process_exception': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3433): error C2065: 'OCC_CATCH_SIGNALS': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3434): error C2146: syntax error: missing ';' before identifier 'result'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3438): error C3861: 'process_exception': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3481): error C2065: 'OCC_CATCH_SIGNALS': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3482): error C2146: syntax error: missing ';' before identifier 'result'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3486): error C3861: 'process_exception': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3524): error C2065: 'OCC_CATCH_SIGNALS': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3525): error C2146: syntax error: missing ';' before identifier 'result'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3529): error C3861: 'process_exception': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3572): error C3861: 'OCC_CATCH_SIGNALS': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3577): error C3861: 'process_exception': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3624): error C2065: 'OCC_CATCH_SIGNALS': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3625): error C2146: syntax error: missing ';' before identifier 'result'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3629): error C3861: 'process_exception': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3658): error C2065: 'OCC_CATCH_SIGNALS': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3659): error C2146: syntax error: missing ';' before identifier 'result'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3663): error C3861: 'process_exception': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3700): error C2065: 'OCC_CATCH_SIGNALS': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3701): error C2146: syntax error: missing ';' before identifier 'result'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3705): error C3861: 'process_exception': identifier not found
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3749): error C2065: 'TColStd_ListOfInteger': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3749): error C2923: 'NCollection_Array1': 'TColStd_ListOfInteger' is not a valid template type argument for parameter 'TheItemType'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3749): error C2065: 'TColStd_HArray1OfListOfInteger': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3749): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3776): error C2065: 'TCollection_ExtendedString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3776): error C2923: 'NCollection_Sequence': 'TCollection_ExtendedString' is not a valid template type argument for parameter 'TheItemType'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3776): error C2065: 'TColStd_HSequenceOfExtendedString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3776): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3779): error C2065: 'TColStd_HArray2OfCharacter': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3779): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3782): error C2065: 'TColStd_HArray1OfCharacter': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3782): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3785): error C2065: 'TColStd_HArray1OfByte': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3785): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3788): error C2065: 'TColStd_HSequenceOfInteger': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3788): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3791): error C2065: 'TColStd_HArray2OfInteger': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3791): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3794): error C2065: 'TColStd_HArray1OfInteger': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3794): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3797): error C2065: 'TColStd_HSequenceOfTransient': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3797): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3800): error C2065: 'TColStd_HArray2OfReal': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3800): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3806): error C2065: 'TColStd_HSequenceOfReal': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3806): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3809): error C2065: 'TCollection_HExtendedString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3809): error C2923: 'opencascade::handle': 'TCollection_HExtendedString' is not a valid template type argument for parameter 'T'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3809): error C3203: 'handle': unspecialized class template can't be used as a template argument for template parameter 'TheItemType', expected a real type
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3809): error C2065: 'TColStd_HSequenceOfHExtendedString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3809): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3812): error C2065: 'TCollection_HAsciiString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3812): error C2923: 'opencascade::handle': 'TCollection_HAsciiString' is not a valid template type argument for parameter 'T'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3812): error C3203: 'handle': unspecialized class template can't be used as a template argument for template parameter 'TheItemType', expected a real type
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3812): error C2065: 'TColStd_HSequenceOfHAsciiString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3812): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3839): error C2065: 'TColStd_HArray2OfBoolean': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3839): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3842): error C2065: 'TColStd_HArray1OfBoolean': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3842): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3845): error C2065: 'Message_Printer': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3845): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3848): error C2065: 'Message_Alert': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3848): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3851): error C2065: 'TCollection_AsciiString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3851): error C2923: 'NCollection_Sequence': 'TCollection_AsciiString' is not a valid template type argument for parameter 'TheItemType'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3851): error C2065: 'TColStd_HSequenceOfAsciiString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3851): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3854): error C2065: 'TCollection_ExtendedString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3854): error C2923: 'NCollection_Array1': 'TCollection_ExtendedString' is not a valid template type argument for parameter 'TheItemType'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3854): error C2065: 'TColStd_HArray1OfExtendedString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3854): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3857): error C2065: 'TCollection_AsciiString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3857): error C2923: 'NCollection_Array1': 'TCollection_AsciiString' is not a valid template type argument for parameter 'TheItemType'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3857): error C2065: 'TColStd_HArray1OfAsciiString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3857): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3863): error C2065: 'TColStd_HArray2OfReal': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3863): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3866): error C2065: 'TCollection_MapNode': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3866): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3875): error C2065: 'TCollection_SeqNode': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3875): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3878): error C2065: 'Message_ProgressIndicator': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3878): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3881): error C2065: 'TColStd_HArray1OfByte': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3881): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3884): error C2065: 'Message_Algorithm': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3884): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3890): error C2065: 'TColStd_HSequenceOfReal': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3890): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3896): error C2065: 'Message_Alert': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3896): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3902): error C2065: 'Message_Report': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3902): error C2059: syntax error: ')'
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3905): error C2065: 'TColStd_HSequenceOfExtendedString': undeclared identifier
F:\CPP\FooParser\out\build\x64-Release\wrapper\CMakeFiles\_foo_parser.dir\FooParserPYTHON_wrap.cxx(3905): fatal error C1003: error count exceeds 100; stopping compilation
rainman110 commented 4 years ago

Your just missing the includes. You have to include some OCCT header files via

%{
#include<Standard_ErrorHandler.hxx>
#include<Standard_Failure.hxx>
%}

You proably need some more than these.

Dogrtt commented 4 years ago

@rainman110 Thank you. Actually I include and import TopoDS.i inside my *.i file to make it work.