Windows环境使用VS编译openPGM

本文详细介绍了如何使用MSVC 2010在Windows 7上从源代码编译OpenPGM库的过程,包括安装必要的软件、配置环境、使用CMake生成项目文件及最终的编译步骤。

没法FQ的可以看看, 网上有编译好的, 但不适合自己的项目, 只能自己编译

编译方法原文

 summary OpenPGM 5 : C Reference : Build Library : MSVC 2010 on Windows 7

labels Phase-Implementation

sidebar TOC5CReferenceProgrammersChecklist

Building with MSVC 2010 for Windows 7

First install Microsoft Visual C++ 2010 Express, Professional (x64 support), etc. Install the build system CMake and the PGM build dependencies Perl and Python 2.7.

Checkout the repository as per the Subversion guide, or download the latest source archive and extract. You can use Cygwin and Subversion to checkout the source.

$ *cd /cygdrive/c *

$ *svn checkout http://openpgm.googlecode.com/svn/tags/release-5-1-102 

 libpgm-5.1.102 *

Configure using a Visual Studio Command Prompt.

C:\> *cd \libpgm-5.1.102\openpgm\pgm*

C:\libpgm-5.1.102\openpgm\pgm> *mkdir build*

C:\libpgm-5.1.102\openpgm\pgm> *cd build*

C:\libpgm-5.1.102\openpgm\pgm\build> *cmake ..*

CMake will build a Makefile in the current directory with the PGM library to be built in the sub-directory lib.

To configure the release version use the following command or change the parameter using cmake-gui.

C:\libpgm-5.1.102\openpgm\pgm\build> *cmake -DCMAKE_BUILD_TYPE=Release ..*

Build.

C:\libpgm-5.1.102\openpgm\pgm\build> *nmake*

If you want a redistributable installer use CPack to build the package.

C:\libpgm-5.1.102\openpgm\pgm\build> *nmake package*
 
--------------------------------------------------------------------------------------------------------------------------------------------------
CMAKE可以指定VS版本, 不一定是2010
 
CMAKE产生项目文件后就可以在生成目录下找到SLN工程文件, 可以在VS中编译, 不一定要用命令行编译

编译时需要用到GetGnuWin中的patch.exe, GetGnuWin路径需要加到PATH环境变量中

其他项目引用时, 需要拷贝include\pgm整个文件夹, 不能只拷贝pgm.h

转载于:https://www.cnblogs.com/wuqincao/p/7464699.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值