https://github.com/opensourcedoc/cpp-boilerplate-library
C++ Boilerplate Project to Build C++ Based Library
https://github.com/opensourcedoc/cpp-boilerplate-library
boilerplate boilerplate-library cpp
Last synced: 10 months ago
JSON representation
C++ Boilerplate Project to Build C++ Based Library
- Host: GitHub
- URL: https://github.com/opensourcedoc/cpp-boilerplate-library
- Owner: opensourcedoc
- License: mit
- Created: 2021-05-16T00:41:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-18T06:38:21.000Z (about 5 years ago)
- Last Synced: 2025-02-24T10:35:45.672Z (over 1 year ago)
- Topics: boilerplate, boilerplate-library, cpp
- Language: Makefile
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C++ Boilerplate for Library
A C++ boilerplate project to build a C++ based library.
## System Requirements
* C++ compiler (Clang or GCC)
* GNU Make (for compilation only)
## Usage
Clone the project:
```
$ git clone https://github.com/cwchentw/cpp-boilerplate-library.git mylib
```
Move your working directory to the root of *mylib*:
```
$ cd mylib
```
Modify the header and the source as needed. You may add and remove C source files (*.c*) and C++ source files (*.cc*, *.cpp* or *.cxx*) as well.
Compile the project to a dynamic library:
```
$ make
```
Alternatively, compile the project to a static library:
```
$ make static
```
Set your own remote repository:
```
$ git remote set-url origin https://example.com/user/project.git
```
Push your modification to your own repo:
```
$ git push
```
## Project Configuration
Here are the parameters in *Makefile*:
* **LIBRARY**: the name of the compiled library, including *lib* the prefix
* **C_STD**: the C standard as a GCC C dialect
* **CXX_STD**: the C++ standard as a GCC C++ dialect
## Note
You may mix C and C++ in the same project as well.
The project assumes a Unix console environment. Windows users can install [MSYS2](https://www.msys2.org/) to obtain a decent Unix environment.
Because seldom Visual C++ users compile programs with Make, we don't include the compiler in the project.
## Copyright
Copyright (c) 2020 Michelle Chen. Licensed under MIT.