Home >Backend Development >C++ >Why Does CMake's `link_directories` Fail to Find My Library Despite Correct Path Specification?
CMake: Link_Directories Fails to Locate Library
Issue:
In a CMake-based project with a src and build directory, a library named "protobuf" cannot be found despite using the link_directories command.
Details:
Solution:
Ensure that the link_directories command appears before not only target_link_libraries but also add_executable in the CMakeLists.txt file.
The above is the detailed content of Why Does CMake's `link_directories` Fail to Find My Library Despite Correct Path Specification?. For more information, please follow other related articles on the PHP Chinese website!