[cups-devel] [UNKN] STR #4735: Cross compile a program using CUPS library

Ison Thomas noreply at cups.org
Tue Oct 27 22:57:43 PDT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Hi, I am trying to write a C program to detect the printers connected to my
Beaglebone Black and print files. I am developing the application in Ubuntu
using Eclipse. I have cross compiled the cups library to generate libcups.a
and included the library in my project. Also the header files in 'cups'
folder are also added to the project and 'cups.h' is included in my source
code. When I try to read the number of printers added to the system using
'cupsGetDests' function, a lot of dependency errors are showing up. 

dest.c:(.text+0xe): undefined reference to `avahi_simple_poll_quit'
dest.c:(.text+0xd8): undefined reference to `avahi_service_name_join'
dest.c:(.text+0xee): undefined reference to `avahi_record_browser_free'
/home/ison/workspace/Project/lib/libcups.a(dest.o): In function
`cups_dnssd_free_device':
dest.c:(.text+0x140): undefined reference to `avahi_record_browser_free'
/home/ison/workspace/Project/lib/libcups.a(dest.o): In function
`cups_dnssd_browse_cb':
dest.c:(.text+0x31c): undefined reference to `avahi_simple_poll_quit'
/home/ison/workspace/Project/lib/libcups.a(dest.o): In function
`cupsEnumDests':
dest.c:(.text+0x22ba): undefined reference to `avahi_simple_poll_new'
dest.c:(.text+0x22cc): undefined reference to `avahi_simple_poll_set_func'
dest.c:(.text+0x22d2): undefined reference to `avahi_simple_poll_get'
dest.c:(.text+0x22e2): undefined reference to `avahi_client_new'
dest.c:(.text+0x2308): undefined reference to `avahi_service_browser_new'
dest.c:(.text+0x2326): undefined reference to `avahi_service_browser_new'
dest.c:(.text+0x2344): undefined reference to `avahi_simple_poll_iterate'
dest.c:(.text+0x238a): undefined reference to `avahi_record_browser_new'
dest.c:(.text+0x23da): undefined reference to `avahi_service_browser_free'
dest.c:(.text+0x23e0): undefined reference to `avahi_service_browser_free'
dest.c:(.text+0x23e6): undefined reference to `avahi_client_free'
dest.c:(.text+0x23ec): undefined reference to `avahi_simple_poll_free'
/home/ison/workspace/Project/lib/libcups.a(http.o): In function
`httpClose':
http.c:(.text+0x113e): undefined reference to `gss_delete_sec_context'
http.c:(.text+0x1150): undefined reference to `gss_release_name'
/home/ison/workspace/Project/lib/libcups.a(http-support.o): In function
`http_client_cb':
http-support.c:(.text+0xbe): undefined reference to
`avahi_simple_poll_quit'
/home/ison/workspace/Project/lib/libcups.a(http-support.o): In function
`http_resolve_cb':
http-support.c:(.text+0x494): undefined reference to
`avahi_string_list_find'
http-support.c:(.text+0x4a4): undefined reference to
`avahi_string_list_get_pair'
http-support.c:(.text+0x558): undefined reference to
`avahi_service_resolver_free'
http-support.c:(.text+0x5b0): undefined reference to
`avahi_string_list_find'
http-support.c:(.text+0x5de): undefined reference to
`avahi_string_list_find'
http-support.c:(.text+0x5ee): undefined reference to
`avahi_string_list_get_pair'
http-support.c:(.text+0x6f8): undefined reference to
`avahi_simple_poll_quit'
/home/ison/workspace/Project/lib/libcups.a(http-support.o): In function
`_httpResolveURI':
http-support.c:(.text+0x1728): undefined reference to
`avahi_simple_poll_new'
http-support.c:(.text+0x173a): undefined reference to
`avahi_simple_poll_set_func'
http-support.c:(.text+0x1740): undefined reference to
`avahi_simple_poll_get'
http-support.c:(.text+0x1750): undefined reference to `avahi_client_new'
http-support.c:(.text+0x178a): undefined reference to
`avahi_service_resolver_new'
http-support.c:(.text+0x17aa): undefined reference to
`avahi_simple_poll_iterate'
http-support.c:(.text+0x17f8): undefined reference to
`avahi_service_resolver_new'
http-support.c:(.text+0x1804): undefined reference to
`avahi_simple_poll_iterate'
http-support.c:(.text+0x1852): undefined reference to `avahi_client_free'
http-support.c:(.text+0x185c): undefined reference to
`avahi_simple_poll_free'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`http_gnutls_write':
tls.c:(.text+0x10): undefined reference to `gnutls_x509_crt_init'
tls.c:(.text+0x26): undefined reference to `gnutls_x509_crt_import'
tls.c:(.text+0x30): undefined reference to `gnutls_x509_crt_deinit'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`cupsMakeServerCredentials':
tls.c:(.text+0x240): undefined reference to `gnutls_x509_privkey_init'
tls.c:(.text+0x24e): undefined reference to `gnutls_x509_privkey_generate'
tls.c:(.text+0x260): undefined reference to `gnutls_x509_privkey_export'
tls.c:(.text+0x268): undefined reference to `gnutls_strerror'
tls.c:(.text+0x2c0): undefined reference to `gnutls_x509_crt_init'
tls.c:(.text+0x2f0): undefined reference to `gnutls_x509_privkey_deinit'
tls.c:(.text+0x314): undefined reference to `gnutls_x509_crt_set_dn_by_oid'
tls.c:(.text+0x32c): undefined reference to `gnutls_x509_crt_set_dn_by_oid'
tls.c:(.text+0x346): undefined reference to `gnutls_x509_crt_set_dn_by_oid'
tls.c:(.text+0x356): undefined reference to `gnutls_x509_crt_set_dn_by_oid'
tls.c:(.text+0x366): undefined reference to `gnutls_x509_crt_set_dn_by_oid'
/home/ison/workspace/Project/lib/libcups.a(tls.o):tls.c:(.text+0x376): more
undefined references to `gnutls_x509_crt_set_dn_by_oid' follow
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`cupsMakeServerCredentials':
tls.c:(.text+0x37e): undefined reference to `gnutls_x509_crt_set_key'
tls.c:(.text+0x388): undefined reference to `gnutls_x509_crt_set_serial'
tls.c:(.text+0x390): undefined reference to
`gnutls_x509_crt_set_activation_time'
tls.c:(.text+0x39a): undefined reference to
`gnutls_x509_crt_set_expiration_time'
tls.c:(.text+0x3a2): undefined reference to `gnutls_x509_crt_set_ca_status'
tls.c:(.text+0x3b2): undefined reference to
`gnutls_x509_crt_set_subject_alternative_name'
tls.c:(.text+0x3be): undefined reference to
`gnutls_x509_crt_set_key_purpose_oid'
tls.c:(.text+0x3c6): undefined reference to `gnutls_x509_crt_set_key_usage'
tls.c:(.text+0x3ce): undefined reference to `gnutls_x509_crt_set_version'
tls.c:(.text+0x3e0): undefined reference to `gnutls_x509_crt_get_key_id'
tls.c:(.text+0x3ee): undefined reference to
`gnutls_x509_crt_set_subject_key_id'
tls.c:(.text+0x3f8): undefined reference to `gnutls_x509_crt_sign'
tls.c:(.text+0x40a): undefined reference to `gnutls_x509_crt_export'
tls.c:(.text+0x412): undefined reference to `gnutls_strerror'
tls.c:(.text+0x424): undefined reference to `gnutls_x509_crt_deinit'
tls.c:(.text+0x42a): undefined reference to `gnutls_x509_privkey_deinit'
tls.c:(.text+0x454): undefined reference to `gnutls_x509_crt_deinit'
tls.c:(.text+0x45a): undefined reference to `gnutls_x509_privkey_deinit'
tls.c:(.text+0x47a): undefined reference to `gnutls_x509_crt_deinit'
tls.c:(.text+0x480): undefined reference to `gnutls_x509_privkey_deinit'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`httpCopyCredentials':
tls.c:(.text+0x5d4): undefined reference to `gnutls_certificate_get_peers'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`httpCredentialsAreValidForName':
tls.c:(.text+0x61e): undefined reference to
`gnutls_x509_crt_check_hostname'
tls.c:(.text+0x62a): undefined reference to `gnutls_x509_crt_deinit'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`httpCredentialsGetExpiration':
tls.c:(.text+0x646): undefined reference to
`gnutls_x509_crt_get_expiration_time'
tls.c:(.text+0x64e): undefined reference to `gnutls_x509_crt_deinit'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`httpCredentialsString':
tls.c:(.text+0x6a8): undefined reference to `gnutls_x509_crt_get_dn_by_oid'
tls.c:(.text+0x6ca): undefined reference to
`gnutls_x509_crt_get_expiration_time'
tls.c:(.text+0x760): undefined reference to `gnutls_x509_crt_deinit'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`httpCredentialsGetTrust':
tls.c:(.text+0xb7a): undefined reference to
`gnutls_x509_crt_get_activation_time'
tls.c:(.text+0xb86): undefined reference to
`gnutls_x509_crt_get_expiration_time'
tls.c:(.text+0xba2): undefined reference to `gnutls_x509_crt_deinit'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`_httpTLSInitialize':
tls.c:(.text+0xbe0): undefined reference to `gnutls_global_init'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`_httpTLSPending':
tls.c:(.text+0xbea): undefined reference to `gnutls_record_check_pending'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`_httpTLSRead':
tls.c:(.text+0xbf6): undefined reference to `gnutls_record_recv'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`_httpTLSStart':
tls.c:(.text+0xcb2): undefined reference to
`gnutls_certificate_allocate_credentials'
tls.c:(.text+0xcc6): undefined reference to `gnutls_init'
tls.c:(.text+0xcd2): undefined reference to `gnutls_set_default_priority'
tls.c:(.text+0xd42): undefined reference to `gnutls_server_name_set'
tls.c:(.text+0xeb2): undefined reference to
`gnutls_certificate_set_x509_key_file'
tls.c:(.text+0xec2): undefined reference to `gnutls_credentials_set'
tls.c:(.text+0xed6): undefined reference to `gnutls_strerror'
tls.c:(.text+0xee8): undefined reference to `gnutls_deinit'
tls.c:(.text+0xeee): undefined reference to
`gnutls_certificate_free_credentials'
tls.c:(.text+0xf6e): undefined reference to `gnutls_priority_set_direct'
tls.c:(.text+0xf76): undefined reference to `gnutls_transport_set_ptr'
tls.c:(.text+0xf80): undefined reference to
`gnutls_transport_set_pull_function'
tls.c:(.text+0xf8a): undefined reference to
`gnutls_transport_set_push_function'
tls.c:(.text+0xf92): undefined reference to `gnutls_error_is_fatal'
tls.c:(.text+0xfa4): undefined reference to `gnutls_strerror'
tls.c:(.text+0xfb8): undefined reference to `gnutls_deinit'
tls.c:(.text+0xfbe): undefined reference to
`gnutls_certificate_free_credentials'
tls.c:(.text+0xfd4): undefined reference to `gnutls_handshake'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`_httpTLSStop':
tls.c:(.text+0x1082): undefined reference to `gnutls_bye'
tls.c:(.text+0x108e): undefined reference to `gnutls_strerror'
tls.c:(.text+0x10aa): undefined reference to `gnutls_deinit'
tls.c:(.text+0x10b6): undefined reference to
`gnutls_certificate_free_credentials'
/home/ison/workspace/Project/lib/libcups.a(tls.o): In function
`_httpTLSWrite':
tls.c:(.text+0x10cc): undefined reference to `gnutls_record_send'
/home/ison/workspace/Projectt/lib/libcups.a(auth.o):(.text+0xc2): undefined
reference to `gss_import_name'
/home/ison/workspace/Project/lib/libcups.a(auth.o):(.text+0xfc): undefined
reference to `GSS_C_NT_HOSTBASED_SERVICE'
/home/ison/workspace/Project/lib/libcups.a(auth.o): In function
`_cupsSetNegotiateAuthString':
auth.c:(.text+0x136): undefined reference to `gss_delete_sec_context'
auth.c:(.text+0x16a): undefined reference to `gss_init_sec_context'
auth.c:(.text+0x1d6): undefined reference to `gss_release_buffer'
auth.c:(.text+0x1e2): undefined reference to `gss_release_buffer'
collect2: error: ld returned 1 exit status
make: *** [Project]Error 1

How do we use the cups library to generate a c program? In the API
documentation the method for compiling with gcc needs to be performed on
the target board itself, not on a host machine :

gcc -o simple `cups-config --cflags` simple.c `cups-config --libs`

Any help would be appreciated

Link: https://www.cups.org/str.php?L4735
Version: 1.7-current
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJWMGPXAAoJENujp6sI12Ij5gkQAKZpzEYPBMmPaRrdzXwTQNyH
zD0i36iEKJzh8cHAeS9f3hnaAcs/vBkkLCVJDRnzevVq1NxmFiHTKlTJ59E+XyHK
wVBv6ECDsnl+M5ivHG0l1V77KkW+/v31Yu1KSThIULOckLs6w9jDraxRBjcrfdSh
f5tuc2/hqi61Hk++7QkwN+JiBaeuY+ZkYhnWc+ERnIsKE/jShjOolrsX8mHWRFug
mE1UhUYt1rYGMxBMPnsPxT5YVrbm7IKrfPmmLbExkmYVoW8TCh0XoCS2I4dxKj9U
MapJ96SRRzL30pDcNHOP9+JH1Jc9qk+pwqMwE2qWCs58qYprw+av5AofzTyl6Enf
9EHSL3RU6BLyZ2sqanFUQaeLM+h2a3ZehlZLIpi/sn+50zGq6SkQxPZ4D9PxKNhz
2uUmhUe7gtIeualdS/Kxn4dQtXXLxyi90V0wKadRHtSx2VscVluOH2DqGcSdGkiI
MSzn9GoideniT8KJzngfNi1fwvEI3lTIYwJ8E1NKWw2y9Hr189Ed+0LtLq+ZZd2x
dubTS4EXEtDHcvJI6hh1BWgRIJPUCB7AZPPqa3phHwy0wsJHu5pM5nh5m2sBr0t+
KPA28I5EI7Nu4q74qPNP2WUEVUZ0eQw7kymVJwIvmXqVo1HOYdVqLPcQiAbewN8B
f7LcXi/D80ty+mOPbBqq
=Hixi
-----END PGP SIGNATURE-----




More information about the cups mailing list