首先下载qt,我这里使用的是qt5.14.2,下载挺快的。

image-20220316082852120

We recommend to use Qt 5.12 or later. You must select Qt Script and msvc2017/msvc2019 among so many checkboxes.

Add C:\Qt\Qt5.15.12 to your PATH variable - you should add string C:\Qt\Qt5.15.12\msvc2019;C:\Qt\Qt5.15.12\msvc2019\bin for 32-bit or C:\Qt\Qt5.15.12\msvc2019_64;C:\Qt\Qt5.15.12\msvc2019_64\bin for 64-bit to PATH variable. (Replace the version numbers of Qt and the version of Visual Studio (2017/2019) with the version that you have installed)

https://github.com/Stellarium/stellarium/blob/master/BUILDING.md

接着下载github上stellarium的源码。

image-20220316082946891

image-20220316084705332

接着下载cmake

image-20220316083021304

image-20220316085856109

接着将stellarium文件中的CMakeLists.txt拖进qt creator中,将自动能展开,但出现一些问题

image-20220315234126876

image-20220316085005174

然后稍微改改字符,就可以运行了。

对代码的修改如下:

image-20220316111236063