我几乎不懂 C++,但我需要帮助来解决项目构建问题。当我制作项目时,它给了我一个错误,说某些功能是模棱两可的。我清楚地理解它的意思“这意味着有其他版本的函数接受不同的参数或不同数量的参数”。但由于我在 C++ 方面的经验很少,我不知道如何解决它。所以这就是我在这里寻求帮助的原因。
我遇到的错误是:
C:\opencv-build\modules\java\core.cpp:172:65: error: call of overloaded 'PCACompute(cv::Mat&, cv::Mat&, cv::Mat&, jint&)' is ambiguous
C:\opencv-build\modules\java\core.cpp:172:65: note: candidates are:
In file included from c:/opencv-git/modules/java/generator/src/cpp/converters.h:4:0,
from C:\opencv-build\modules\java\core.cpp:8:
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:2383:19: note: void cv::PCACompute(cv::InputArray, cv::InputOutputArray, cv::OutputArray, int)
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:2386:19: note: void cv::PCACompute(cv::InputArray, cv::InputOutputArray, cv::OutputArray, double)
C:\opencv-build\modules\java\core.cpp: In function 'void Java_org_opencv_core_Algorithm_setInt_10(JNIEnv*, jclass, jlong, jstring, jint)':
C:\opencv-build\modules\java\core.cpp:6219:32: error: call of overloaded 'set(std::string&, jint&)' is ambiguous
C:\opencv-build\modules\java\core.cpp:6219:32: note: candidates are:
In file included from c:/opencv-git/modules/java/generator/src/cpp/converters.h:4:0,
from C:\opencv-build\modules\java\core.cpp:8:
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:4328:29: note: void cv::Algorithm::set(const string&, int)
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:4329:32: note: void cv::Algorithm::set(const string&, double)
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:4330:30: note: void cv::Algorithm::set(const string&, bool)
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:4331:32: note: void cv::Algorithm::set(const string&, const string&) <near match>
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:4331:32: note: no known conversion for argument 2 from 'jint {aka long int}' to 'const string& {aka const std::basic_string<char>&}'
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:4332:29: note: void cv::Algorithm::set(const string&, const cv::Mat&) <near match>
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:4332:29: note: no known conversion for argument 2 from 'jint {aka long int}' to 'const cv::Mat&'
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:4334:35: note: void cv::Algorithm::set(const string&, const cv::Ptr<cv::Algorithm>&) <near match>
c:/opencv-git/modules/core/include/opencv2/core/core.hpp:4334:35: note: no known conversion for argument 2 from 'jint {aka long int}' to 'const cv::Ptr<cv::Algorithm>&'
如果您需要更多信息/代码,请告诉我,我会用它更新问题。