Skip to content

Fix compilation when HAVE_QUIRC is not set.#23892

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
vrabaud:compile_fix
Jul 3, 2023
Merged

Fix compilation when HAVE_QUIRC is not set.#23892
asmorkalov merged 1 commit intoopencv:4.xfrom
vrabaud:compile_fix

Conversation

@vrabaud
Copy link
Copy Markdown
Contributor

@vrabaud vrabaud commented Jun 29, 2023

One variable is unknown while the other one is unused.

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 Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch

@vrabaud vrabaud requested a review from asmorkalov June 29, 2023 14:23
@asmorkalov
Copy link
Copy Markdown
Contributor

Without QUIRC:

In file included from /home/alexander/Projects/OpenCV/opencv-master/modules/objdetect/test/test_qrcode.cpp:6:0:
/home/alexander/Projects/OpenCV/opencv-master/modules/objdetect/test/test_qr_utils.hpp: In function ‘void opencv_test::check_qr(const string&, const string&, const string&, const std::vector<cv::Point_<int> >&, const std::vector<std::__cxx11::basic_string<char> >&, int, bool)’:
/home/alexander/Projects/OpenCV/opencv-master/modules/objdetect/test/test_qr_utils.hpp:11:44: warning: unused parameter ‘decoded_info’ [-Wunused-parameter]
                 const std::vector<string>& decoded_info, const int max_pixel_error,
                                            ^~~~~~~~~~~~

@vrabaud
Copy link
Copy Markdown
Contributor Author

vrabaud commented Jun 30, 2023

I do get an error though for the first decoded_info:

modules/objdetect/test/test_qrcode.cpp:389:68: error: use of undeclared identifier 'decoded_info'
  389 |     check_qr(root, name_current_image, "multiple_images", corners, decoded_info, pixels_error, true);
      |                                                                    ^
modules/objdetect/test/test_qrcode.cpp:541:28: error: unused variable 'expect_msg' [-Werror,-Wunused-variable]
  541 |         const std::string &expect_msg = flipped_image.second;

(line numbers are slightly off due to modify includes for internal code)

One variable is unknown while the other one is unused.
Fixed build warnings.
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

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

👍

@asmorkalov
Copy link
Copy Markdown
Contributor

@vrabaud Thanks a lot for the fix! I updated solution a bit and fixed build warning.

@asmorkalov asmorkalov merged commit 377be68 into opencv:4.x Jul 3, 2023
@vrabaud vrabaud deleted the compile_fix branch July 20, 2023 13:26
@asmorkalov asmorkalov mentioned this pull request Jul 27, 2023
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.

2 participants