简体   繁体   English

Raspberry PI 2未定义引用

[英]Raspberry PI 2 undefined reference to

I have a new RasPi 2, I've installed latest version of Raspbian and all the libraries that I need to compile a project that I'm working on. 我有一个新的RasPi 2,已经安装了最新版本的Raspbian以及编译我正在处理的项目所需的所有库。 The libraries were installed from repositories after a "sudo apt-get update" so they should be the latest version. 库是在“ sudo apt-get更新”之后从存储库安装的,因此它们应该是最新版本。

The compiling of the project works fine, but on linking I get the following errors: 该项目的编译工作正常,但是在链接时出现以下错误:

/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'

What could be the problem and how can I fix this? 可能是什么问题,我该如何解决?

Thank you! 谢谢!

I've got the same error, but the problem was solved by reading libglib-2.0.so. 我遇到了同样的错误,但是通过阅读libglib-2.0.so解决了该问题。
Because the undefined references shown in your post should be contained in /lib/arm-linux-gnueabihf/libglib-2.0.so, the project must read that library. 由于帖子中显示的未定义引用应包含在/lib/arm-linux-gnueabihf/libglib-2.0.so中,因此项目必须读取该库。
It may be a good idea to check the library path or library search path. 检查库路径或库搜索路径可能是一个好主意。
Sorry for my poor English. 对不起,我的英语不好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM