编译环境: qgis3.16.7+win11+vs2015+cmake3.24.1
按照官网进行配置。
便捷配置:在 CMAKE 中添加 CMAKE_PREFIX_PATH
CMAKE_PREFIX_PATH=C:/cygwin64/bin;C:/OSGeo4W64;C:/OSGeo4W64/apps/Qt5;C:/OSGeo4W64/apps/Python37
编译问题汇总:
1、Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
解决:a. 删除C:/cygwin64/bin/pkg-config
b. 复制C:/cygwin64/bin/pkgconf.exe,并重命名为pkg-config
2、SETUPAPI_LIBRARY 和 VERSION_LIBRARY生成工程可能不无使用问题:
解决:a.找到 C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/
b.SETUPAPI_LIBRARY 设置为a目录下的 SetupAPI.Lib
c.VERSION_LIBRARY 设置为a目录下的 Version.Lib
3、“Fatal Python error : initfsencoding: unable to load the file system codec”错误
解决:添加环境变量 变量名 PYTHONHOME,变量值 C:\OSGeo4W\apps\Python37
4、CMake Error at cmake/FindPyQt5.cmake:55 (MESSAGE): Could not find PyQt5
解决:修改c:\OSGeo4W64\apps\Python37\lib\site-packages\sipconfig.py中的_pkg_config段配置路径。
# These are installation specific values created when SIP was configured.
_pkg_config = {
'arch': '',
'default_bin_dir': 'C:\\OSGeo4W64\\apps\\Python37',
'default_mod_dir': 'C:\\OSGeo4W64\\apps\\Python37\\Lib\\site-packages',
'default_sip_dir': 'C:\\OSGeo4W64\\apps\\Python37\\sip',
'deployment_target': '',
'platform': 'win32-msvc2015',
'py_conf_inc_dir': 'C:\\OSGeo4W64\\apps\\Python37\\include',
'py_inc_dir': 'C:\\OSGeo4W64\\apps\\Python37\\include',
'py_lib_dir': 'C:\\OSGeo4W64\\apps\\Python37\\libs',
'py_version': 0x030700,
'qt_framework': 0,
'sip_bin': 'C:\\OSGeo4W64\\apps\\Python37\\Scripts\\sip',
'sip_config_args': '--destdir C:\\OSGeo4W64\\apps\\Python37\\lib\\site-packages --bindir C:\\OSGeo4W64\\apps\\Python37\\Scripts --incdir C:\\OSGeo4W64\\apps\\Python37\\include',
'sip_inc_dir': 'C:\\OSGeo4W64\\apps\\Python37\\include',
'sip_module_dir': 'C:\\OSGeo4W64\\apps\\Python37\\lib\\site-packages',
'sip_root_dir': 'C:\\OSGeo4W64\\apps\\Python37\\lib\\site-packages',
'sip_version': 0x04130e,
'sip_version_str': '4.19.14',
'universal': ''
}
5、编译过程中的其它的问题,需要核对源码的编码格式

1839

被折叠的 条评论
为什么被折叠?



