Stellarium-0.8.2 Building with MinGW32 编译记录全
// 官方网站关于stellarium编译的说明
Building with MinGW32
Installation of the win32 development tools From http://www.mingw.org/download.shtml download and install MinGW-4.1.1.exe, MSYS-1.0.10.exe and msysDTK-1.0.1.exe
Installation of the libraries Stellarium needs libpng, libz, libSDL, (and optionally libSDLmixer) to compile : I first tried to install them by hand without success (but it should be possible). Instead I found a much more convenient way of doing it : from http://www.bloodshed.net/download.html download and install the IDE "DevC++". Then from within the program use the integrated package manager to automatically install the 4 libraries mentioned before. Finally copy all the files (".h", ".a" and don't forget the 2 scripts "sdl-config" and "libpng-config") related to those libraries from your DevC++ include/, libs/ and bin/ directory to the minGW include/ ,libs/ and bin/ directories.
TIP: I personally had quite some troubles before the sdl-config and libpng-config script were properly found by the install script. If I remember well I had to rename the sdl-config script which had a slightly different name in the win32 package.
From version 0.8.0, Stellarium uses C++ wstring which are unfortunately not yet supported by the libstdc++ shipped with MinGW32. It is however possible to compile using the STLPort library. Download version 5.0.2 on sourceforge (http://sourceforge.net/project/showfiles.php?group_id=146814) and follow the instructions for compiling the libstlport.5.0.dll.a and libstlport.5.0.dll libraries.
Compiling
Step 1) Open an MSYS console, from a tar archive, untar the sourcecode archive
tar -xzf stellarium-0.8.0.tgz
cd stellarium-0.8.0
or if you start from a fresh CVS tree :
./autogen.sh
上面的就不必说了,一切按照写的做就可以了
Step 2) Now because we need to use STLport libstdc++ headers and library instead of the ones shipped with Mingw32, we must tell the compiler where to find the right ones and also to give it the right flags to perform a correct compilation. This can be done by setting the following environment variables (replace "/home/gerard/" with the path where you installed STLport) :
export CFLAGS="-Wall -O3 -s -fexceptions -fident -mthreads -D_STLP_NO_CUSTOM_IO -D_STLP_USE_DYNAMIC_LIB -
I/export/home/ptr/workshop/extern/boost -I/home/gerard/STLport/stlport -L/home/gerard/STLport/lib"
export CPPFLAGS="-Wall -O3 -s -Wsign-promo -fexceptions -fident -mthreads -D_STLP_NO_CUSTOM_IO -D_STLP_USE_DYNAMIC_LIB -
I/export/home/ptr/workshop/extern/boost -I/home/gerard/STLport/stlport -L/home/gerard/STLport/lib -I/include/freetype2"
export LDFLAGS="-Wall -O3 -s -Wsign-promo -fexceptions -fident -mthreads -L/home/gerard/STLport/lib -lstlport.5.0"
export LIBS=" -lstlport.5.0"
注意事项:1."-O3" 中是"欧3" 而不是"零3"
2.参数必须写的一点都不错,否则会出现很多未知错误,所以写完要检查一遍。
3.localname.c内的代码需要做一些修改,才能编译过去,详见修改后的文件
Step 3) You can then run the normal configure script
./configure
预编译结果存储在config.log文件 正常生成的config.log文件有238KB,而且编译器不会提示任何error信息
then if everything goes well :
make
Step 4) If compilation succeed, try to run stellarium as a local version :
./src/stellarium
生成的exe文件在src目录下
附:MinGW常用的命令:
./configure
make
make clean
make install
cd d:/build-MinGW//SourceCode//stellarium-0.8.2
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)