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

Can't compile with msvc, "cannot open input file 'freetype.lib'" #65

Open
TheZalli opened this issue Apr 2, 2017 · 6 comments
Open

Comments

@TheZalli
Copy link

TheZalli commented Apr 2, 2017

Hi, I've been trying to compile the Kiss3D example program but I can't get past linking the freetype library. I did the config file as suggested in readme and I tried both .lib and .dll binaries, but both give the same error message on the linking stage, " cannot open input file 'freetype.lib' "

Here is the error log (using .dll binaries):

   Compiling freetype-sys v0.4.0
   Compiling freetype-rs v0.9.0
   Compiling kiss3d v0.8.0
   Compiling kiss3d_demo v0.1.0 (file:///C:/Users/mrZalli/Projects/kiss3d_demo)
error: linking with `link.exe` failed: exit code: 1181
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64
\\link.exe" "/LIBPATH:C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\
\lib\\amd64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.1439
3.0\\ucrt\\x64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.1
4393.0\\um\\x64" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\mrZalli\\.rustup\\to
olchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\l
ib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\kiss3d_demo
-56c1a9f95fb658f9.0.o" "/OUT:C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\
debug\\deps\\kiss3d_demo-56c1a9f95fb658f9.exe" "/OPT:REF,NOICF" "/DEBUG" "/LIBPA
TH:C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps" "/LIBPATH:C:\
\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\build\\glfw-sys-79c50ef4a
5edfcd6\\out\\lib" "/LIBPATH:C:\\Program Files (x86)\\Microsoft Visual Studio 14
.0\\VC\\atlmfc\\lib\\amd64" "/LIBPATH:C:\\Users\\mrZalli\\Projects\\kiss3d_demo\
\target\\debug\\build\\miniz-sys-18005000ddedadf4\\out" "/LIBPATH:C:\\Users\\Zal
li\\.cargo\\temp_lib_x86_64\\freetype.dll" "/LIBPATH:C:\\Users\\mrZalli\\Project
s\\kiss3d_demo\\target\\debug\\build\\libz-sys-3f97c24ccab6f5c7\\out/lib" "/LIBP
ATH:C:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\
\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\mrZalli\\Projects\\kiss3d_dem
o\\target\\debug\\deps\\libkiss3d-b001bdb38b073b38.rlib" "C:\\Users\\mrZalli\\Pr
ojects\\kiss3d_demo\\target\\debug\\deps\\libncollide_procedural-1532ba8794339fa
2.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libimag
e-ecef7b195adced54.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\deb
ug\\deps\\libgl-1d6a970e22c31f05.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_dem
o\\target\\debug\\deps\\libncollide_utils-83fca2784d294d5e.rlib" "C:\\Users\\mrZ
alli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libpng-9f834434d073ed8c.rlib"
"C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libbitflags-500
f5f87e6ab8395.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\d
eps\\libflate2-8c506f1983161f68.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo
\\target\\debug\\deps\\libminiz_sys-371886580b0e42eb.rlib" "C:\\Users\\mrZalli\\
Projects\\kiss3d_demo\\target\\debug\\deps\\libncollide_math-a73ce00dabad11e7.rl
ib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libnalgebra
-bbd2ecdde7a16e57.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debu
g\\deps\\libgeneric_array-b5db6f131cc5092f.rlib" "C:\\Users\\mrZalli\\Projects\\
kiss3d_demo\\target\\debug\\deps\\libtypenum-e1a1e7f3e2c882c2.rlib" "C:\\Users\\
mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libalga-5c61eed79552c8fc.rl
ib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libapprox-7
e5b6aca5f24d7b7.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\
\deps\\libbyteorder-35109819e11170bf.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d
_demo\\target\\debug\\deps\\libinflate-a5fe4b3d10215f46.rlib" "C:\\Users\\mrZall
i\\Projects\\kiss3d_demo\\target\\debug\\deps\\libgif-015bb0a9eaa1770e.rlib" "C:
\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libcolor_quant-916
38445defb0073.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\d
eps\\liblzw-3317b9e620d058a9.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\t
arget\\debug\\deps\\libfreetype-60cadb81e49f069d.rlib" "C:\\Users\\mrZalli\\Proj
ects\\kiss3d_demo\\target\\debug\\deps\\libfreetype_sys-90a42c68bc0e7bb4.rlib" "
C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libglfw-df7c22b7
5fdf1e3f.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\
libnum-6ce289b56f32382f.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target
\\debug\\deps\\libnum_rational-0162ef58e267dc13.rlib" "C:\\Users\\mrZalli\\Proje
cts\\kiss3d_demo\\target\\debug\\deps\\libnum_bigint-95c46fa16cd15b9e.rlib" "C:\
\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\librand-c9d9fbdab23
55ee4.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\lib
num_complex-57a11a875ce86980.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\t
arget\\debug\\deps\\librustc_serialize-54d2bf33b1d4b0b0.rlib" "C:\\Users\\mrZall
i\\Projects\\kiss3d_demo\\target\\debug\\deps\\libnum_iter-e3d53b72a44dd492.rlib
" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libnum_intege
r-bbbfaf8dce75e1b6.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\deb
ug\\deps\\libenum_primitive-b8ff90d65ad8e4c3.rlib" "C:\\Users\\mrZalli\\Projects
\\kiss3d_demo\\target\\debug\\deps\\libnum_traits-69f4129d46397118.rlib" "C:\\Us
ers\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libbitflags-c5752d97fe
7cde2b.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\li
blibc-5dc7b85e748840b4.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\
\debug\\deps\\libsemver-f515919a8f1856d4.rlib" "C:\\Users\\mrZalli\\Projects\\ki
ss3d_demo\\target\\debug\\deps\\libnom-c11a5cbc9654b215.rlib" "C:\\Users\\mrZall
i\\Projects\\kiss3d_demo\\target\\debug\\deps\\liblog-d4c0e5c2504fbbea.rlib" "C:
\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustl
ib\\x86_64-pc-windows-msvc\\lib\\libstd-90fbcc8c07b4a644.rlib" "C:\\Users\\mrZal
li\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-
windows-msvc\\lib\\libpanic_unwind-d2e7baf2c0a36eaf.rlib" "C:\\Users\\mrZalli\\.
rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windo
ws-msvc\\lib\\libunwind-112baa0117a60076.rlib" "C:\\Users\\mrZalli\\.rustup\\too
lchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\li
b\\liblibc-ad15457034b2bf37.rlib" "C:\\Users\\mrZalli\\.rustup\\toolchains\\stab
le-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-fa
1852079e0fefd1.rlib" "C:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-
windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcollections-27e4c8cc
19e6faac.rlib" "C:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-window
s-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-588bb0bd8c9dd8ca.rli
b" "C:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\
\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc_system-dbfe715efb71d408.rlib" "C
:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rust
lib\\x86_64-pc-windows-msvc\\lib\\libstd_unicode-a2e15800b52a7a60.rlib" "C:\\Use
rs\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x
86_64-pc-windows-msvc\\lib\\libcore-b2880fdfb9b2b596.rlib" "C:\\Users\\mrZalli\\
.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-wind
ows-msvc\\lib\\libcompiler_builtins-9d27746f5ba8488f.rlib" "freetype.lib" "openg
l32.lib" "gdi32.lib" "advapi32.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "s
hell32.lib" "msvcrt.lib"
  = note: LINK : fatal error LNK1181: cannot open input file 'freetype.lib'


error: aborting due to previous error

error: Could not compile `kiss3d_demo`.

To learn more, run the command again with --verbose.
@haudan
Copy link

haudan commented Jul 17, 2017

Hi @mrZalli!

The error you get is saying that the MSVC linker can't find the freetype lib file.
Is the path in your .cargo/config correct? Does it point to the freetype.lib file?

If it is, your config might not get loaded by cargo or you specified a wrong target. Check out the "overriding build scripts" section in the cargo documentation.

@TheZalli
Copy link
Author

Thanks for the response, though at the time when I tried to build that I was probably using MinGW, so link.exe is not MSVC linker, but MinGW linker. I've now moved to using MSVC on Windows, and I think I should try doing this again and see if the problem persists.

@LaylBongers
Copy link

You were already using MSVC, the MinGW linker isn't called "link.exe" and the path shown by cargo is C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64 \\link.exe

@TheZalli
Copy link
Author

Oh okay didn't notice that path. However when when I typed "where link" in cmd, it pointed to a link.exe in MinGW folders

@abbychau
Copy link

abbychau commented Dec 9, 2017

I am also using MSVC. How can I configure so that I can load freetype.lib?

@fschutt
Copy link

fschutt commented Apr 24, 2018

A different solution would be to use freetype instead of freetype-sys or freetype-rs, because that builds the whole freetype C code when compiling and includes the necessary Rust bindings. The API is more or less the same, but the code is statically linked instead of dynamically. This way it'll work on all platforms, regardless of OS and you don't have to ship a freetype.dll to customers, so it's all in one binary.

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

5 participants