Coder Social home page Coder Social logo

rust-iconv's Introduction

rust-iconv

Build Status

iconv (libiconv) bindings for Rust.

Installation

cargo build

Testing

cargo test

Usage

Refer lib.rs.

rust-iconv's People

Contributors

andelf avatar kenany avatar fatoche avatar

Stargazers

Andrew avatar Jukka Suomela avatar  avatar  avatar guo avatar CossonLeo avatar hbeimf avatar Sean Eshbaugh avatar Jake Scott avatar Damon Zhao avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

rust-iconv's Issues

Fail to link libiconv

Compilation Environment

  1. My dev box is Windows 11

  2. MSYS2 is in the environment variable PATH

  3. mingw-w64-x86_64-libiconv-1.17-3, libiconv, libiconv-devel packages have been installed inside MSYS2.

  4. iconv.exe is visible in the environment variable PATH

    C:\Users\stuar>where iconv
    C:\Users\stuar\AppData\Local\Programs\msys64\usr\bin\iconv.exe

Link Error

error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "C:\\Users\\stuar\\AppData\\Local\\Temp\\rustckLLyZ9\\symbols.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.16vhe53iwxwnjgtf.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.1dum89ywcklgtdui.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.1izun7a3q0fgn5x4.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.1j0r5332f7md81al.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.1j22totbjbxs41i0.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.1jpm77blzfmnp1qt.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.1sv3izc6r2b7tjh8.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.1w3ormwvb9zdupri.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.1xd19f79q7af6p9u.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.223d491kmxgsremp.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.23xa52dpqnnpdk3o.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.29fwa0gozwpmoepx.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.2bw5y8w6zlj27d9q.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.2n5rr8ly1ch32sr0.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.2pfuy288e7wmj83i.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.2qc1cd4tinwwt0k9.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.2xm6wi6029jpjnds.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.2z6484gvlxbr0sdx.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.3ru911xxls9iao6.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.43ktvpuvywbf713n.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.4cwojnmrwww8k2z3.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.4gzr4dx2n9ju0bku.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.4tk0xvkbgan1th7r.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.56us58ybmidkjjyp.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.tax86t8x1qicmco.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.vlipbvvcnm8qp81.rcgu.o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps\\get_host_ip-a03056628cc5c9bd.1jemgxjfxlbpp093.rcgu.o" "-L" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip-target\\debug\\deps" "-L" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "C:\\Users\\stuar\\github_projects\\get-host-ip-target\\debug\\deps\\libiconv-0951d345d2e3e268.rlib" "C:\\Users\\stuar\\github_projects\\get-host-ip-target\\debug\\deps\\libdyn_buf-4a7167169ca00b26.rlib" "C:\\Users\\stuar\\github_projects\\get-host-ip-target\\debug\\deps\\liblibc-3eb59655158ac45f.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-df271db9fa85c4f3.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-772b8abe18b71a88.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libobject-b46b6077a3672b35.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libmemchr-9c4bc59d6f392967.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libaddr2line-a7dc7fc4c6df23d6.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libgimli-b8999d85e01fbb4f.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_demangle-286e47a56d86baa7.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd_detect-ba50636b9ade9874.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libhashbrown-c6afce003ad8dae8.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libminiz_oxide-55a9e902c3a31780.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libadler-335afc73598ccae4.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-5f31de7eadf7a401.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-94b81c39354780fc.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcfg_if-666b4835a96d1b05.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-d832e31700c53506.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-2e45cb49cace01d7.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\librustc_std_workspace_core-043dcb5cef4e65e2.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-0e5c5feeef4bd6da.rlib" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcompiler_builtins-e5852293cd1505c7.rlib" "-Wl,-Bdynamic" "-liconv" "-lkernel32" "-ladvapi32" "-luserenv" "-lkernel32" "-lws2_32" "-lbcrypt" "-lntdll" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "C:\\Users\\stuar\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-o" "C:\\Users\\stuar\\github_projects\\get-host-ip\\../get-host-ip':          C:\Users\stuar\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\iconv-0.1.1/src/lib.rs:158: undefined reference to `iconv_open'
          C:/Users/stuar/AppData/Local/Programs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\stuar\github_projects\get-host-ip-target\debug\deps\libiconv-0951d345d2e3e268.rlib(iconv-0951d345d2e3e268.iconv.965f8533-cgu.2.rcgu.o): in function `iconv::Iconv::reset':
          C:\Users\stuar\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\iconv-0.1.1/src/lib.rs:173: undefined reference to `iconv'
          C:/Users/stuar/AppData/Local/Programs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\stuar\github_projects\get-host-ip-target\debug\deps\libiconv-0951d345d2e3e268.rlib(iconv-0951d345d2e3e268.iconv.965f8533-cgu.2.rcgu.o): in function `iconv::Iconv::convert':
          C:\Users\stuar\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\iconv-0.1.1/src/lib.rs:192: undefined reference to `iconv'
          C:/Users/stuar/AppData/Local/Programs/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\stuar\github_projects\get-host-ip-target\debug\deps\libiconv-0951d345d2e3e268.rlib(iconv-0951d345d2e3e268.iconv.965f8533-cgu.2.rcgu.o): in function `<iconv::Iconv as core::ops::drop::Drop>::drop':
          C:\Users\stuar\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\iconv-0.1.1/src/lib.rs:227: undefined reference to `iconv_close'
          collect2.exe: 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#cargorustc-link-libkindname)

error: could not compile `get-host-ip` (bin "get-host-ip") due to previous error

Question

How can I resolve the problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.