英特尔编译器:警告 #11021:未解决 引用于

Posted

技术标签:

【中文标题】英特尔编译器:警告 #11021:未解决 引用于【英文标题】:Intel Compiler: warning #11021: unresoved Referenced in 【发布时间】:2017-02-14 23:30:14 【问题描述】:

我使用以下 cmake 选项构建了 opencv:

cmake  -G "Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_TBB=OFF -DWITH_OPENMP=ON -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_CXX_FLAGS="-debug inline-debug-info -parallel-source-info=2 -ipo -parallel -xCORE-AVX2 -Bdynamic" ..

但是,当我尝试构建(使用 icpc)使用 opencv(使用 icpc 构建)的应用程序时,会出现以下警告消息:

icpc -shared-intel -L/home/luca/ParallelOpenCV/originalOpenCV/lib -parallel -o "SURFAllInOne"  ./main.o ./surf.o   -lopencv_core -lopencv_xfeatures2d -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs
ipo: warning #11021: unresolved gzeof
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_core.so
ipo: warning #11021: unresolved gzrewind
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_core.so
ipo: warning #11021: unresolved gzopen
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_core.so
ipo: warning #11021: unresolved gzclose
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_core.so
ipo: warning #11021: unresolved gzgets
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_core.so
ipo: warning #11021: unresolved gzputs
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_core.so
ipo: warning #11021: unresolved _ZNK2cv9Feature2D14descriptorSizeEv
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv9Feature2D4readERKNS_8FileNodeE
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZNK2cv9Feature2D14descriptorTypeEv
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv9Feature2D7computeERKNS_11_InputArrayERSt6vectorINS_8KeyPointESaIS5_EERKNS_12_OutputArrayE
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZTTN2cv9Feature2DE
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv15KeyPointsFilter16runByImageBorderERSt6vectorINS_8KeyPointESaIS2_EENS_5Size_IiEEi
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv15KeyPointsFilter10retainBestERSt6vectorINS_8KeyPointESaIS2_EEi
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv9Feature2DD2Ev
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv9Feature2D16detectAndComputeERKNS_11_InputArrayES3_RSt6vectorINS_8KeyPointESaIS5_EERKNS_12_OutputArrayEb
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv15KeyPointsFilter16removeDuplicatedERSt6vectorINS_8KeyPointESaIS2_EE
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv9Feature2D6detectERKNS_11_InputArrayERSt6vectorINS_8KeyPointESaIS5_EES3_
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv9Feature2D6detectERKNS_11_InputArrayERSt6vectorIS4_INS_8KeyPointESaIS5_EESaIS7_EES3_
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZTIN2cv9Feature2DE
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv9Feature2D7computeERKNS_11_InputArrayERSt6vectorIS4_INS_8KeyPointESaIS5_EESaIS7_EERKNS_12_OutputArrayE
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZNK2cv9Feature2D5emptyEv
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZNK2cv9Feature2D11defaultNormEv
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZNK2cv9Feature2D5writeERNS_11FileStorageE
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved _ZN2cv15KeyPointsFilter15runByPixelsMaskERSt6vectorINS_8KeyPointESaIS2_EERKNS_3MatE
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_xfeatures2d.so
ipo: warning #11021: unresolved gtk_file_chooser_set_do_overwrite_confirmation
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_mutex_lock
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_main_iteration
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_resize
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_get_current_time
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_file_chooser_set_current_name
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_type_check_instance_cast
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_destroy
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_fullscreen
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_mutex_unlock
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_box_pack_end
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_get_colormap
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_cond_broadcast
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_box_pack_start
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gdk_cairo_set_source_pixbuf
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_signal_connect_data
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_add_events
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_set_title
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved cairo_paint
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_free
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_dialog_run
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gdk_window_move_resize
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_range_set_range
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_source_remove
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_range_get_type
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_main_iteration_do
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_cond_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_init
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_file_chooser_add_filter
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_range_set_value
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_get_title
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_cond_timed_wait
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_file_filter_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_thread_yield
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_return_if_fail_warning
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_set_geometry_hints
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_set_resizable
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_queue_resize
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_get_events
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_file_chooser_set_filter
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_label_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_dialog_get_type
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_file_filter_add_pattern
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_time_val_add
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_object_get_type
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_box_get_type
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gdk_window_set_user_data
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_move
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_file_chooser_get_type
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_container_get_type
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_type_class_peek
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_get_visual
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_file_chooser_get_filename
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_type_register_static_simple
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_scale_set_draw_value
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_get_window
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_vbox_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_range_get_value
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gdk_cairo_create
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_style_set_background
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_type_check_class_cast
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_thread_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_timeout_add
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_file_filter_set_name
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gdk_window_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_hbox_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_object_unref
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_type_check_instance_is_a
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_events_pending
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_scale_get_type
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_unfullscreen
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_usleep
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_queue_draw
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_thread_self
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_show
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_file_chooser_dialog_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_get_realized
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_hscale_new_with_range
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_container_add
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_cond_wait
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved cairo_destroy
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gdk_pixbuf_new_from_data
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_scale_set_digits
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_window_get_type
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_get_type
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_style_attach
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved g_mutex_new
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved gtk_widget_set_realized
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_highgui.so
ipo: warning #11021: unresolved deflateParams
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved inflate
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved deflateReset
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved inflateInit_
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved deflateInit_
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved inflateReset
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved deflate
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved uncompress
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved deflateEnd
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved compress
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved inflateSync
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so
ipo: warning #11021: unresolved inflateEnd
        Referenced in /home/luca/ParallelOpenCV/originalOpenCV/lib/libopencv_imgcodecs.so

这是什么意思?代码是正确的,但我想知道我是否应该为此烦恼(特别是如果这会使代码变慢,我会谈论它here)

【问题讨论】:

根据我的经验,这些警告肯定会影响性能。如果有这些警告,那么性能是因为你没有指定 -ipo 选项(这只是观察到的,并且没有很好地验证它)。 @warunapww 感谢您的评论。通常如何解决? 【参考方案1】:

当您将它与-ipo (inter procedural optimizations) 标志一起使用时,这似乎在英特尔编译器中已经存在很长时间了。这是一个已知的issue。当您使用的库也与 其他 库一起构建时,问题就会出现。但是我们在构建应用程序时并没有明确列出这些other库。事实上,你不必这样做。但是程序间分析无法找出这些其他库,因此分析失败导致没有产生任何与 -ipo 相关的优化。因此,可能/可实现的性能下降。

解决方法是使用-l 列出应用程序编译命令中(传递地)使用的所有库。

例如,假设我的应用程序需要一个库 A (liba),而 liba 是使用库 B (libb) 和 C (libc) 编译的。

通常在我们的应用程序链接时,我们在命令中指定-lliba。但是使用 -ipo 编译器选项这还不够。您还必须在编译命令中指定-llibb -llibc

查找库: 您可以从您的 make 文件或警告消息开始 即您的警告消息列出以下库:libopencv_core.so, libopencv_xfeatures2d.so, libopencv_highgui.solibopencv_imgcodecs.so

然后为每个库运行ldd libname 这将为您提供libname 库引用的库列表。您必须为找到的所有库递归地运行此命令。可以跳过“libc.so, linux-vdso.so”等系统库...

例如,当我在 papi 库上尝试 ldd 时

ldd libpapi.so
    linux-vdso.so.1 (0x00007ffe7a799000)
    libpfm.so.4 => path to lib/libpfm.so.4 (0x00007fa2fd1c3000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fa2fcd98000)
    /lib64/ld-linux-x86-64.so.2 (0x000056413361c000)

这里,libpfm.so 是有趣的。其余的库是系统库。然后我们在 libpfm.so 上运行 ldd

ldd libpfm.so
    linux-vdso.so.1 (0x00007ffc5df9d000)
    libc.so.6 => /lib64/libc.so.6 (0x00007faf97e74000)
    /lib64/ld-linux-x86-64.so.2 (0x0000561984fdb000)

这只是指系统库,因此我们可以在这里停止我们的算法。

最后是库列表:papi 和 pfm。

【讨论】:

感谢您的回答,但是您看到有多少图书馆了吗?而且我什至不知道我是否有或如何找到它们 我试过你的方法,但警告仍然存在。我用ifort -c -O3 -static -ipo -lhdf5_fortran invmondays.f90 编译,但我得到一个类似于ipo: warning #11021: unresolved H5Dcreate2 Referenced in libhdf5_fortran.a(H5Df.o)的错误列表 @Manfredo 不幸的是,我只用 icc 编译器在 C 程序上测试过这个 @justHelloWorld 只有 4 个不同的库,可以手动完成,也可以使用简单的脚本完成。

以上是关于英特尔编译器:警告 #11021:未解决 引用于的主要内容,如果未能解决你的问题,请参考以下文章

英特尔 C++ 编译器安装程序未找到 Visual Studio

使用 ifort/icc 时未定义对“main”的引用

使用开发安装后,警告对未解决的引用不起作用

ProGuard 警告:对程序类成员有 7 个未解决的引用

从 Proguard 获取“未解决的引用”和“找不到超类”警告

gfortran使用`-dec-math`给`dacosd_`提供未定义的引用