How to compile a minimal MathGL version - Google Groups

10 downloads 117 Views 350KB Size Report
Steps: 1. Install Visual Studio and CMake. 2. Extract MathGL sourcecode to a directory of your choice. I will reference
How to compile a minimal MathGL version (only GLUT support) with Microsoft Visual Studio 2010. Requirements:  

 

Microsoft Visual Studio 2010 (any edition, I used Ultimate edition) MathGL 2.2 sourcecode (http://sourceforge.net/projects/mathgl/files/mathgl/mathgl%202.2/mathgl2.2.tar.gz/download) Glut 3.7 Binaries (http://www.opengl.org/resources/libraries/glut/glut37.zip) CMake 2.8.11 (http://www.cmake.org/files/v2.8/cmake-2.8.12.1-win32-x86.exe)

Steps: 1. 2. 3. 4. 5.

Install Visual Studio and CMake. Extract MathGL sourcecode to a directory of your choice. I will reference it as “sourceDir”. Extract Glut Binaries to a location of your choice. Let’s call it “glutDir”. Start CMake-gui. Select sourceDir in both empty fields at the top (“Where is source code:”, “Where to build the binaries”). 6. Click Configure and choose Visual Studio 10 (some errors should appear, that’s normal) 7. Make the same selection as I did:

8. Click Configure again (again some errors). 9. Change GLUT_INCLUDE_DIR to glutDir

10. Change GLUT_glut_LIBRARY to “glut32” (see picture)

11. Click Configure and then Generate. (No errors!) 12. Start the created MathGL.sln in sourceDir.

13. Select “Release” in the top bar.

14. Right-click on “mgl-glut” in the solution explorer and choose “Properties”

15. Add your glutDir to “Additional Librarydirectories”, so that the complete Line should look like in the picture. ATTENTION: Don’t forget the delimiter “;”.

16. Right-click on “ALL_BUILD” in the solution explorer and choose “build”.

17. Now should compile everything without any error. 18. You will find the binaries in /src/Release and /widgets/Release. Copy them into a separate directory, together with the include directory /include and you have everything in one place. 19. You are ready to use MathGL. In order to use it in your own project, include the “include” directory to “Additional Includedirectories” and the binaries of MathGL and GLUT to “Additional Librarydirectories”. Also add the binaries to your PATH. The last step is to add both lib-files to “Additional Dependencies”.