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

fatal error LNK1181:无法打开输入文件“Debug/detector.lib”错误 #2

Open
ghost opened this issue Feb 7, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 7, 2021

Windows下面CMakeLists.txt(初学CMake):

cmake_minimum_required(VERSION 3.5)

project(nanodet)

set(CMAKE_CXX_STANDARD 11)

find_package(OpenCV REQUIRED)

find_package(InferenceEngine)

find_package(ngraph REQUIRED)

add_library(detector SHARED ${CMAKE_CURRENT_SOURCE_DIR}/detector.cpp)

target_include_directories(
	detector
	PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include 
	PUBLIC ${OpenCV_INCLUDE_DIRS}
	PUBLIC ${InferenceEngine_INCLUDE_DIRS}
)

target_link_libraries(
	detector 
	${OpenCV_LIBS}
	${InferenceEngine_LIBRARIES}
	${ngraph_LIBRARIES}
)

add_executable(nanodet main.cpp)

target_link_libraries(
	nanodet
	detector
)

然后在cmake --build .时出现标题错误,谢谢。

@Hezhexi2002
Copy link

首先cmake应该在CMakeLists.txt的目录下进行,然后根据你的报错提示,应该是没有编译生成detector静态库,你可以参照作者这里编译detector.so的写法,在win下编译生成detector.libScreenshot_2021-10-05-09-28-36-601_com.github.android.jpg

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

1 participant