Problem with substitution - #2
Conversation
| #include <opencv2/gapi/own/types.hpp> // cv::gapi::own::Rect/Size/Point | ||
| #include <opencv2/gapi/own/scalar.hpp> // cv::gapi::own::Scalar | ||
|
|
||
| #include <opencv2/gapi/gmat.hpp> // call opencv_includes.hpp, that call cvdefs.hpp, that call gmat.hpp, ... |
There was a problem hiding this comment.
It is first way with include<gmat.hpp> for descr_of function.
| // GMatDesc descr_of(const Mat &mat); // another way: error-> conflicts with a previous declaration in gmat.hpp | ||
| }} // namespace gapi::own | ||
|
|
||
| using gapi::own::descr_of; // with include gmat.hpp it has not been declared |
There was a problem hiding this comment.
We get error ‘fluidcv::gapi::own::descr_of’ has not been declared
| #define OPENCV_GAPI_OPENCV_INCLUDES_HPP | ||
|
|
||
| #if !defined(GAPI_STANDALONE) | ||
| #if !defined(GAPI_STANDALONE) // |
There was a problem hiding this comment.
opencv_includes.hpp - fork for include files.
| // replacement of cv's structures: | ||
| namespace gapi { namespace own { | ||
| class Mat; | ||
| // GMatDesc descr_of(const Mat &mat); // another way: error-> conflicts with a previous declaration in gmat.hpp |
There was a problem hiding this comment.
Another way - we don't include gmat.hpp. We put a function prototype.
cv::gapi::own::descr_of(const gapi::own::Mat &)
| #endif // !defined(GAPI_STANDALONE) | ||
|
|
||
| GAPI_EXPORTS GMatDesc descr_of(const cv::Mat &mat); | ||
| GAPI_EXPORTS GMatDesc descr_of(const cv::Mat &mat); //another way: previous declaration |
There was a problem hiding this comment.
And we get error: conflicts with a previous declaration (212 str.).
We include opencv_includes.hpp (cvdefs.hpp in STANDALONE) in gmat.hpp.
cvdefs.hpp: cv::gapi::own::descr_of(const gapi::own::Mat &)
gmat.hpp: cv::descr_of(const gapi::own::Mat &)
It is logical, but i can't put declaration of function under STANDALONE flag in cvdefs.
|
@anton-potapov Two ways (in comment) with bad end. I can't unravel it. It is for STANDALONE build (cv::Mat == own::Mat and etc.) |
|
@mpashchenkov , please see here opencv#17268 |
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.