I have installed codeblocks 64 bit with mingw. How can I install glut in codeblocks 64 bit with mingw?
Download glut, build it and use the project wizard in codeblocks
Are you telling to download glut source code?
Yes, download the source code, build it according the instruction of the glut site, and then you can use the codeblocks wizard. Point it where it asks and it should work...
Here is probably an instruction https://www.transmissionzero.co.uk/computing/using-glut-with-mingw/
I have just tested FreeGlut and it is easy to compile and use; Just use CMake-GUI to generate MinGW makefiles in a new folder (p.e freeglut-3.2.1\Build), open a console in that folder and run mingw32-make. You can then copy the lib folder inside Build to freeglut-3.2.1 and create a global variable in C::B called glut containing the path to the library (p.e. C:\Libraries\freeglut-3.2.1) in the base field and nothing in the other fields.
Then use the wizard to create the project. The only problem I have found with the wizard is the Execution Working Dir being set to $(#glut)/bin when it should be just bin/ . You will need to copy the Build\bin\libfreeglut.dll near the executable.
Other problem with the wizard is with the use of global variables, I specified $(#freeglut) in the wizard but the generated project used a mix of glut and freeglut. In a second try I had to use glut to work around the mix.
I have installed codeblocks-20.03mingw-setup.exe. How will I compile freeglut-3.2.1?
Make sure your compiler path is in the path variable:
search for gcc.exe in the codeblocks folder.
Check if the path to gcc.exe is in the PATH variable of windows. To check this, open the start menu and type "system environment variables" in the opening dialog -> "Environment variables" -> Uservariables for XXXXXX -> double click on the PATH. Check if the path to gcc is there. If not add it by pressing the "Browse" button
Now install CMake
Open CMake gui and follow a build instruction for freeglut in the internet....
Then you can follow the direction of miguel gimenez...
I have downloaded freeglut from https://www.transmissionzero.co.uk/files/software/development/GLUT/freeglut-MinGW.zip
Will it work with codeblocks-20.03mingw-setup.exe?
Link to readme from OP last link.https://www.transmissionzero.co.uk/files/software/development/GLUT/Readme.txt (https://www.transmissionzero.co.uk/files/software/development/GLUT/Readme.txt)
Tim S.
https://www.transmissionzero.co.uk/files/software/development/GLUT/freeglut-MinGW.zip , downloading this worked with mingw 32 bit.
I have tried to install from source code of freeglut-3.2.1. I have run CMake (cmake-gui). I have selected mingw-makefile from cmake-gui. Clicked configure twice, configure is done, then clicked generate, generate is done. From a CMD command line window, from the directory where cmake made makefile and it is freeglut-3.2.1\build, I ran mingw32-make. Then I got some errors.
error: subscripted value is neither array nor pointer nor vector
155 | if (pRawInput->data.hid.bRawData[0] ==
CMakeFiles\freeglut.dir\build.make:543: recipe for target 'CMakeFiles/freeglut.dir/src/mswin/fg_spaceball_mswin.c.obj' failed
mingw32-make[2]: *** [CMakeFiles/freeglut.dir/src/mswin/fg_spaceball_mswin.c.obj] Error 1
CMakeFiles\Makefile2:170: recipe for target 'CMakeFiles/freeglut.dir/all' failed
mingw32-make[1]: *** [CMakeFiles/freeglut.dir/all] Error 2
Makefile:147: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
What will I do?
The compilation of the library is out of the scope of this forum. Can you check if the libraries have been already created?. The error may be in the compilation of a sample. You should see two .a files in the lib folder and a file called freeglut.dll in the bin folder.
Does anyone have reason to believe freeglut can be compiled with an 64 bit version of MinGW GCC?
If yes, please state why you believe this.
Edit: I found that the MSys2 MINGW 64 bit version exists.
But, it uses this patch.
--- a/CMakeLists.txt 2019-09-25 23:43:34.000000000 +0300
+++ b/CMakeLists.txt 2019-09-30 21:10:08.047600000 +0300
@@ -67,16 +67,12 @@
SET(FREEGLUT_HEADERS
+ include/GL/glut.h
include/GL/freeglut.h
include/GL/freeglut_ucall.h
include/GL/freeglut_ext.h
include/GL/freeglut_std.h
)
-IF(FREEGLUT_REPLACE_GLUT)
- LIST(APPEND FREEGLUT_HEADERS
- include/GL/glut.h
- )
-ENDIF()
SET(FREEGLUT_SRCS
${FREEGLUT_HEADERS}
src/fg_callbacks.c
It may or may not be related to the OP build problem.
Tim S.
I commonly use freeglut 3.2.1 compiled in 64 bits. I have made no patches. I have followed some instructions in https://www.transmissionzero.co.uk/computing/using-glut-with-mingw/ where you can find freeglut dlls for 32 and 64 bits. But I also built a cbp file attached here and placed directly in my freeglut-3.2.1 folder (with src, include, ... subfolders), of course adapted to my installation, but should work without many modifications.
If that can help.