Wednesday, August 9, 2023
HomeiOS Developmentios - Hold getting use of undeclared identifier error when trying to...

ios – Hold getting use of undeclared identifier error when trying to make use of C++ perform in Goal C file


I’ve made a C++ class referred to as ImageDivider meant for picture processing. I’ve additionally made an Goal C wrapper class referred to as ImageDividerWrapper to have the ability to use a perform from this ImageDivider class. Nevertheless, when making an attempt to make use of that perform I preserve working into this error: ‘use of undeclared identifier ‘ImageDivider”.

That is an excerpt of my ImageDivider .cpp code:

#embody "ImageDivider.hpp"
...

int divideImage(const cv::Mat& img, const int blockWidth, const int blockHeight, std::vector<cv::Mat>& blocks)
{...}

That is an excerpt of my ImageDivider .hpp file:

#embody <stdio.h>
#embody <opencv2.core.hpp>
#embody <vector> 

namespace cv { class Mat; } // Ahead declaration for cv::Mat
class ImageDivider {
     public:
          int divideImage(const cv::Mat& img, const int 
           blockWidth, const int blockHeight, std::vector<cv::Mat>& blocks);
};
#endif

Lastly, that is an excerpt from my challenge’s bridging header:

#import "ImageDividerWrapper.h"

In my ImageDividerWrapper class, merely creating an occasion of ImageDivider will get me this error: ‘Use of undeclared identifier ‘ImageDivider”

Once more, ImageDividerWrapper is the ObjectiveC class I made by which I’ve tried to make use of a perform from the C++ class ImageDivider.

With that out of the way in which, I used to be questioning if anybody might level me in the precise path. Apologies upfront concerning the formatting. Stack Overflow would not make it straightforward to stick blocks of code in probably the most readable format.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments