Comments (1)
Are you building your libraries and binary from the same CMake project? If you are you may have left out the line about adding an alias target from your library. In my example I have
add_library(${PROJECT_NAME} src/sublib1.cpp)
add_library(sub::lib1 ALIAS ${PROJECT_NAME})
The first line generates the library, the second line generates an alias with the name sub::lib1
. If that line is missing that the link to it from the binary target_link_libraries will fail
from cmake-examples.
Related Issues (20)
- The link for Modular C++ Projects does not work.
- scan-build doesn`t get the null pointer HOT 1
- Paths target Linux OS' specifically, shouldn't be cross-platform oriented?
- 01-basic/E-installing word wrong
- Issue no issue
- What's the meaning of add_library (*** ALIAS ***) HOT 3
- Examples using cmake-presets
- Why there's no need to use include_directories() in 01-basic\H-third-party-library HOT 2
- Building D-shared-library on Windows with Visual Studio
- how to run Cmakelist text file in visual studio HOT 1
- Run error
- `01-basic/K-imported-targets` is same to `H-third-party-library`
- `01-basic/E-installing`: cannot open shared object file HOT 1
- `01-basic/G-compile-flags`:missing `cmake-gui` picture
- Command history is unnecessarily repeated
- 04-static-analyzer clang-format have some errors
- Improve clang-format check target by showing files which are not correctly formatted
- cmake-examples/01-basic/H-third-party-library/ Why don't i need add boost::shared_ptr to `target_link_libraries`?
- Add FetchContent example(s)
- More failed builds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmake-examples.