Skip to content

1010code/make-cpp-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

靜態庫和動態庫的構建

cd mylib-library/
mkdir build
cd build
cmake ..
make
sudo make install
cd ../../
cp mylib-library/build/bin/libmylib.so release/mylib-linux-aarch64/lib/
g++ -o main ./main.cpp -I release/mylib-linux-aarch64/include -L release/mylib-linux-aarch64/lib -lmylib -std=c++11

現在庫已經編寫完成,要如何使用呢?一種方法是使用 make install,另一種方法是提供設定文件,例如 mylib-config.cmake,後者需要透過 .cmake.in 文件生成,可以參考下一個進階教學make-cpp-library-advance

Reference

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published