|
| 1 | +freeglut 3.0.0-1.mp for MinGW |
| 2 | + |
| 3 | +This package contains freeglut import libraries, headers, and Windows DLLs. |
| 4 | +These allow 32 and 64 bit GLUT applications to be compiled on Windows using |
| 5 | +MinGW. Both static and shared versions of the library are included. |
| 6 | + |
| 7 | +For more information on freeglut, visit http://freeglut.sourceforge.net/. |
| 8 | + |
| 9 | + |
| 10 | +Installation |
| 11 | + |
| 12 | +Create a folder on your PC which is readable by all users, for example |
| 13 | +�C:\Program Files\Common Files\MinGW\freeglut\� on a typical Windows system. |
| 14 | +Copy the �lib\� and �include\� folders from this zip archive to that location. |
| 15 | + |
| 16 | +The appropriate freeglut DLL can either be placed in the same folder as your |
| 17 | +application, or can be installed in a system-wide folder which appears in your |
| 18 | +%PATH% environment variable. Be careful not to mix the 32 bit DLL up with the 64 |
| 19 | +bit DLL, as they are not interchangeable. |
| 20 | + |
| 21 | + |
| 22 | +Compiling 32 bit Applications |
| 23 | + |
| 24 | +If you want your application to be compatible with GLUT, you should |
| 25 | +�#include <GL/glut.h>�. If you want to use freeglut specific extensions, you |
| 26 | +should �#include <GL/freeglut.h>� instead. |
| 27 | + |
| 28 | +Given a source file �test.c�, which you want to compile to an application |
| 29 | +�test.exe� dynamically linking to the DLL, you can compile and link it with the |
| 30 | +following commands (replacing the include and lib paths with the ones you |
| 31 | +created above if necessary): |
| 32 | + |
| 33 | + gcc -c -o test.o test.c -I"C:\Program Files\Common Files\MinGW\freeglut\include" |
| 34 | + gcc -o test.exe test.o -L"C:\Program Files\Common Files\MinGW\freeglut\lib" -lfreeglut -lopengl32 -Wl,--subsystem,windows |
| 35 | + |
| 36 | +Don�t forget to either include the freeglut DLL when distributing applications, |
| 37 | +or provide your users with some method of obtaining it if they don�t already |
| 38 | +have it! |
| 39 | + |
| 40 | + |
| 41 | +Compiling 64 bit Applications |
| 42 | + |
| 43 | +Building 64 bit applications is almost identical to building 32 bit applications. |
| 44 | +The only difference is that you should change the library path on the command |
| 45 | +line to point to the x64 directory: |
| 46 | + |
| 47 | + gcc -c -o test.o test.c -I"C:\Program Files\Common Files\MinGW\freeglut\include" |
| 48 | + gcc -o test.exe test.o -L"C:\Program Files\Common Files\MinGW\freeglut\lib\x64" -lfreeglut -lopengl32 -Wl,--subsystem,windows |
| 49 | + |
| 50 | + |
| 51 | +Static Linking |
| 52 | + |
| 53 | +To statically link the freeglut library into your application, it�s necessary to |
| 54 | +define �FREEGLUT_STATIC� when compiling the object files. It�s also necessary to |
| 55 | +link the static version of the freeglut library, along with the GDI and Windows |
| 56 | +multimedia libraries which freeglut depends upon: |
| 57 | + |
| 58 | + gcc -c -o test.o test.c -D FREEGLUT_STATIC -I"C:\Program Files\Common Files\MinGW\freeglut\include" |
| 59 | + gcc -o test.exe test.o -L"C:\Program Files\Common Files\MinGW\freeglut\lib" -lfreeglut_static -lopengl32 -lwinmm -lgdi32 -Wl,--subsystem,windows |
| 60 | + |
| 61 | +The �-Wl,--subsystem,windows� is needed in each case so that the application |
| 62 | +builds as a Windows GUI application rather than a console application. If you |
| 63 | +are using GLU functions you should also include �-lglu32� on the command line. |
| 64 | + |
| 65 | +When statically linking a 64 bit build, you should change the library path as |
| 66 | +detailed under the �Compiling 64 bit Applications� section. |
| 67 | + |
| 68 | + |
| 69 | +Full Tutorial |
| 70 | + |
| 71 | +Please visit http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/ |
| 72 | +for a complete guide on using GLUT and freeglut with MinGW. |
| 73 | + |
| 74 | + |
| 75 | +Cross-Compilation |
| 76 | + |
| 77 | +I�ve not covered the setup of freeglut for use in cross-compilation, i.e. when |
| 78 | +building Windows freeglut applications using a Linux system. Setting freeglut up |
| 79 | +with MinGW on other operating systems can be done following the instructions |
| 80 | +above, except that the paths will be different. |
| 81 | + |
| 82 | + |
| 83 | +Problems? |
| 84 | + |
| 85 | +If you have problems using this package (compiler / linker errors etc.), please |
| 86 | +check that you have followed all of the steps in this readme file correctly. |
| 87 | +Almost all of the problems which are reported with these packages are due to |
| 88 | +missing a step or not doing it correctly, for example trying to build a 32 bit |
| 89 | +app against the 64 bit import library. If you have followed all of the steps |
| 90 | +correctly but your application still fails to build, try building a very simple |
| 91 | +but functional program (the example at |
| 92 | +http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/ is ideal). A |
| 93 | +lot of people try to build very complex applications after installing these |
| 94 | +packages, and often the error is with the application code or other library |
| 95 | +dependencies rather than freeglut. |
| 96 | + |
| 97 | +If you still can�t get it working after trying to compile a simple application, |
| 98 | +then please get in touch via http://www.transmissionzero.co.uk/contact/, |
| 99 | +providing as much detail as you can. Please don�t complain to the freeglut guys |
| 100 | +unless you�re sure it�s a freeglut bug, and have reproduced the issue after |
| 101 | +compiling freeglut from the latest SVN version�if that�s still the case, I�m sure |
| 102 | +they would appreciate a bug report or a patch. |
| 103 | + |
| 104 | + |
| 105 | +Changelog |
| 106 | + |
| 107 | +2015-03-15: Release 3.0.0-1.mp |
| 108 | + |
| 109 | + � First 3.0.0 MinGW release. I�ve built the package using MinGW, and the only |
| 110 | + change I�ve made is to the DLL version resource�I�ve changed the description |
| 111 | + so that my MinGW and MSVC builds are distinguishable from each other (and |
| 112 | + other builds) using Windows Explorer. |
| 113 | + |
| 114 | + |
| 115 | +Transmission Zero |
| 116 | +2015-03-15 |
| 117 | + |
| 118 | +http://www.transmissionzero.co.uk/ |
0 commit comments