error: linking with `link.exe` failed: exit code: 1181; cannot open input file 'flutter_engine.lib'
I tried build and run the example on Windows environmennt, but it was failed. Repro and errors is below:
Repro
- Install the flutter sdk ( git clone and append the bin dir to the PATH )
cargo install cargo-fluttergit clone https://github.com/flutter-rs/flutter-app-templatecd flutter-app-templatecargo flutter run
Then, I got the error in the below:
flutter build bundle lib/main.dart
Compiling flutter-app-template v0.1.0 (C:\Users\usagi\tmp\flutter-app-template)
error: linking with `link.exe` failed: exit code: 1181
|
= note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\usagi\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" ( ... very long list ... ) "ws2_32.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
= note: LINK : fatal error LNK1181: cannot open input file 'flutter_engine.lib'
I was search the flutter_engine.lib in the target directory and flutter sdk directory, but the file is not found.
Could you copy the output of flutter --version?
I haven't tested windows in a while, however it did at least build.
@csnewman
PS C:\Users\usagi\tmp\flutter-app-template> flutter --version
Flutter 1.12.13+hotfix.8 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 0b8abb4724 (4 weeks ago) • 2020-02-11 11:44:36 -0800
Engine • revision e1e6ced81d
Tools • Dart 2.7.0
Thank you supporting. I'm newbie about flutter but I want solve the situation.
Yep, same error, flutter-engine\[SHA1]\x86_64-pc-windows-msvc\debug_unopt isn't in LIBPATH so it doesn't find it. I'm using the latest version that has a Windows build
Flutter 1.15.3-pre.34 • channel unknown • unknown source
Framework • revision b40cb088d4 (9 weeks ago) • 2020-02-07 19:55:04 -0500
Engine • revision 6158f03ef5
Tools • Dart 2.8.0 (build 2.8.0-dev.8.0 514a8d4c84)
I have encountered this error as well.
Download and install the Build Tools for Visual Studio 2019. During installation select the C++ tools. It will download almost 5GB of data. Then restart the machine after installation and compiling the code will work fine.