OpenGL + Mesa 3D + MinGW [英] OpenGL + Mesa 3D + MinGW

查看:196
本文介绍了OpenGL + Mesa 3D + MinGW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在(Ubuntu)Linux上对C ++应用程序进行编程,然后将它们编译为2个操作系统:通过使用"g ++"(GNU C ++编译器)在 Linux 上进行本机处理,并将它们交叉编译为 Windows 通过使用"i386-mingw32-g ++"(MinGW C ++交叉编译器).

I program C++ applications on (Ubuntu) Linux and compile them to 2 operating systems: natively to Linux by using "g++" (GNU C++ compiler) and cross-compile them to Windows by using "i386-mingw32-g++" (MinGW C++ cross-compiler).

现在,我正在尝试交叉编译"OpenGL"应用程序(从Linux到Windows)-为此,我需要一些OpenGL库文件.
作为OpenGL的实现,我使用"Mesa 3D"开源库.幸运的是,Ubuntu为Linux提供了预编译"的mesa3d库( libgl1-mesa-dev libglu1-mesa-dev ),但是不幸的是,没有任何预编译的库可供使用使用MinGW交叉编译器(因此是Windows版本)-因此,我必须"从源代码"手动编译它们(可以从

Now, I am trying to cross-compile "OpenGL" applications (from Linux to Windows) - for that I need some OpenGL library files.
As an implementation of OpenGL, I use "Mesa 3D" open source library. Fortunately, Ubuntu offers "precompiled" mesa3d libraries (libgl1-mesa-dev and libglu1-mesa-dev) for Linux, but unfortunately, there are not any precompiled libraries for using with MinGW cross-compiler (thus Windows versions of them) - so I "MUST" manually compile them "from source" (which can be downloaded from http://www.mesa3d.org homepage).

但是我不知道要这样做.在mesa3d源代码中,有一些文档说明如何为某些特定平台构建库-特别是有"README.MINGW32"自述文件.
但是只是在第一行上就有一些命令

But I have no idea to do that. Within the mesa3d source code, there are some documents how to build the libraries for some specific platforms - specifically there is "README.MINGW32" readme file.
But just on the first lines there is some command

mingw32-make -f Makefile.mgw [OPTIONS...]

我没有安装任何"mingw32-make"程序,因此无法运行.通过其他软件,我曾经使用经典"来构建它们

which I cannot run because I don't have any "mingw32-make" program installed. By other softwares, I used to build them with the "classic"

./configure -> make -> make install

过程,但这不适用于mesa3d库.
例如,我也尝试过

procedure, but this is not working on mesa3d libraries.
For example, I have also tried

./configure --host=i386-mingw32

它已经配置好,但是在键入后

and it has been configured ok but after typing

make

它抛出了一些错误

error: #error No PIPE_SUBSYSTEM_WINDOWS_xxx subsystem defined.

现在我迷失了:-(.

那么有人知道如何构建将它们与mingw32结合使用的mesa3d库吗?

So does anybody know how to build the mesa3d libraries for using them with mingw32?

P.S.:当然,我不想使用Microsoft Visual Studio从来没有更多:-).我也想做所有必要的事情,以从Linux建立OpenGL环境并使用mingw32进行交叉编译.我希望有可能.

P.S.: And of course, I DON'T WANT to use Microsoft Visual Studio NEVER MORE :-) . And also I would like to do all the required things to build up OpenGL environment from Linux and using mingw32 for cross-compiling. I hope it is possible.

PS2: http://www.mesa3d.org/systems上.html 页中写道,"MinGW与Mesa 3D结合使用已被弃用".我正以正确的方式使用它吗?

P.S.2: On http://www.mesa3d.org/systems.html page there is written that using MinGW with Mesa 3D is "deprecated". I am on the right way to use it just that way?

推荐答案

无需为MinGW编译Mesa3D. MinGW包括GL库;它不被称为libGL.alibGLU.a;这些库分别称为libopengl32.alibglu32.a.可悲的是,这就是Microsoft决定在Visual Studio的Windows下将它们称为它们"的原因,因此Windows和MinGW的GNU/Linux版本都决定包含上述命名的库.

There is no need to compile Mesa3D for MinGW. MinGW includes the GL library; it's just not called libGL.a nor libGLU.a; the libraries are instead called libopengl32.a and libglu32.a. Sadly, this is what Microsoft decided to call them under Windows on Visual Studio, so both Windows and GNU/Linux release of MinGW decided to include the libraries named as above.

因此,在Windows交叉编译时,只需更改:

So, when cross compiling for Windows, just change:

-lGL -lGLU

进入

-lopengl32 -lglu32


GNU/Linux上的

Mesa3D实际上是OpenGL的 lib 实现的名称.这是因为OpenGL是商标,并且SGI的政策不允许任何人在不支付巨额费用的情况下使用该名称.尽管如此,SGI还是为作者Brian Paul提供了测试套件的副本.


Mesa3D on GNU/Linux is actually a name for a libre implementation of OpenGL. This is because OpenGL is a trademark, and SGI's policy did not allow for anyone to use the name without paying a hefty sum of money. Despite this, SGI provided the author, Brian Paul, a copy of the testing suite.

Mesa3D在大多数具有本机OpenGL实现的平台上都被称为软件健全性检查"库,它具有许多仅用于高端硬件的功能的仿真.但是在GNU/Linux上,更重要的是称为DRI或直接渲染接口的东西.这是真正的交易,包括硬件加速和所有方面.该库也称为Mesa3D.实际上,为DRI进行配置是Mesa3D以及X11和内核的一部分.

Mesa3D is on most platforms with native OpenGL implementation known as a software "sanity check" library with emulation of numerous high-end-hardware-only features. But on GNU/Linux, much more important is something called DRI or direct rendering interface. This is the real deal, the hardware acceleration and all. This library is also called Mesa3D; in fact, provisioning for DRI is a part of Mesa3D as well as of X11 and the kernel.

Mesa3D在GNU/Linux和其他免费平台上提供了 libre 兼容OpenGL的标头.

Mesa3D provides libre OpenGL-compatible headers on GNU/Linux and other free platforms.

摘要::Mesa3D是OpenGL的GNU/Linux实现的名称,因为该名称是商标.该库包括出色,功能强大,正确且相对较快的软件实现.它还包括用于硬件加速的直接渲染界面.

Summary: Mesa3D is the name for the GNU/Linux implementation of OpenGL since that name is trademarked. This library includes an excellent, featureful, correct and relatively fast software implementation. It also includes direct rendering interface for hardware acceleration.

这篇关于OpenGL + Mesa 3D + MinGW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆