LibreCAD v2.2.0源码编译,使用VS2017+Qt5.12.5+Boost1.69.0环境

LibreCAD is a fork of QCAD community edition version 2.0.5.0;therefore, any modifications of or additions to the program are also released under the GPLv2.

The project's first commit on Github was Aug 16, 2010.

  • http://librecad.org/
  • https://wiki.librecad.org/
  • https://github.com/LibreCAD/LibreCAD
  • https://sourceforge.net/projects/librecad/files/

一、环境准备

1、VS2017,Qt5.12.5/x86,Qt VS Tools插件

http://download.qt.io/official_releases/qt/

2、boost v1.69.0下载:

https://dl.bintray.com/boostorg/release/ -- 推荐下载boost_1_69_0-msvc-14.1-32.exe文件(含源码和编译好的库)

3、检查一下Windows环境变量是否正确:

设置Windows的环境变量。推荐使用工具Rapid Environment Editor。http://www.rapidee.com/

Path=F:\Qt\Qt5.12.5\5.12.5\msvc2017\bin

QTDIR=F:\Qt\Qt5.12.5\5.12.5\msvc2017
BOOST_DIR=F:\Boost\boost_1_69_0

BOOST_LIBDIR=F:\Boost\boost_1_69_0\lib32-msvc-14.1

4、LibreCAD官网下载源码

https://github.com/LibreCAD/LibreCAD/releases

<1>使用windows记事本,修改以下源文件的编码为Unicode,否则编译会出错:

F:\CADCAM\QCAD\src\LibreCAD-2.2.0\libraries\jwwlib\src\
dl_jww.cpp
jwwdoc.cpp
jwwdoc.h
f:\cadcam\qcad\src\librecad-2.2.0\librecad\src\lib\engine\rs.h

<2>\LibreCAD-2.2.0\librecad\src\boost.pri文件有对boost的依赖库作说明,用的是静态库.

5、打开VS2017,主菜单->Qt VS Tools->打开librecad.pro文件,最后可能会提示出错(Import): Error(s): ,没关系,不管它。

开始编译源码,过程中会报错:

(1)4>f:\cadcam\qcad\src\librecad-2.2.0\librecad\src\actions\rs_actiondrawcircletan2.h(82): error C2797: “RS_ActionDrawCircleTan2::enTypeList”: 未实现成员初始值设定项列表或非静态数据成员初始值设定项内的列表初始化 (编译源文件 ui\forms\qg_circletan2options.cpp)

\LibreCAD-2.2.0\librecad\src\actions\rs_actiondrawlinetangent2.h修改为    
//list of entity types supported by current action
    //const std::initializer_list circleType {RS2::EntityArc, RS2::EntityCircle, RS2::EntityEllipse};
	const std::initializer_list circleType;

\LibreCAD-2.2.0\librecad\src\actions\rs_actiondrawlinetangent2.cpp修改为 
RS_ActionDrawLineTangent2::RS_ActionDrawLineTangent2(
    RS_EntityContainer& container,
    RS_GraphicView& graphicView)
	:RS_PreviewActionInterface("Draw Tangents 2", container, graphicView)
	,circle1(nullptr)
	,circle2(nullptr)
	,valid(false)
	,circleType({ RS2::EntityArc, RS2::EntityCircle, RS2::EntityEllipse })

(2)错误 C1083 无法打开源文件: “Win32\Debug\licenses\\qrc_licenses.cpp”: No such file or directory

把\LibreCAD-2.2.0\librecad\src\Win32\licenses拷贝到\LibreCAD-2.2.0\librecad\src\Win32\Debug

 

你可能感兴趣的:(精品资源推介)