Skip to content

Conversation

@mpashchenkov
Copy link
Owner

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under OpenCV (BSD) License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

#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, ...
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) //
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner Author

@mpashchenkov mpashchenkov May 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@mpashchenkov
Copy link
Owner Author

@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.)

@anton-potapov
Copy link

@mpashchenkov , please see here opencv#17268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants