OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

vcpkg doesn't install .so or .a files for libmagic C library

  • Thread starter Thread starter Ecko
  • Start date Start date
E

Ecko

Guest
I am attempting to use libmagic in a rust project, using the magic rust crate which provides rust bindings for the libmagic C library. Instructions for Windows say to install libmagic using vcpkg, which is seemingly supposed to bring with it the .so or .a files that the rust binding expects to find. However, my installation seems to have only .c and .h files, causing linker errors when I try to compile. It does contain magic.lib, but the linker can't seem to find that either, even when I properly set the MAGIC_DIR and VCPKG_ROOT environment variables.

Why does my installation not have these compiled libraries? Do I need to compile them myself? If so, how? What do I need to do to get the rust binding working?

Edit: It seems .so and .a are for linux, and .lib are what I should expect to see on Windows. The linker error I get says note: LINK : fatal error LNK1181: cannot open input file 'magic.lib'. I've looked and made sure that magic.lib is in the correct place in the vcpkg installation of libmagic.
<p>I am attempting to use <code>libmagic</code> in a rust project, using the <a href="https://crates.io/crates/magic/0.6.2" rel="nofollow noreferrer">magic rust crate</a> which provides rust bindings for the <code>libmagic</code> C library. Instructions for Windows say to install libmagic using <code>vcpkg</code>, which is seemingly supposed to bring with it the <code>.so</code> or <code>.a</code> files that the rust binding expects to find. However, my installation seems to have only <code>.c</code> and <code>.h</code> files, causing linker errors when I try to compile. It <em>does</em> contain <code>magic.lib</code>, but the linker can't seem to find that either, even when I properly set the <code>MAGIC_DIR</code> and <code>VCPKG_ROOT</code> environment variables.</p>
<p>Why does my installation not have these compiled libraries? Do I need to compile them myself? If so, how? What do I need to do to get the rust binding working?</p>
<p>Edit: It seems <code>.so</code> and <code>.a</code> are for linux, and <code>.lib</code> are what I should expect to see on Windows. The linker error I get says <code>note: LINK : fatal error LNK1181: cannot open input file 'magic.lib'</code>. I've looked and made sure that <code>magic.lib</code> is in the correct place in the vcpkg installation of libmagic.</p>
Continue reading...
 

Latest posts

Top