fatal error LNK1181: cannot open input file 'Release\screen.lib' #264
-
When Trying to buld my project, I get
cmake_minimum_required(VERSION 3.0.0)
project(WindowsRichPresence VERSION 0.1.0)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# -- FETCH CPR --------------------------------------------------------------
set(CPR_BUILD_TESTS_SSL OFF)
set(CPR_BUILD_TESTS OFF)
include(FetchContent)
FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git GIT_TAG f4622efcb59d84071ae11404ae61bd821c1c344b) # the commit hash for 1.6.2
FetchContent_MakeAvailable(cpr)
# -- FETCH FTXUI --------------------------------------------------------------
set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
FetchContent_Declare(ftxui GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui GIT_TAG cecd54df42dd66fdf8386ed461e16b725bffc827)
FetchContent_GetProperties(ftxui)
if(NOT ftxui_POPULATED)
FetchContent_Populate(ftxui)
add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
add_executable(WindowsRichPresence main.cpp)
target_link_libraries(
${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/RichPresence/libs/discord-rpc.lib"
PRIVATE cpr::cpr PRIVATE ftxui::screen PRIVATE ftxui::dom
)
|
Beta Was this translation helpful? Give feedback.
Answered by
ArthurSonzogni
Nov 21, 2021
Replies: 1 comment 1 reply
-
That's dynamic libraries. You need either:
In the past, I was forcing users to build FTXUI statically. Then Gentoo users asked for the possibility to build shared libraries instead: The default on Linux is to build statically. On Windows, the default are to build dynamically. In you case, you can build statically using: set(BUILD_SHARED_LIBS OFF) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ArthurSonzogni
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's dynamic libraries. You need either:
In the past, I was forcing users to build FTXUI statically. Then Gentoo users asked for the possibility to build shared libraries instead:
#223
The default on Linux is to build statically. On Windows, the default are to build dynamically.
In you case, you can build statically using: