hybridgroup / gocv

Go package for computer vision using OpenCV 4 and beyond. Includes support for DNN, CUDA, and OpenCV Contrib.
https://gocv.io
Other
6.42k stars 853 forks source link

building a static binary Lost Quirc #1179

Open shixiawuheng opened 1 week ago

shixiawuheng commented 1 week ago

command-line-arguments

C:\go\pkg\tool\windows_amd64\link.exe: running g++ failed: exit status 1 C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lquirc collect2.exe: error: ld returned 1 exit status

While attempting static compilation, I encountered an error and don't understand why Quirc is required.

shixiawuheng commented 5 days ago

I even tried to compile in the gocv/opencv: 4.10.0 static Docker image, but it didn't work

command-line-arguments

/usr/local/go/pkg/tool/linux_amd64/link: running g++ failed: exit status 1 /usr/bin/ld: cannot find -lquirc collect2: error: ld returned 1 exit status

shixiawuheng commented 5 days ago

It was introduced in cgo_static.go, not the library introduced in my project

shixiawuheng commented 5 days ago

I don't understand why others haven't experienced this situation

shixiawuheng commented 5 days ago

After completing the Quirc compilation /usr/bin/ld: /usr/local/lib/libopencv_highgui.a(window_gtk.cpp.o): in function cvImageWidget_class_init(void*, void*)': window_gtk.cpp:(.text._ZL24cvImageWidget_class_initPvS_+0xa): undefined reference togtk_widget_get_type' /usr/bin/ld: window_gtk.cpp:(.text._ZL24cvImageWidget_classinitPvS+0x15): undefined reference to g_type_class_peek' /usr/bin/ld: window_gtk.cpp:(.text._ZL24cvImageWidget_class_initPvS_+0x20): undefined reference tog_type_check_class_cast' /usr/bin/ld: /usr/local/lib/libopencv_highgui.a(window_gtk.cpp.o): in function icvOnTrackbar(_GtkWidget*, void*)': window_gtk.cpp:(.text._ZL13icvOnTrackbarP10_GtkWidgetPv+0xd): undefined reference togtk_range_get_type' /usr/bin/ld: window_gtk.cpp:(.text._ZL13icvOnTrackbarP10_GtkWidgetPv+0x18): undefined reference to g_type_check_instance_cast' /usr/bin/ld: window_gtk.cpp:(.text._ZL13icvOnTrackbarP10_GtkWidgetPv+0x20): undefined reference togtk_range_get_value' /usr/bin/ld: /usr/local/lib/libopencv_highgui.a(window_gtk.cpp.o): in function icvWindowThreadLoop(void*)': window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x1b): undefined reference togtk_main_iteration_do' /usr/bin/ld: window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x2d): undefined reference to g_usleep' /usr/bin/ld: window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x32): undefined reference tog_thread_yield' /usr/bin/ld: window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x63): undefined reference to gtk_main_iteration_do' /usr/bin/ld: window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x6d): undefined reference tog_usleep' /usr/bin/ld: window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x72): undefined reference to g_thread_yield' /usr/bin/ld: /usr/local/lib/libopencv_highgui.a(window_gtk.cpp.o): in functioncvImageWidgetSetImage(_CvImageWidget, void const)': window_gtk.cpp:(.text._ZL21cvImageWidgetSetImageP14_CvImageWidgetPKv+0x11d): undefined reference to `gtk_widget_get_type'

shixiawuheng commented 3 days ago

Why do I still have dynamic library links after going through countless hardships and finally compiling them linux-vdso.so.1 (0x00007ffed1bf2000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x0000745ece701000) libjpeg.so.8 => /lib/x86_64-linux-gnu/libjpeg.so.8 (0x0000745ece67e000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x0000745ece400000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x0000745ece317000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x0000745ece2ea000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000745ece000000) /lib64/ld-linux-x86-64.so.2 (0x0000745ece72d000)

shixiawuheng commented 3 days ago

Why do I still have dynamic library links after going through countless hardships and finally compiling them linux-vdso.so.1 (0x00007ffed1bf2000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x0000745ece701000) libjpeg.so.8 => /lib/x86_64-linux-gnu/libjpeg.so.8 (0x0000745ece67e000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x0000745ece400000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x0000745ece317000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x0000745ece2ea000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000745ece000000) /lib64/ld-linux-x86-64.so.2 (0x0000745ece72d000)