add_executable(main main.cpp)
target_link_libraries(main ${CMAKE_SOURCE_DIR}/libbingitup.a)

静态库和动态库共存时,cmake会默认先链接静态库,如果要强制使用静态库,在CMakeLists.txt中如此直接指明

 

或者这样做也可以

So, if you want to link to a static library, you need to search for that static library:

find_library(SOMELIB libsomelib.a)
instead of:

find_library(SOMELIB somelib)

 

相关文章:

  • 2021-10-04
  • 2022-02-11
  • 2021-12-02
  • 2021-06-01
  • 2021-08-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-11-20
  • 2021-07-06
  • 2021-11-18
  • 2021-08-30
相关资源
相似解决方案