【无标题】C++库编译

3 篇文章 0 订阅

fastcdr 编译 & 安装

mkdir build
cd build
cmake … --install-prefix=//xxxx/xxxx/third_party/Fast-CDR
make -j8
make install

Fast-RTPS(Fast-DDS) 编译安装

mkdir build
cd build
cmake … -DTHIRDPARTY=ON --install-prefix=/xxxx/xxxx/third_party/Fast-RTPS
make -j8
make install

bzip编译安装

make -f Makefile-libbz2_so
// make -n install PREFIX=/xxxx/xxxx/third_party/bzip2
make -f Makefile-libbz2_so install PREFIX=//xxxx/xxxx/third_party/bzip2

protobuf 下载编译安装

1.protobuf源码,下载地址:https://github.com/google/protobuf/releases,看自己要先哪个版本,就选择对应的Source code,可以选择zip或者tar.gz格式。
2.依次执行下面的命令:
./autogen.sh
./configure --prefix=安装目录绝对路径
make -j8
make check
sudo make install
或者
make build_cmake
cd build_cmake
cmake -DCMAKE_INSTALL_PREFIX=/xxxx/xxxx/third_party/protobuf … #可以是相对路径,也可以是绝对路径
make -j4
make install

libuuid-1.0.3编译安装:

./configure --prefix=/xxxx/xxxx/third_party/uuid
make -j4
make install

spdlog 下载编译安装

mkdir build
cd build
cmake -DSPDLOG_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=/xxxx/xxxx/third_party/spdlog …

gflags 编译安装

mkdir build && cd build
cmake … -DCMAKE_INSTALL_PREFIX=/xxxx/xxxx/third_party/gflags
make
make install

jsoncpp 编译安装:

mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=…/…/…/third_party/jsoncpp …
make -j8
make install

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
PDFLIB是一个用于创建和处理PDF文档的C/C++。下面是使用PDFLIB创建PDF文档的基本步骤: 1. 初始化PDFLIB并创建一个新的PDF文档对象。 ``` #include <stdio.h> #include <stdlib.h> #include <pdc/pdflib.h> int main() { PDF *pdf; int font, page; /* Initialize PDFLIB library */ if ((pdf = PDF_new()) == NULL) { printf("Error: Cannot initialize PDFLIB library\n"); exit(1); } /* Create a new PDF document */ if (PDF_open_file(pdf, "test.pdf") == -1) { printf("Error: Cannot create a new PDF document\n"); exit(1); } /* Set the document information */ PDF_set_info(pdf, "Creator", "My PDF Application"); PDF_set_info(pdf, "Author", "John Doe"); PDF_set_info(pdf, "Title", "My First PDF Document"); /* Add a new page to the document */ page = PDF_begin_page(pdf, 595, 842); /* Set the font */ font = PDF_findfont(pdf, "Helvetica-Bold", "host", 1); PDF_setfont(pdf, font, 24); /* Draw some text on the page */ PDF_show_xy(pdf, "Hello, World!", 100, 700); /* End the page */ PDF_end_page(pdf); /* Close the document */ PDF_close(pdf); /* Free the PDF document object */ PDF_delete(pdf); return 0; } ``` 2. 设置PDF文档的信息,如标题、作者、创建者等。 3. 添加一个新的页面。 4. 在页面上绘制文本、图像等。 5. 结束页面。 6. 关闭PDF文档。 7. 释放PDF文档对象。 上面的示例代码创建了一个包含一行文本的PDF文档,并将其保存为“test.pdf”文件。要编译此代码,您需要安装PDFLIB并将其链接到您的程序中。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值