ArthurSonzogni / FTXUI

:computer: C++ Functional Terminal User Interface. :heart:
MIT License
6.64k stars 399 forks source link

NMAKE : fatal error U1073: don't know how to make 'lib\screen.lib' #89

Closed Macfly closed 3 years ago

Macfly commented 3 years ago

Hello, I am trying to build the below example with the latest MSVC but I get into this error. Anyone knows how to fix it (full cmake and build logs below)?

[ 72%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/vbox.cpp.obj
vbox.cpp
NMAKE : fatal error U1073: don't know how to make 'lib\screen.lib'

https://arthursonzogni.com/FTXUI/doc/_2examples_2component_2homescreen_8cpp-example.html

C:\Users\snoof\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\211.7142.21\bin\cmake\win\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - NMake Makefiles" D:\project\crypto_amm
-- No colored compiler diagnostic set for 'MSVC' compiler.
-- ccache found and enabled
-- Conan: Automatic detection of conan settings from cmake
-- Conan: Detected VS runtime: MDd
-- Conan: Settings= -s;arch=x86_64;-s;build_type=Debug;-s;compiler=Visual Studio;-s;compiler.version=16;-s;compiler.runtime=MDd
-- Conan: checking conan executable
-- Conan: Found program C:/Users/snoof/anaconda3/Scripts/conan.exe
-- Conan: Version found Conan version 1.36.0

-- Conan executing: C:/Users/snoof/anaconda3/Scripts/conan.exe install . -s arch=x86_64 -s build_type=Debug -s compiler=Visual Studio -s compiler.version=16 -s compiler.runtime=MDd -g=cmake --build=missing -o=boost:header_only=True
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=Visual Studio
compiler.runtime=MDd
compiler.version=16
os=Windows
os_build=Windows
[options]
boost:header_only=True
[build_requires]
[env]

conanfile.txt: Installing package
Requirements
    boost/1.76.0 from 'conan-center' - Cache
    catch2/2.13.6 from 'conan-center' - Cache
    cpr/1.6.0 from 'conan-center' - Cache
    fmt/7.1.3 from 'conan-center' - Cache
    libcurl/7.69.1 from 'conan-center' - Cache
    openssl/1.1.1k from 'conan-center' - Cache
    rapidjson/1.1.0 from 'conan-center' - Cache
    spdlog/1.8.5 from 'conan-center' - Cache
    websocketpp/0.8.2 from 'conan-center' - Cache
    zlib/1.2.11 from 'conan-center' - Cache
Packages
    boost/1.76.0:524ea35a8120baabdde02483add58d81bf541327 - Cache
    catch2/2.13.6:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    cpr/1.6.0:17e89a7d9a71d16eda694469d0feeadabd149615 - Cache
    fmt/7.1.3:d057732059ea44a47760900cb5e4855d2bea8714 - Cache
    libcurl/7.69.1:0a15b3554d54d89968fdd6ac216f2471a295beb6 - Cache
    openssl/1.1.1k:d057732059ea44a47760900cb5e4855d2bea8714 - Cache
    rapidjson/1.1.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    spdlog/1.8.5:55db45024bed1a2d40f24c02c050b7ca72eeccf4 - Cache
    websocketpp/0.8.2:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    zlib/1.2.11:d057732059ea44a47760900cb5e4855d2bea8714 - Cache

Installing (downloading, building) binaries...
boost/1.76.0: Already installed!
catch2/2.13.6: Already installed!
fmt/7.1.3: Already installed!
openssl/1.1.1k: Already installed!
rapidjson/1.1.0: Already installed!
zlib/1.2.11: Already installed!
libcurl/7.69.1: Already installed!
spdlog/1.8.5: Already installed!
websocketpp/0.8.2: Already installed!
cpr/1.6.0: Already installed!
conanfile.txt: Generator txt created conanbuildinfo.txt
conanfile.txt: Generator cmake created conanbuildinfo.cmake
conanfile.txt: Generated conaninfo.txt
conanfile.txt: Generated graphinfo
WARN: websocketpp/0.8.2: requirement openssl/1.1.1h overridden by your conanfile to openssl/1.1.1k 
WARN: websocketpp/0.8.2: requirement boost/1.74.0 overridden by your conanfile to boost/1.76.0 
-- Conan: Loading conanbuildinfo.cmake
-- Conan: Adjusting output directories
-- Conan: Using cmake targets configuration
-- Library spdlogd found C:/Users/snoof/.conan/data/spdlog/1.8.5/_/_/package/55db45024bed1a2d40f24c02c050b7ca72eeccf4/lib/spdlogd.lib
-- Library cpr found C:/Users/snoof/.conan/data/cpr/1.6.0/_/_/package/17e89a7d9a71d16eda694469d0feeadabd149615/lib/cpr.lib
-- Library fmtd found C:/Users/snoof/.conan/data/fmt/7.1.3/_/_/package/d057732059ea44a47760900cb5e4855d2bea8714/lib/fmtd.lib
-- Library libcurl found C:/Users/snoof/.conan/data/libcurl/7.69.1/_/_/package/0a15b3554d54d89968fdd6ac216f2471a295beb6/lib/libcurl.lib
-- Library libssld found C:/Users/snoof/.conan/data/openssl/1.1.1k/_/_/package/d057732059ea44a47760900cb5e4855d2bea8714/lib/libssld.lib
-- Library libcryptod found C:/Users/snoof/.conan/data/openssl/1.1.1k/_/_/package/d057732059ea44a47760900cb5e4855d2bea8714/lib/libcryptod.lib
-- Library zlib found C:/Users/snoof/.conan/data/zlib/1.2.11/_/_/package/d057732059ea44a47760900cb5e4855d2bea8714/lib/zlib.lib
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Current conanbuildinfo.cmake directory: D:/project/crypto_amm/cmake-build-debug-msvc
Building Tests. Be sure to check out test/constexpr_tests for constexpr testing
git found
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
Doxygen need to be installed to generate the doxygen documentation
-- Configuring done
-- Generating done
-- Build files have been written to: D:/project/crypto_amm/cmake-build-debug-msvc

[Finished]
====================[ Clean | Debug-MSVC ]======================================
C:\Users\snoof\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\211.7142.21\bin\cmake\win\bin\cmake.exe --build D:\project\crypto_amm\cmake-build-debug-msvc --target clean

Clean finished

====================[ Build | all | Debug-MSVC ]================================
C:\Users\snoof\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\211.7142.21\bin\cmake\win\bin\cmake.exe --build D:\project\crypto_amm\cmake-build-debug-msvc --target all
[  2%] Building CXX object test/CMakeFiles/catch_main.dir/cmake_pch.cxx.obj
cmake_pch.cxx
[  4%] Building CXX object test/CMakeFiles/catch_main.dir/catch_main.cpp.obj
catch_main.cpp
[  4%] Linking CXX static library ..\lib\catch_main.lib
[  4%] Built target catch_main
[  6%] Building CXX object test/CMakeFiles/tests.dir/cmake_pch.cxx.obj
cmake_pch.cxx
[  9%] Building CXX object test/CMakeFiles/tests.dir/tests.cpp.obj
tests.cpp
[  9%] Linking CXX executable ..\bin\tests.exe
LINK : ..\bin\tests.exe not found or not built by the last incremental link; performing full link
[  9%] Built target tests
[  9%] Building CXX object test/CMakeFiles/constexpr_tests.dir/cmake_pch.cxx.obj
cmake_pch.cxx
[ 11%] Building CXX object test/CMakeFiles/constexpr_tests.dir/constexpr_tests.cpp.obj
constexpr_tests.cpp
[ 13%] Linking CXX executable ..\bin\constexpr_tests.exe
LINK : ..\bin\constexpr_tests.exe not found or not built by the last incremental link; performing full link
[ 13%] Built target constexpr_tests
[ 13%] Building CXX object test/CMakeFiles/relaxed_constexpr_tests.dir/cmake_pch.cxx.obj
cmake_pch.cxx
[ 16%] Building CXX object test/CMakeFiles/relaxed_constexpr_tests.dir/constexpr_tests.cpp.obj
constexpr_tests.cpp
[ 18%] Linking CXX executable ..\bin\relaxed_constexpr_tests.exe
LINK : ..\bin\relaxed_constexpr_tests.exe not found or not built by the last incremental link; performing full link
[ 18%] Built target relaxed_constexpr_tests
[ 20%] Building CXX object _deps/ftxui-build/CMakeFiles/screen.dir/src/ftxui/screen/box.cpp.obj
box.cpp
[ 20%] Building CXX object _deps/ftxui-build/CMakeFiles/screen.dir/src/ftxui/screen/color.cpp.obj
color.cpp
[ 23%] Building CXX object _deps/ftxui-build/CMakeFiles/screen.dir/src/ftxui/screen/color_info.cpp.obj
color_info.cpp
[ 25%] Building CXX object _deps/ftxui-build/CMakeFiles/screen.dir/src/ftxui/screen/screen.cpp.obj
screen.cpp
[ 25%] Building CXX object _deps/ftxui-build/CMakeFiles/screen.dir/src/ftxui/screen/string.cpp.obj
string.cpp
[ 27%] Building CXX object _deps/ftxui-build/CMakeFiles/screen.dir/src/ftxui/screen/terminal.cpp.obj
terminal.cpp
[ 30%] Building CXX object _deps/ftxui-build/CMakeFiles/screen.dir/src/ftxui/screen/wcwidth.cpp.obj
wcwidth.cpp
[ 30%] Linking CXX shared library ..\..\bin\screen.dll
LINK : ..\..\bin\screen.dll not found or not built by the last incremental link; performing full link
[ 30%] Built target screen
[ 32%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/blink.cpp.obj
blink.cpp
[ 32%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/bold.cpp.obj
bold.cpp
[ 34%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/border.cpp.obj
border.cpp
[ 37%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/clear_under.cpp.obj
clear_under.cpp
[ 37%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/color.cpp.obj
color.cpp
[ 39%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/composite_decorator.cpp.obj
composite_decorator.cpp
[ 41%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/dbox.cpp.obj
dbox.cpp
[ 44%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/dim.cpp.obj
dim.cpp
[ 44%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/flex.cpp.obj
flex.cpp
[ 46%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/frame.cpp.obj
frame.cpp
[ 48%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/gauge.cpp.obj
gauge.cpp
[ 48%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/graph.cpp.obj
graph.cpp
[ 51%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/hbox.cpp.obj
hbox.cpp
[ 53%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/hflow.cpp.obj
hflow.cpp
[ 53%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/inverted.cpp.obj
inverted.cpp
[ 55%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/node.cpp.obj
node.cpp
[ 58%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/node_decorator.cpp.obj
node_decorator.cpp
[ 58%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/paragraph.cpp.obj
paragraph.cpp
[ 60%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/reflect.cpp.obj
reflect.cpp
[ 62%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/separator.cpp.obj
separator.cpp
[ 65%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/size.cpp.obj
size.cpp
[ 65%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/spinner.cpp.obj
spinner.cpp
[ 67%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/text.cpp.obj
text.cpp
[ 69%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/underlined.cpp.obj
underlined.cpp
[ 69%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/util.cpp.obj
util.cpp
[ 72%] Building CXX object _deps/ftxui-build/CMakeFiles/dom.dir/src/ftxui/dom/vbox.cpp.obj
vbox.cpp
NMAKE : fatal error U1073: don't know how to make 'lib\screen.lib'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
ArthurSonzogni commented 3 years ago

I have no knowledge about conan and visual studio.

It sounds like it tries to build a dynamic library and then try to link statically. I might be able to fix this.

ArthurSonzogni commented 3 years ago

@Macfly , could you please check whether commit cf4fdf2 fixed the issue?