Compare commits
14 Commits
0f30fd8655
...
abdulla
| Author | SHA1 | Date | |
|---|---|---|---|
| 39fc9c4c7e | |||
| a7ea4e35bd | |||
| 439a8c9a80 | |||
| dd9dc480fa | |||
| 2b6ad265a6 | |||
| 57b98b7f2d | |||
| fe3be0a3a0 | |||
| a8b48821f9 | |||
| 841f5ac800 | |||
| ab85d05e51 | |||
| 193f52f86d | |||
| 5706f8c05a | |||
| 786d2a91db | |||
| 264828fc3a |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.vscode/settings.json
|
||||||
61
Qt库编译-银河麒麟-RK3588.md
Normal file
61
Qt库编译-银河麒麟-RK3588.md
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# RK3588实机编译Qt5.15.13
|
||||||
|
|
||||||
|
## 目录
|
||||||
|
|
||||||
|
- [RK3588实机编译Qt5.15.13](#rk3588实机编译qt51513)
|
||||||
|
- [目录](#目录)
|
||||||
|
- [一、准备工作](#一准备工作)
|
||||||
|
- [二、编译安装](#二编译安装)
|
||||||
|
- [2.1 配置Qt(configure)](#21-配置qtconfigure)
|
||||||
|
- [2.2 编译](#22-编译)
|
||||||
|
- [2.3 安装](#23-安装)
|
||||||
|
- [附录A:常见编译错误](#附录a常见编译错误)
|
||||||
|
- [1. QBasicMutex::lockInternal(int)重定义](#1-qbasicmutexlockinternalint重定义)
|
||||||
|
|
||||||
|
## 一、准备工作
|
||||||
|
|
||||||
|
- 下载Qt源码包(本文以5.15.13为例,如需编译其它版本,下载对应版本的源代码即可,注意版本不同时,命令中的版本号与实际版本同步),下载Qt源码包[Qt5.15.13源码链接](https://download.qt.io/archive/qt/5.15/5.15.13/single/)
|
||||||
|
|
||||||
|
- 通过以下命令行解压源代码至编译目录(需足够的磁盘空间,一般在用户目录新建)
|
||||||
|
> sudo xz -d qt-everywhere-src-5.15.13.tar.xz
|
||||||
|
> sudo tar -xvf qt-everywhere-src-5.15.13.tar
|
||||||
|
- 安装编译环境
|
||||||
|
> sudo apt-get install build-essential perl python git
|
||||||
|
- 安装依赖库
|
||||||
|
> sudo apt-get install libx11-*
|
||||||
|
> sudo apt-get install libx11*
|
||||||
|
>
|
||||||
|
> sudo apt-get install libxcb-*
|
||||||
|
> sudo apt-get install libxcb*
|
||||||
|
>
|
||||||
|
> sudo apt-get install libxkbcommon-dev
|
||||||
|
> sudo apt-get install libxkbcommon-x11-dev
|
||||||
|
> sudo apt-get install libxcb-xinerama0
|
||||||
|
> sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
|
||||||
|
|
||||||
|
## 二、编译安装
|
||||||
|
|
||||||
|
### 2.1 配置Qt(configure)
|
||||||
|
|
||||||
|
切换至解压出来的Qt目录中,运行以下命令(如果权限不足,使用sudo执行),注意其中的-prefix参数为最终Qt库的安装目录(/home/firefly/Qt5.15.13),应根据实际环境进行修改,在命令行中执行修改后的命令:
|
||||||
|
> ./configure -prefix /home/firefly/Qt5.15.13 -confirm-license -opensource -release -make libs -xplatform linux-aarch64-gnu-g++ -pch -qt-libjpeg -qt-libpng -qt-zlib -no-sse2 -no-openssl -no-cups -no-glib -no-dbus -xcb -no-separate-debug-info -opengl es2 -egl -eglfs -qpa xcb -linuxfb -recheck-all -skip webengine -nomake examples -nomake tests -shared -skip purchasing -skip quick3d -skip sensors -skip speech -skip datavis3d -skip andriodextras -skip gamepad
|
||||||
|
|
||||||
|
### 2.2 编译
|
||||||
|
|
||||||
|
配置成功后,运行以下命令编译代码(-j8表示使用8线程并行编译,可根据需要或实际情况修改该数值):
|
||||||
|
> sudo make -j8
|
||||||
|
|
||||||
|
### 2.3 安装
|
||||||
|
|
||||||
|
编译成功后,运行以下命令打包安装Qt库,打包安装后的库可直接压缩后在其它同样或类似环境中解压使用
|
||||||
|
> sudo make install
|
||||||
|
|
||||||
|
## 附录A:常见编译错误
|
||||||
|
|
||||||
|
### 1. QBasicMutex::lockInternal(int)重定义
|
||||||
|
|
||||||
|
- 错误描述:
|
||||||
|
> qmutex_linux.cpp:multiple definition of 'QBasicMutex::lockInternal(int)',
|
||||||
|
- 解决问题:
|
||||||
|
> As in qmutex.cpp it directly" #include qmutex_linux.cpp", as a result the content of qmutex_linux.cpp will be part of qmutex.cpp.And in the thread.pro, the SOURCES +=qmutex.cpp qmutex_linux.cpp, then during link, the two file have same symbols will be detected.When I delete qmutex_linux.cpp from SOURCES, there is no problem any more.
|
||||||
|
[参考文章](https://blog.csdn.net/qq_43417144/article/details/130680388)
|
||||||
14
blog/assets/osgEarth六边形网格/2dmap.earth
Normal file
14
blog/assets/osgEarth六边形网格/2dmap.earth
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
|
||||||
|
<map name = "ddmap" type="projected" version="2">
|
||||||
|
<options>
|
||||||
|
<terrain driver = "rex" lighting = "true" skirt_ratio="0.05" min_tile_range_factor = "6" first_lod = "0" blending = "false" color = "#ffffffff" tile_size = "17" normalize_edges = "true" compress_normal_maps = "false" normal_maps = "true" min_expiry_frames = "0" min_expiry_time = "0"/>
|
||||||
|
<!-- <profile>plate-carre</profile> -->
|
||||||
|
<profile>spherical-mercator</profile>
|
||||||
|
</options>
|
||||||
|
|
||||||
|
<image name="world" driver="tms" opacity = "1.0" format="png">
|
||||||
|
<url>E:/GISData/Imagery/tms.xml</url>
|
||||||
|
</image>
|
||||||
|
|
||||||
|
</map>
|
||||||
BIN
blog/assets/osgEarth六边形网格/image.png
Normal file
BIN
blog/assets/osgEarth六边形网格/image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 535 KiB |
174
blog/osgEarth六边形网格.md
Normal file
174
blog/osgEarth六边形网格.md
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
# osgEarth构建六边形网格兵棋地图示例
|
||||||
|
|
||||||
|
在osgEarth中添加了osg::Geode,绘制蜂窝状六边形网格效果,包括墨卡托平面地图,地理坐标平面地图,三维地球等多种模式
|
||||||
|

|
||||||
|
```c++
|
||||||
|
// 函数:创建六边形蜂窝网格线,三维地球
|
||||||
|
osg::ref_ptr<osg::Geometry> createHexagonWireframe(const osgEarth::GeoExtent& extent, float radius, int rows, int cols) {
|
||||||
|
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec3Array> vertices = new osg::Vec3Array;
|
||||||
|
|
||||||
|
auto fromSRS = osgEarth::SpatialReference::get("wgs84");
|
||||||
|
auto srs = extent.getSRS();
|
||||||
|
|
||||||
|
// 计算每个六边形中心点的地理坐标
|
||||||
|
float height = std::sqrt(3.0f) * radius;
|
||||||
|
float lonDelta = radius;// extent.width() / cols;
|
||||||
|
float latDelta = radius;// extent.height() / rows;
|
||||||
|
for (int row = 0; row < rows; ++row) {
|
||||||
|
for (int col = 0; col < cols; ++col) {
|
||||||
|
|
||||||
|
float lonDelta = col * 1.5f * radius;
|
||||||
|
float latDelta = row * height;
|
||||||
|
if (col % 2 == 1)
|
||||||
|
latDelta += height / 2.0f;
|
||||||
|
|
||||||
|
float lon = 108.0 + lonDelta;
|
||||||
|
float lat = 35.0 + latDelta;
|
||||||
|
osg::Vec3d centerGeo(lon, lat, 3000.0);
|
||||||
|
|
||||||
|
// 计算六边形的顶点
|
||||||
|
for (int i = 0; i < 6; ++i)
|
||||||
|
{
|
||||||
|
float angle = osg::PI * 2.0f * float(i) / 6.0f;
|
||||||
|
float x = radius * std::cos(angle);
|
||||||
|
float y = radius * std::sin(angle);
|
||||||
|
osg::Vec3d vertexXYZ;
|
||||||
|
osgEarth::GeoPoint pppp(fromSRS, osg::Vec3d(lon + x, lat + y, 1.0));
|
||||||
|
pppp.transformInPlace(srs);
|
||||||
|
pppp.toWorld(vertexXYZ);
|
||||||
|
//vertices->push_back(centerXYZ + vertexXYZ - centerGeo);
|
||||||
|
vertices->push_back(vertexXYZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
geometry->setVertexArray(vertices);
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::DrawElementsUInt> indices = new osg::DrawElementsUInt(GL_LINES);
|
||||||
|
int numHexagons = rows * cols;
|
||||||
|
|
||||||
|
for (int i = 0; i < numHexagons; ++i) {
|
||||||
|
int offset = i * 6;
|
||||||
|
for (int j = 0; j < 6; ++j) {
|
||||||
|
indices->push_back(offset + j);
|
||||||
|
indices->push_back(offset + (j + 1) % 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
geometry->addPrimitiveSet(indices);
|
||||||
|
|
||||||
|
// 启用 VBO
|
||||||
|
geometry->setUseVertexBufferObjects(true);
|
||||||
|
|
||||||
|
// 设置线宽
|
||||||
|
osg::ref_ptr<osg::StateSet> stateSet = geometry->getOrCreateStateSet();
|
||||||
|
osg::ref_ptr<osg::LineWidth> lineWidth = new osg::LineWidth(1.0f); // 设置线宽为 1.0
|
||||||
|
stateSet->setAttributeAndModes(lineWidth, osg::StateAttribute::ON);
|
||||||
|
|
||||||
|
return geometry;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 函数:创建六边形蜂窝网格线,平面地图
|
||||||
|
osg::ref_ptr<osg::Geometry> createHexagonWireframe(double startX,double startY, float radius, int rows, int cols) {
|
||||||
|
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Vec3Array> vertices = new osg::Vec3Array;
|
||||||
|
|
||||||
|
|
||||||
|
// 计算每个六边形中心点的地理坐标
|
||||||
|
float height = std::sqrt(3.0f) * radius;
|
||||||
|
for (int row = 0; row < rows; ++row)
|
||||||
|
{
|
||||||
|
for (int col = 0; col < cols; ++col)
|
||||||
|
{
|
||||||
|
float xDelta = col * 1.5f * radius;
|
||||||
|
float yDelta = row * height;
|
||||||
|
if (col % 2 == 1)
|
||||||
|
yDelta += height / 2.0f;
|
||||||
|
|
||||||
|
float lon = startX + xDelta;
|
||||||
|
float lat = startY + yDelta;
|
||||||
|
|
||||||
|
// 计算六边形的顶点
|
||||||
|
for (int i = 0; i < 6; ++i)
|
||||||
|
{
|
||||||
|
float angle = osg::PI * 2.0f * float(i) / 6.0f;
|
||||||
|
float x = radius * std::cos(angle);
|
||||||
|
float y = radius * std::sin(angle);
|
||||||
|
//vertices->push_back(centerXYZ + vertexXYZ - centerGeo);
|
||||||
|
vertices->push_back(osg::Vec3d(lon + x, lat + y, 1.0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
geometry->setVertexArray(vertices);
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::DrawElementsUInt> indices = new osg::DrawElementsUInt(GL_LINES);
|
||||||
|
int numHexagons = rows * cols;
|
||||||
|
|
||||||
|
for (int i = 0; i < numHexagons; ++i) {
|
||||||
|
int offset = i * 6;
|
||||||
|
for (int j = 0; j < 6; ++j) {
|
||||||
|
indices->push_back(offset + j);
|
||||||
|
indices->push_back(offset + (j + 1) % 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
geometry->addPrimitiveSet(indices);
|
||||||
|
|
||||||
|
// 启用 VBO
|
||||||
|
geometry->setUseVertexBufferObjects(true);
|
||||||
|
|
||||||
|
// 设置线宽
|
||||||
|
osg::ref_ptr<osg::StateSet> stateSet = geometry->getOrCreateStateSet();
|
||||||
|
osg::ref_ptr<osg::LineWidth> lineWidth = new osg::LineWidth(1.0f); // 设置线宽为 1.0
|
||||||
|
stateSet->setAttributeAndModes(lineWidth, osg::StateAttribute::ON);
|
||||||
|
|
||||||
|
return geometry;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
auto ddMap = osgDB::readNodeFile("E:/GISData/Imagery/2dmap.earth");
|
||||||
|
|
||||||
|
auto mapNode = osgEarth::MapNode::findMapNode(ddMap);
|
||||||
|
|
||||||
|
osgEarth::GeoPoint start(osgEarth::SpatialReference::get("wgs84"), 108.0, 35.0);
|
||||||
|
start.transformInPlace(mapNode->getMapSRS());
|
||||||
|
|
||||||
|
auto hexagon222 = createHexagonWireframe(start.x(), start.y()
|
||||||
|
, 500, 100, 100);
|
||||||
|
|
||||||
|
hexagon222->getOrCreateStateSet()->setAttribute(new osg::Depth(osg::Depth::ALWAYS, 0.0, 1.0, false), osg::StateAttribute::ON);
|
||||||
|
osgEarth::GLUtils::setLighting(hexagon222->getOrCreateStateSet(), osg::StateAttribute::OFF);
|
||||||
|
|
||||||
|
mapNode->addChild(hexagon222);
|
||||||
|
|
||||||
|
auto m = new osgEarth::EarthManipulator;
|
||||||
|
|
||||||
|
osgViewer::Viewer viewer;
|
||||||
|
viewer.setSceneData(ddMap);
|
||||||
|
|
||||||
|
viewer.setCameraManipulator(m);
|
||||||
|
viewer.getCamera()->addCullCallback(new osgEarth::AutoClipPlaneCullCallback(mapNode));
|
||||||
|
|
||||||
|
viewer.realize();
|
||||||
|
|
||||||
|
|
||||||
|
m->setViewpoint(osgEarth::Viewpoint("", 108, 35, 0.0, 0.0, -89.9, 100000));
|
||||||
|
|
||||||
|
return viewer.run();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 附件
|
||||||
|

|
||||||
|
|
||||||
|
## 性能问题
|
||||||
|
* 考虑使用instanced drawing
|
||||||
|
* 使用kd-tree
|
||||||
|
* ...
|
||||||
84
vcpkg安装库错误及解决方法.md
Normal file
84
vcpkg安装库错误及解决方法.md
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
# vcpkg安装库失败常见错误及其解决方法
|
||||||
|
|
||||||
|
## 目录
|
||||||
|
- [vcpkg安装库失败常见错误及其解决方法](#vcpkg安装库失败常见错误及其解决方法)
|
||||||
|
- [目录](#目录)
|
||||||
|
- [1. 科学上网](#1-科学上网)
|
||||||
|
- [1.1 控制台设置代理](#11-控制台设置代理)
|
||||||
|
- [1.2 vcpkg包下载失败](#12-vcpkg包下载失败)
|
||||||
|
- [1.3 osg/osgEarth网络代理环境变量](#13-osgosgearth网络代理环境变量)
|
||||||
|
- [2. 遇到某些库编译错误时,在本地修改代码并使用修改后的代码编译](#2-遇到某些库编译错误时在本地修改代码并使用修改后的代码编译)
|
||||||
|
- [3. vcpkg ports内可以修改库的配置,如工程目录,windows SDK版本,以及部分错](#3-vcpkg-ports内可以修改库的配置如工程目录windows-sdk版本以及部分错)
|
||||||
|
- [4. 找不到Windows SDK库的错误修改:https://github.com/microsoft/vcpkg/issues/8288](#4-找不到windows-sdk库的错误修改httpsgithubcommicrosoftvcpkgissues8288)
|
||||||
|
- [5. vc错误: `error MSB4115: 函数“exists”只接受标量值,但其参数“$(ForceImportBeforeCppTargets)”的计算结果为`](#5-vc错误-error-msb4115-函数exists只接受标量值但其参数forceimportbeforecpptargets的计算结果为)
|
||||||
|
- [5. 编译GDAL 出现 +{}; 加号不明确](#5-编译gdal-出现--加号不明确)
|
||||||
|
- [6. Windows 7 Python 3.8](#6-windows-7-python-38)
|
||||||
|
|
||||||
|
|
||||||
|
## 1. 科学上网
|
||||||
|
|
||||||
|
vcpkg中大部份依赖均托管在github仓库中,由于国内特殊的网络环境,导致github大部分时间无法正常访问,尤其是下载较大源码包或文件时会出现网络错误,此时需要通过科学上网措施(目前统一使用Mielink)建立代理上网,建立代理后,一般会有一个本地代理端口,如果配置的不是全局代理,那么有时需要在控制台设定上网代理,下面介绍代理配置方法及一些网络相关的其它错误...
|
||||||
|
|
||||||
|
### 1.1 控制台设置代理
|
||||||
|
|
||||||
|
控制台设置网络代理,需要将2801修改成本机的科学上网代理端口
|
||||||
|
|
||||||
|
* set HTTP_PROXY=http://127.0.0.1:2801
|
||||||
|
* set HTTPS_PROXY=http://127.0.0.1:2801
|
||||||
|
|
||||||
|
### 1.2 vcpkg包下载失败
|
||||||
|
|
||||||
|
* 有时使用vcpkg安装指定库时,由于网络抽风,有时会出现无法成功下载某些源码包的情况,此时可先使用vcpkg安装一次,确认源码包的下载目录及保存的文件名(此二者有时不一致),然后使用以下方法下载压缩包,重命名后放在vcpkg的download目录中即可
|
||||||
|
* 关于库下载错误,可以通过迅雷或其它工具下载,然后添加到download目录,注意从命令行确认保存的文件名
|
||||||
|
|
||||||
|
### 1.3 osg/osgEarth网络代理环境变量
|
||||||
|
|
||||||
|
* set OSGEARTH_HTTP_DEBUG=1
|
||||||
|
* set OSG_CURL_PROXY="127.0.0.1"
|
||||||
|
* set OSG_CURL_PROXYPORT=2801
|
||||||
|
|
||||||
|
## 2. 遇到某些库编译错误时,在本地修改代码并使用修改后的代码编译
|
||||||
|
|
||||||
|
正常使用vcpkg install xxxx安装库时,出现编译错误,通过编译日志可以定位到具体的编译错误,但是默认情况下每次install时,都会从压缩包中重新解压一份新的代码到本地临时目录,因此无法对源代码进行修改并使用修复后的代码进行编译安装,此时,只需要在install时,额外指定--editable选项,即可使本次编译不生成临时源码目录(在一个固定的源码目录中),然后可手工编辑修改此目录中源代码,然后再使用install(此时仍需指定--editable选项)安装,这时,就会使用修改后的代码进行编译了...
|
||||||
|
通过prompt启动,然后进入vcpkg目录
|
||||||
|
VCPKG install 库名 --editable,可以在编译前修改库源码
|
||||||
|
|
||||||
|
## 3. vcpkg ports内可以修改库的配置,如工程目录,windows SDK版本,以及部分错
|
||||||
|
|
||||||
|
## 4. 找不到Windows SDK库的错误修改:https://github.com/microsoft/vcpkg/issues/8288
|
||||||
|
|
||||||
|
## 5. vc错误: `error MSB4115: 函数“exists”只接受标量值,但其参数“$(ForceImportBeforeCppTargets)”的计算结果为`
|
||||||
|
|
||||||
|
* 报错信息:
|
||||||
|
> 1>节点 1 上的项目“xxxxxx\buildtrees\libpq\x64-windows-dbg\libpq.vcxproj”(默认目标)。
|
||||||
|
> 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Current.targets(14,11): error MSB4115: 函数“exists”只接受标量值,但其参数“$(ForceImportBeforeCppTargets)”的计算结果为“C:/Users/gz/Desktop/vcpkg-2023.08.09/scripts/buildsystems/msbuild/vcpkg.targets;C:/Users/gz/Desktop/vcpkg-2023.08.09/buildtrees/libpq/x64-windows-dbg/vcpkg-libs.props”,不是标量值。 [xxxxxx\buildtrees\libpq\x64-windows-dbg\libpq.vcxproj]
|
||||||
|
> 1>已完成生成项目“xxxxxx\buildtrees\libpq\x64-windows-dbg\libpq.vcxproj”(默认目标)的操作 - 失败。
|
||||||
|
* 参考链接:https://github.com/conan-io/conan/issues/7806
|
||||||
|
* 解决方案:
|
||||||
|
> 修改对应库ports目录内的msvc.cmake文件
|
||||||
|
> /p:ForceImportBeforeCppTargets=\"${SCRIPTS}/buildsystems/msbuild/vcpkg.targets\"
|
||||||
|
>
|
||||||
|
> /p:ForceImportBeforeCppTargets=\"${build_path}/vcpkg-libs.props\"
|
||||||
|
|
||||||
|
## 5. 编译GDAL 出现 +[](){}; 加号不明确
|
||||||
|
|
||||||
|
* 错误信息:
|
||||||
|
> xxxxxx\buildtrees\gdal\src\v3.7.1-30395dad39\ogr\ogrsf_frmts\openfilegdb\filegdbindex_write.cpp(1298): error C2593: “operator +”不明确
|
||||||
|
> xxxxxx\buildtrees\gdal\src\v3.7.1-30395dad39\ogr\ogrsf_frmts\openfilegdb\filegdbindex_write.cpp(1298): note: 可能是“内置 C++ operator+(void (__cdecl *)(std::vector<GByte,std::allocator<_Ty>> &,const __int64 &,int))”
|
||||||
|
> with
|
||||||
|
> [
|
||||||
|
> _Ty=GByte
|
||||||
|
> ]
|
||||||
|
> xxxxxx\buildtrees\gdal\src\v3.7.1-30395dad39\ogr\ogrsf_frmts\openfilegdb\filegdbindex_write.cpp(1298): note: 或 “内置 C++ operator+(void (__vectorcall *)(std::vector<GByte,std::allocator<_Ty>> &,const __int64 &,int))”
|
||||||
|
> with
|
||||||
|
> [
|
||||||
|
> _Ty=GByte
|
||||||
|
> ]
|
||||||
|
> xxxxxx\buildtrees\gdal\src\v3.7.1-30395dad39\ogr\ogrsf_frmts\openfilegdb\filegdbindex_write.cpp(1298): note: 尝试匹配参数列表“(OpenFileGDB::FileGDBTable::CreateSpatialIndex::<lambda_0019e43095a67889bd1988df31ec838d>)”时
|
||||||
|
* 原因分析:由于C++版本原因,低版本并不支持该转换,因此直接去掉转换即可
|
||||||
|
* 解决方法:尝试去掉lambda前面的加号(该加号用于将lambda表达式转为传统函数指针,兼容老代码)
|
||||||
|
|
||||||
|
## 6. Windows 7 Python 3.8
|
||||||
|
|
||||||
|
如果用到的库依赖了Python3.8以上的版本,是无法在windows7正常运行的,解决办法是用3.8狸猫换太子,无痛替换掉vcpkg自动下载的python
|
||||||
|
貌似打补丁也可以实现让windows7支持3.9.2运行
|
||||||
23
代码规范/README.md
Normal file
23
代码规范/README.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# [代码规范](./cppStyleGuide/StyleGuide.md)
|
||||||
|
|
||||||
|
引用模板
|
||||||
|
|
||||||
|
* [google cpp guide](https://google.github.io/styleguide/cppguide.html)
|
||||||
|
* [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines)
|
||||||
|
* Qt
|
||||||
|
* osg
|
||||||
|
* 源码文件编码(utf-8)
|
||||||
|
|
||||||
|
# [git仓库管理](./gitStore/git.md)
|
||||||
|
* 仓库创建流程
|
||||||
|
* git钩子
|
||||||
|
|
||||||
|
# 代码审查
|
||||||
|
|
||||||
|
* 代码规范检查
|
||||||
|
* C/C++ 静态代码检查工具cppCheck
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
|
||||||
|
* 快速搭建基础项目(持续更新)
|
||||||
|
* 编译器配置(持续更新)
|
||||||
61
代码规范/cppStyleGuide/StyleGuide.md
Normal file
61
代码规范/cppStyleGuide/StyleGuide.md
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# c++ 代码风格规范
|
||||||
|
|
||||||
|
## 源代码文件命名
|
||||||
|
|
||||||
|
##### 1. 前要
|
||||||
|
|
||||||
|
**通常情况下每个.cpp文件应该有一个配套的.h文件。当然也有例外的情况(例如:c++模板类的实现)。正确使用头文件会大大改善代码的可读性和执行文件的大小和性能.**
|
||||||
|
|
||||||
|
> 头文件应能独立编译,就是头文件的使用者和构建工具在导入文件时无需任何特殊的前提条件就能完成代码编译。具体来说,头文件要有头文件防护符,并导入它所需的所有其它头文件。
|
||||||
|
> 当编写c++模板时应保证模板的实现声明和实现都在同一个文件里。一般,写模板时源码文件以.hpp命名。
|
||||||
|
> 避免编写依赖某个构建工具的代码。(例如:项目的构建依赖于VSCode的一个插件,使用其他的构建工具,项目无法构建且生成)
|
||||||
|
> 避免前向声明
|
||||||
|
|
||||||
|
##### 2. 文件命名
|
||||||
|
|
||||||
|
* **新建c++类[.h 或 .hpp]**
|
||||||
|
|
||||||
|
> 新建类文件时,尽量保证文件名与导出(外部调用)的类名保持一致(一个头文件中可能包含好几个类)。
|
||||||
|
> Help.h
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
class Help{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Help.hpp
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
template<typename T>
|
||||||
|
class Help{}
|
||||||
|
```
|
||||||
|
|
||||||
|
##### 3. 防护符
|
||||||
|
|
||||||
|
* **要保证头文件带有防护重复引用预处理头**
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#pragma once
|
||||||
|
```
|
||||||
|
|
||||||
|
或
|
||||||
|
|
||||||
|
```cpp
|
||||||
|
#ifndef HELP_H
|
||||||
|
#define HELP_H
|
||||||
|
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
## 命名规范
|
||||||
|
|
||||||
|
##### 1. 命名空间[namespace]
|
||||||
|
##### 2. 类[class]
|
||||||
|
##### 3. 结构体[struct]
|
||||||
|
##### 4. 模板[template]
|
||||||
|
##### 5. 私有函数或变量[private]
|
||||||
|
##### 6. 共有函数或变量[public]
|
||||||
|
##### 7. 受保护函数或变量[protected]
|
||||||
|
##### 8. 预处理[#define]
|
||||||
|
##### 9. 内联函数[inline]
|
||||||
|
##### 10. 常量[const]
|
||||||
|
##### 11. 静态变量或函数[static]
|
||||||
1
代码规范/gitStore/git.md
Normal file
1
代码规范/gitStore/git.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
||||||
@ -15,16 +15,18 @@
|
|||||||
## 2. 使用流程
|
## 2. 使用流程
|
||||||
### 2.1 账户初始化
|
### 2.1 账户初始化
|
||||||
系统默认为团队成员创建了以自己姓名命名的账户,首次使用需要通过该链接:[密码重置链接](http://192.168.1.11:9888/) 设置用户密码使用(每个用户可设置一次密码),如忘记密码,可联系管理员重置。
|
系统默认为团队成员创建了以自己姓名命名的账户,首次使用需要通过该链接:[密码重置链接](http://192.168.1.11:9888/) 设置用户密码使用(每个用户可设置一次密码),如忘记密码,可联系管理员重置。
|
||||||

|
|
||||||
|
[](http://192.168.1.11:9888/)
|
||||||
### 2.2 连接共享目录
|
### 2.2 连接共享目录
|
||||||

|

|
||||||
1. 打开计算机文件管理器
|
1. 打开计算机文件管理器
|
||||||
2. 在【此电脑】右键
|
2. 在【此电脑】右键
|
||||||
3. 在弹出的菜单中,点击【映射网络驱动器】
|
3. 在弹出的菜单中,点击【映射网络驱动器】
|
||||||
4. 在弹出的界面中,【文件夹】输入框输入 **\\192.168.1.11\Shared**
|
4. 在弹出的界面中,【文件夹】输入框输入 **\\\\192.168.1.11\\Shared**
|
||||||
5. 勾选输入框下面的【登陆时重新连接】和【使用其他凭据连接】
|
5. 勾选输入框下面的【登陆时重新连接】和【使用其他凭据连接】
|
||||||
6. 点击【完成】按钮
|
6. 点击【完成】按钮
|
||||||
7. 在弹出的界面中输入用户名和密码,并勾选【记住我的凭据】
|
7. 在弹出的界面中输入用户名和密码,并勾选【记住我的凭据】
|
||||||
8. 点击【确定】按钮
|
8. 点击【确定】按钮
|
||||||
9. 如无误,则在计算机界面中会成功添加一个新的网络磁盘。
|
9. 如无误,则在计算机界面中会成功添加一个新的网络磁盘。
|
||||||
|
|
||||||

|

|
||||||
Reference in New Issue
Block a user