Skip to content

cargo build and run fail on Ubuntu 24.04 #141

@capbussat

Description

@capbussat

I can not compile. definetely I am missing something.

i have installed libraries:

sudo apt install libpcap-dev libpseccomp-dev

libpcap-dev/noble,now 1.10.4-4.1ubuntu3 amd64 [instal·lat]
libseccomp-dev/noble-updates,now 2.5.5-1ubuntu3.1 amd64 [instal·lat]

I have done install

cargo install sniffglue

cargo run
Compiling sniffglue v0.16.1 (/home/ignasi/projects/sniffglue)
error: linking with cc failed: exit status: 1
|
= note: "cc" "-m64" "/tmp/rustcUNHzvt/symbols.o" "<194 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/home/ignasi/projects/sniffglue/target/debug/deps/{libnum_cpus-52eba5699f6b77ec.rlib,libsniffglue-c70d488dd12cfe98.rlib,libpcap_sys-efc0ac4d8007ac11.rlib,libuzers-b41cb71d357b1cf5.rlib,libtoml-4e56a684a41e15d9.rlib,libtoml_edit-da4cb565701e98c6.rlib,libserde_spanned-17a8d006aa2b9e2d.rlib,libindexmap-bd7252aac81b6cd0.rlib,libequivalent-c023e0d1858813b2.rlib,libhashbrown-0201ac25f90c611f.rlib,libwinnow-3fb43e97b8c79f51.rlib,libtoml_datetime-0662593aa6a5253e.rlib,libdirs_next-b6352018df9c7030.rlib,libdirs_sys_next-3922830f6e25f7bf.rlib,libserde_json-ecdccf03977c79ce.rlib,libitoa-c29cc2c4fc661d63.rlib,libryu-2c7aac04ef501401.rlib,libdns_parser-e558421aaa3e94e4.rlib,libquick_error-5431cbc53e6855e5.rlib,libbyteorder-bf74668de8f2b493.rlib,libdata_encoding-90cf89c204a72bc3.rlib,libsyscallz-32e072b9f70f2f86.rlib,libstrum-11fd22df841d070e.rlib,libseccomp_sys-4a59094a62f5731d.rlib,libnix-f59c18e03cd54253.rlib,libbitflags-33c55abde0680bbd.rlib,liblibc-7b5825b9b40f7a73.rlib,libanyhow-8b19223da87e27f6.rlib,libtls_parser-c4a9e31fb7ef3307.rlib,libphf-86debfe1d62b1657.rlib,libphf_shared-c983fa02a6af97a4.rlib,libsiphasher-bbcb89d2f79153d5.rlib,libnum_enum-76c7a908c75c6aa3.rlib,librusticata_macros-9b6ef7d0e50d3e9b.rlib,libnom_derive-24c75c10bd1d876a.rlib,libhttparse-6c40b506936842a3.rlib,libdhcp4r-7a06961701ed98a9.rlib,libnum_traits-3c378ec8fad1be43.rlib,libenv_logger-1eb514f64f87c325.rlib,libenv_filter-572fcaff2a174400.rlib,libregex-5b1ee0d399aa9077.rlib,libhumantime-31e9621ea10f3d9b.rlib,liblog-7767adb8c1fd9340.rlib,libpktparse-c2f876a38d45ffc8.rlib,libnom-145c7567cc3f4c6c.rlib,libsha2-15ec923db0277716.rlib,libcpufeatures-04896330a3465715.rlib,libcfg_if-b087bd99f0862e5b.rlib,libdigest-de1e3ebffee21730.rlib,libblock_buffer-986584b30278d50f.rlib,libcrypto_common-0820232bd4677d58.rlib,libgeneric_array-6056244fa1cf5d5d.rlib,libtypenum-d695e4d7688bb16a.rlib,libbstr-2355f47c3555828f.rlib,libregex_automata-9a837072cb607a2c.rlib,libaho_corasick-e4a6b11b2d06cfd5.rlib,libregex_syntax-f8a6c73edb1a98d7.rlib,libserde-f28b4e938f2efd94.rlib,libmemchr-447a020e6896941b.rlib,libansi_term-4f3986107ebfc15b.rlib,libclap_complete-cc57d888233b36d0.rlib,libclap-73717b55cff552f4.rlib,libclap_builder-058f0e75b55cc919.rlib,libstrsim-3b0fa6e308fe0622.rlib,libanstream-524af9fa4ebb9b13.rlib,libanstyle_query-1eab6fd71a3bcd97.rlib,libis_terminal_polyfill-7d718f6749259ff4.rlib,libcolorchoice-c18a80c0fb5c73bb.rlib,libanstyle_parse-cb6bdf084c90f205.rlib,libutf8parse-75fd3e3bf68fb945.rlib,libclap_lex-2e5ea068d115b792.rlib,libanstyle-1ddf4eee07f7dee3.rlib}.rlib" "/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-,libpanic_unwind-,libobject-,libmemchr-,libaddr2line-,libgimli-,librustc_demangle-,libstd_detect-,libhashbrown-,librustc_std_workspace_alloc-,libminiz_oxide-,libadler2-,libunwind-,libcfg_if-,liblibc-,liballoc-,librustc_std_workspace_core-,libcore-,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lseccomp" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcUNHzvt/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/lib" "-L" "/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/ignasi/projects/sniffglue/target/debug/deps/sniffglue-47b5060165cd0847" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
= note: some arguments are omitted. use --verbose to show all linker arguments
= note: /usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::open': /home/ignasi/projects/sniffglue/src/sniff.rs:17:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x1d2): undefined reference to pcap_create'
/usr/bin/ld: /home/ignasi/projects/sniffglue/src/sniff.rs:25:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x258): undefined reference to pcap_set_promisc' /usr/bin/ld: /home/ignasi/projects/sniffglue/src/sniff.rs:32:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x265): undefined reference to pcap_activate'
/usr/bin/ld: /home/ignasi/projects/sniffglue/src/sniff.rs:29:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x283): undefined reference to pcap_set_immediate_mode' /usr/bin/ld: /home/ignasi/projects/sniffglue/src/sniff.rs:34:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x2ba): undefined reference to pcap_geterr'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::open_file': /home/ignasi/projects/sniffglue/src/sniff.rs:47:(.text._ZN9sniffglue5sniff9open_file17h2f36efecd1ddcac8E+0x1b3): undefined reference to pcap_open_offline'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::default_interface': /home/ignasi/projects/sniffglue/src/sniff.rs:62:(.text._ZN9sniffglue5sniff17default_interface17h0617d8f5c98219e1E+0x41): undefined reference to pcap_lookupdev'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::Cap::datalink': /home/ignasi/projects/sniffglue/src/sniff.rs:74:(.text._ZN9sniffglue5sniff3Cap8datalink17h4f533c96c86f86dfE+0xa): undefined reference to pcap_datalink'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::Cap::next_pkt': /home/ignasi/projects/sniffglue/src/sniff.rs:83:(.text._ZN9sniffglue5sniff3Cap8next_pkt17hc3daa6a9c7706856E+0x5c): undefined reference to pcap_next_ex'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.7lhr9pwwj68wscpmq3lhzl4dw.1td0uaa.rcgu.o): in function <sniffglue::sniff::Cap as core::ops::drop::Drop>::drop': /home/ignasi/projects/sniffglue/src/sniff.rs:106:(.text._ZN63_$LT$sniffglue..sniff..Cap$u20$as$u20$core..ops..drop..Drop$GT$4drop17hba9ee928234969a6E+0xa): undefined reference to pcap_close'
collect2: error: ld returned 1 exit status

= note: some extern functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the -l flag to specify native libraries to link
= note: use the cargo:rustc-link-lib directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile sniffglue (bin "sniffglue") due to 1 previous error
ignasi@ns:~/projects/sniffglue$ cargo build > dump.txt
Compiling sniffglue v0.16.1 (/home/ignasi/projects/sniffglue)
error: linking with cc failed: exit status: 1
|
= note: "cc" "-m64" "/tmp/rustcQfG5De/symbols.o" "<194 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/home/ignasi/projects/sniffglue/target/debug/deps/{libnum_cpus-52eba5699f6b77ec.rlib,libsniffglue-c70d488dd12cfe98.rlib,libpcap_sys-efc0ac4d8007ac11.rlib,libuzers-b41cb71d357b1cf5.rlib,libtoml-4e56a684a41e15d9.rlib,libtoml_edit-da4cb565701e98c6.rlib,libserde_spanned-17a8d006aa2b9e2d.rlib,libindexmap-bd7252aac81b6cd0.rlib,libequivalent-c023e0d1858813b2.rlib,libhashbrown-0201ac25f90c611f.rlib,libwinnow-3fb43e97b8c79f51.rlib,libtoml_datetime-0662593aa6a5253e.rlib,libdirs_next-b6352018df9c7030.rlib,libdirs_sys_next-3922830f6e25f7bf.rlib,libserde_json-ecdccf03977c79ce.rlib,libitoa-c29cc2c4fc661d63.rlib,libryu-2c7aac04ef501401.rlib,libdns_parser-e558421aaa3e94e4.rlib,libquick_error-5431cbc53e6855e5.rlib,libbyteorder-bf74668de8f2b493.rlib,libdata_encoding-90cf89c204a72bc3.rlib,libsyscallz-32e072b9f70f2f86.rlib,libstrum-11fd22df841d070e.rlib,libseccomp_sys-4a59094a62f5731d.rlib,libnix-f59c18e03cd54253.rlib,libbitflags-33c55abde0680bbd.rlib,liblibc-7b5825b9b40f7a73.rlib,libanyhow-8b19223da87e27f6.rlib,libtls_parser-c4a9e31fb7ef3307.rlib,libphf-86debfe1d62b1657.rlib,libphf_shared-c983fa02a6af97a4.rlib,libsiphasher-bbcb89d2f79153d5.rlib,libnum_enum-76c7a908c75c6aa3.rlib,librusticata_macros-9b6ef7d0e50d3e9b.rlib,libnom_derive-24c75c10bd1d876a.rlib,libhttparse-6c40b506936842a3.rlib,libdhcp4r-7a06961701ed98a9.rlib,libnum_traits-3c378ec8fad1be43.rlib,libenv_logger-1eb514f64f87c325.rlib,libenv_filter-572fcaff2a174400.rlib,libregex-5b1ee0d399aa9077.rlib,libhumantime-31e9621ea10f3d9b.rlib,liblog-7767adb8c1fd9340.rlib,libpktparse-c2f876a38d45ffc8.rlib,libnom-145c7567cc3f4c6c.rlib,libsha2-15ec923db0277716.rlib,libcpufeatures-04896330a3465715.rlib,libcfg_if-b087bd99f0862e5b.rlib,libdigest-de1e3ebffee21730.rlib,libblock_buffer-986584b30278d50f.rlib,libcrypto_common-0820232bd4677d58.rlib,libgeneric_array-6056244fa1cf5d5d.rlib,libtypenum-d695e4d7688bb16a.rlib,libbstr-2355f47c3555828f.rlib,libregex_automata-9a837072cb607a2c.rlib,libaho_corasick-e4a6b11b2d06cfd5.rlib,libregex_syntax-f8a6c73edb1a98d7.rlib,libserde-f28b4e938f2efd94.rlib,libmemchr-447a020e6896941b.rlib,libansi_term-4f3986107ebfc15b.rlib,libclap_complete-cc57d888233b36d0.rlib,libclap-73717b55cff552f4.rlib,libclap_builder-058f0e75b55cc919.rlib,libstrsim-3b0fa6e308fe0622.rlib,libanstream-524af9fa4ebb9b13.rlib,libanstyle_query-1eab6fd71a3bcd97.rlib,libis_terminal_polyfill-7d718f6749259ff4.rlib,libcolorchoice-c18a80c0fb5c73bb.rlib,libanstyle_parse-cb6bdf084c90f205.rlib,libutf8parse-75fd3e3bf68fb945.rlib,libclap_lex-2e5ea068d115b792.rlib,libanstyle-1ddf4eee07f7dee3.rlib}.rlib" "/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-,libpanic_unwind-,libobject-,libmemchr-,libaddr2line-,libgimli-,librustc_demangle-,libstd_detect-,libhashbrown-,librustc_std_workspace_alloc-,libminiz_oxide-,libadler2-,libunwind-,libcfg_if-,liblibc-,liballoc-,librustc_std_workspace_core-,libcore-,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lseccomp" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcQfG5De/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/usr/lib" "-L" "/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/ignasi/projects/sniffglue/target/debug/deps/sniffglue-47b5060165cd0847" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
= note: some arguments are omitted. use --verbose to show all linker arguments
= note: /usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::open': /home/ignasi/projects/sniffglue/src/sniff.rs:17:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x1d2): undefined reference to pcap_create'
/usr/bin/ld: /home/ignasi/projects/sniffglue/src/sniff.rs:25:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x258): undefined reference to pcap_set_promisc' /usr/bin/ld: /home/ignasi/projects/sniffglue/src/sniff.rs:32:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x265): undefined reference to pcap_activate'
/usr/bin/ld: /home/ignasi/projects/sniffglue/src/sniff.rs:29:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x283): undefined reference to pcap_set_immediate_mode' /usr/bin/ld: /home/ignasi/projects/sniffglue/src/sniff.rs:34:(.text._ZN9sniffglue5sniff4open17h36cc1ca6f46dc277E+0x2ba): undefined reference to pcap_geterr'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::open_file': /home/ignasi/projects/sniffglue/src/sniff.rs:47:(.text._ZN9sniffglue5sniff9open_file17h2f36efecd1ddcac8E+0x1b3): undefined reference to pcap_open_offline'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::default_interface': /home/ignasi/projects/sniffglue/src/sniff.rs:62:(.text._ZN9sniffglue5sniff17default_interface17h0617d8f5c98219e1E+0x41): undefined reference to pcap_lookupdev'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::Cap::datalink': /home/ignasi/projects/sniffglue/src/sniff.rs:74:(.text._ZN9sniffglue5sniff3Cap8datalink17h4f533c96c86f86dfE+0xa): undefined reference to pcap_datalink'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.3g61fo16syqtyywnfdgykobd9.1td0uaa.rcgu.o): in function sniffglue::sniff::Cap::next_pkt': /home/ignasi/projects/sniffglue/src/sniff.rs:83:(.text._ZN9sniffglue5sniff3Cap8next_pkt17hc3daa6a9c7706856E+0x5c): undefined reference to pcap_next_ex'
/usr/bin/ld: /home/ignasi/projects/sniffglue/target/debug/deps/libsniffglue-c70d488dd12cfe98.rlib(sniffglue-c70d488dd12cfe98.7lhr9pwwj68wscpmq3lhzl4dw.1td0uaa.rcgu.o): in function <sniffglue::sniff::Cap as core::ops::drop::Drop>::drop': /home/ignasi/projects/sniffglue/src/sniff.rs:106:(.text._ZN63_$LT$sniffglue..sniff..Cap$u20$as$u20$core..ops..drop..Drop$GT$4drop17hba9ee928234969a6E+0xa): undefined reference to pcap_close'
collect2: error: ld returned 1 exit status

= note: some extern functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the -l flag to specify native libraries to link
= note: use the cargo:rustc-link-lib directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

error: could not compile sniffglue (bin "sniffglue") due to 1 previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions