Giter Site home page Giter Site logo

cgen's Introduction

cgen

Triển khai khái quát các cấu trúc dữ liệu lưu trữ cơ bản

Hướng dẫn biên dịch

Tệp mã nguồn, ví dụ main.c:

#include "cgen.h"
/*...*/

Trong đó all.h là tệp tổng hợp các tệp tiêu đề của cgen.

1. Biên dịch với gcc trong môi trường dòng lệnh

gcc -o prog main.c ${CGEN_PATH}/all.c -I ${CGEN_PATH}

Trong đó ${CGEN_PATH} là đường dẫn tới thư mục cgen;

all.c là tệp tổng hợp các tệp .c (mã nguồn) của cgen.

2. Biên dịch với ninja và cmake

Cách đơn giản nhất là đặt cgen bên trong (là thư mục con của) thư mục dự án. Giả sử thư mục dự án có cấu trúc như sau:

my-project
  cgen
  main.c
  CMakeLists.txt
  ...

Tạo tệp CMakeLists.txt với các nội dung sau:

add_subdirectory(cgen)
include_directories(cgen)
add_executable(prog main.c)
target_link_libraries(prog bkcgen)

Nên thực hiện biên dịch dự án trong một thư mục độc lập, ví dụ:

mkdir b
cd b
cmake .. -G Ninja
ninja

3. Sử dụng định dạng 1 tệp

#include "cgen.h"
/*...*/

gcc -o prog main.c cgen.c

Các tệp tổng hợp cgen.h và cgen.c có thể được tải về từ trang Xuất bản (release), hoặc tự tạo với công cụ merge trong mega-unit.

4. Tài liệu

Xem tài liệu chi tiết ở địa chỉ APIs doc

cgen's People

Contributors

bangoc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.