Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile statically #41

Closed
p4vook opened this issue Aug 21, 2020 · 6 comments
Closed

Does not compile statically #41

p4vook opened this issue Aug 21, 2020 · 6 comments

Comments

@p4vook
Copy link
Contributor

p4vook commented Aug 21, 2020

When I try to build a static binary for echobot, linker fails with a lot of "undefined reference to symbol (libcurl, libjsonc functions)" errors.

@smartnode
Copy link
Owner

describe your problem more. how are you trying to build echobot ?

@p4vook
Copy link
Contributor Author

p4vook commented Aug 28, 2020

gcc -static test/echobot.c -Iinclude libtelebot_static.a

@p4vook
Copy link
Contributor Author

p4vook commented Aug 28, 2020

/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libtelebot_static.a(telebot.c.o): in function `telebot_get_updates':
telebot.c:(.text+0x272): undefined reference to `json_object_new_array'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x2bd): undefined reference to `json_object_new_string'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x2cf): undefined reference to `json_object_array_add'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x2ea): undefined reference to `json_object_to_json_string'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x383): undefined reference to `json_object_put'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x39e): undefined reference to `json_object_put'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x3e0): undefined reference to `json_object_object_get_ex'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x3f0): undefined reference to `json_object_get_boolean'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x41f): undefined reference to `json_object_object_get_ex'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x4d1): undefined reference to `json_object_put'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libtelebot_static.a(telebot.c.o): in function `telebot_get_me':
telebot.c:(.text+0x738): undefined reference to `json_object_object_get_ex'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x748): undefined reference to `json_object_get_boolean'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x774): undefined reference to `json_object_object_get_ex'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0x7bc): undefined reference to `json_object_put'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: libtelebot_static.a(telebot.c.o): in function `telebot_get_webhook_info':
telebot.c:(.text+0xb7c): undefined reference to `json_object_object_get_ex'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: telebot.c:(.text+0xb8c): undefined reference to `json_object_get_boolean'

And there are about 150 such errors

@p4vook
Copy link
Contributor Author

p4vook commented Aug 30, 2020

Any updates on this?

@smartnode
Copy link
Owner

You need static versions of libcurl and json-c for that.

@p4vook
Copy link
Contributor Author

p4vook commented Aug 30, 2020 via email

@p4vook p4vook closed this as completed Aug 30, 2020
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

No branches or pull requests

2 participants