gpt4 book ai didi

c++ - Raspberry PI 2 未定义引用

转载 作者:行者123 更新时间:2023-11-28 06:22:17 25 4
gpt4 key购买 nike

我有一个新的 RasPi 2,我已经安装了最新版本的 Raspbian 以及编译我正在处理的项目所需的所有库。这些库是在“sudo apt-get update”之后从存储库安装的,因此它们应该是最新版本。

项目的编译工作正常,但在链接时出现以下错误:

/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgobject-2.0.so: undefined reference to `g_markup_parse_context_ref'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_variant_new_take_string'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgobject-2.0.so: undefined reference to `g_datalist_id_replace_data'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_spawn_check_exit_status'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgtk-3.so: undefined reference to `g_slist_copy_deep'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgobject-2.0.so: undefined reference to `g_unix_signal_funcs'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgobject-2.0.so: undefined reference to `g_variant_dict_unref'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_hash_table_get_keys_as_array'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_variant_dict_end'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_source_query_unix_fd'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgobject-2.0.so: undefined reference to `g_datalist_id_dup_data'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgobject-2.0.so: undefined reference to `g_unix_fd_source_funcs'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_str_tokenize_and_fold'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_variant_new_from_bytes'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_variant_check_format_string'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_list_copy_deep'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_variant_get_data_as_bytes'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgobject-2.0.so: undefined reference to `g_variant_dict_ref'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_source_add_unix_fd'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_close'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_variant_dict_new'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_variant_dict_insert_value'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_option_context_parse_strv'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_unix_fd_source_new'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgtk-3.so: undefined reference to `g_variant_parse_error_quark'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgobject-2.0.so: undefined reference to `g_markup_parse_context_unref'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_source_get_ready_time'
/home/andrei/rpi/usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0: undefined reference to `g_source_set_ready_time'

可能是什么问题,我该如何解决?

谢谢!

最佳答案

我也遇到了同样的错误,但是通过阅读 libglib-2.0.so 解决了问题。
因为您帖子中显示的 undefined reference 应包含在/lib/arm-linux-gnueabihf/libglib-2.0.so 中,所以项目必须读取该库。
检查库路径或库搜索路径可能是个好主意。
抱歉我的英语不好。

关于c++ - Raspberry PI 2 未定义引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29125081/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com