当前位置: 首页 > 软件库 > 开发工具 > >

cpp-project

授权协议 Unlicense License
开发语言 C/C++
所属分类 开发工具
软件类型 开源软件
地区 不详
投 递 者 柴文林
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Project Status: Active – The project has reached a stable, usable state and is being actively developed.Build statusCoverage StatuscodecovLanguage grade: C/C++Total alertslicenseLines of CodeAverage time to resolve an issuePercentage of issues still open

Boiler plate for C++ projects

This is a boiler plate for C++ projects. What you get:

Demo of usage

Structure

.
├── CMakeLists.txt
├── app
│   └── main.cpp
├── include
│   ├── example.h
│   └── exampleConfig.h.in
├── src
│   └── example.cpp
└── tests
    ├── dummy.cpp
    └── main.cpp

Sources go in src/, header files in include/, main programs in app/, andtests go in tests/ (compiled to unit_tests by default).

If you add a new executable, say app/hello.cpp, you only need to add the following two lines to CMakeLists.txt:

add_executable(main app/main.cpp)   # Name of exec. and location of file.
target_link_libraries(main PRIVATE ${LIBRARY_NAME})  # Link the executable to lib built from src/*.cpp (if it uses it).

You can find the example source code that builds the main executable in app/main.cpp under the Build section in CMakeLists.txt.If the executable you made does not use the library in src/, then only the first line is needed.

Building

Build by making a build directory (i.e. build/), run cmake in that dir, and then use make to build the desired target.

Example:

> mkdir build && cd build
> cmake .. -DCMAKE_BUILD_TYPE=[Debug | Coverage | Release]
> make
> ./main
> make test      # Makes and runs the tests.
> make coverage  # Generate a coverage report.
> make doc       # Generate html documentation.

.gitignore

The .gitignore file is a copy of the Github C++.gitignore file,with the addition of ignoring the build directory (build/).

Services

If the repository is activated with Travis-CI, then unit tests will be built and executed on each commit.The same is true if the repository is activated with Appveyor.

If the repository is activated with Coveralls/Codecov, then deployment to Travis will also calculate code coverage andupload this to Coveralls.io and/or Codecov.io

Setup

Using the GitHub template

Click the Use this template button to make a new repository from this template.

From command line

When starting a new project, you probably don't want the history of this repository. To start fresh you can usethe setup script as follows:

> git clone https://github.com/bsamseth/cpp-project  # Or use ssh-link if you like.
> cd cpp-project
> bash setup.sh

The result is a fresh Git repository with one commit adding all files from the boiler plate.

  • 关于cpp-cmake的config编写,本文枚列几个关键文件。 方便大家实现,注意到config.h是通过cmake自动生成,但是要注意下configure_file时候的路径。另外就是configure_file前要事先定义好宏变量。 例子来源于:https://www.hahack.com/codes/cmake/ CMakeLists.txt编辑 # CMakeList.txt: CMak

  • 1、g++版本要求高于5.0,自己升级g++比较麻烦 2、我直接使用的centos8.0,g++版本为8.以上 3、按照文档解压编译(后面又遇到的问题): mkdir work url https://www.antlr.org/download/antlr4-cpp-runtime-4.7.2-source.zip -o ./work/antlr4-cpp-runtime-4.7.2-sourc

  • project() 1 命令格式: 形式1: project(<PROJECT-NAME> [<language-name>...]) 形式2: project(<PROJECT-NAME> [VERSION <major>[.<minor>[.<patch>[.<tweak>]]]] [DESCRIPTION <project-description-string

  • 在linux上进行cpp的代码的编译 你好! 下文将详细展示在linux上对C++代码的编译与链接过程。如果你想学习如何使用g++或cmake对c++代码进行编译与链接, 可以仔细阅读这篇文章,了解一下cmake的基本语法知识。 g++编译器使用 g++安装 sudo apt-get install g++ g++编译 我们用g++编译器将源代码编译成一个可执行文件,使用如下命令: g++ xx

  • QT 命令编译:mingw53_32到cpp目录下,uic -o uiname.h uiname.ui有界面使用,qmake -project生成pro,qmake生成Makefile文件和debug与release两个目录,make生成exe

  • you can just create a .cocos-project.json file yourself. All it contains is the following code: { "project_type": "cpp" } 如果是lua工程话,直接修改成lua即可。

  •   1.当“以管理员身份运行”时编译不会报错,当以普通身份(不知道是什么身份,就是平常的双击,启动软件时不做其他处理)启动Dev Cpp时会报“C:\Program Files (x86)\Dev-Cpp\project\collect2.exe    [Error] ld returned 1 exit status”错误。   2.当同样的源文件保存到桌面时,不会报错,程序会正常编译运行。  

 相关资料
  • yaml-cpp 是一个 YAML 解析器,使用 C++ 编写,支持 YAML 1.2 规范。 示例代码: #include <fstream> #include "yaml.h" int main() {     std::ifstream fin("test.yaml");     YAML::Parser parser(fin);     YAML::Node doc;     while(

  • JsonRpc-Cpp 是 C++ 实现的 JSON-RPC 框架,基于 JsonCpp 开发。

  • ffead-cpp 是一个 C++ 平台的企业应用程序开发框架。 这是一个 C++ 的 Web 框架,C++ 应用程序框架,C++ 的 REST 框架和 C++ 的 SOAP 框架,这些框架都内置其中。它包含 Linux/Windows(通过 Cygwin)的实现。 它是第一个也是唯一的提供非侵入性的依赖注入、业务驱动的组件逻辑、基于 POCO 发展的 C++ 应用程序框架。大部分的功能都是由配置

  • jwt-cpp 是用于在 C++11 中创建和验证 JSON Web 令牌 的 header only 库。 签名算法 jwt-cpp支持标准中定义的所有算法。模块化设计允许轻松添加其他算法而不会出现任何问题。 为了完整起见,这里列出了所有支持的算法: HMSC RSA ECDSA PSS EdDSA HS256 RS256 ES256 PS256 Ed25519 HS384 RS384 ES38

  • godot-cpp 是 Godot 开源游戏引擎 API 的 C++ 绑定。 警告:这个存储库的主分支只能使用Godot的(GDExtension) API (Godot 4.0及更高版本)。 对于GDNative用户(Godot 3.x),请切换到3.x。X或3.5分支。 这个存储库包含Godot引擎的GDExtensions API的c++绑定。 版本控制 兼容性 贡献 版本控制 这个存储库遵

  • kys-cpp 这是一个以SDL2为基础实现的2D游戏引擎。 基本按照当代游戏引擎的思路实现,但是没有使用回调,因为回调会增加初学者的使用难度。 同时相当于提供了一个使用该引擎制作DOS游戏《金庸群侠传》移植版的范例。 架构的简单说明 公用类 Engine封装了一套SDL2的主要实现,主要取自TinyPot。 File是一些读取,写入函数。包含几个简化程序的模板函数。 Save中对所有数据进行了封