Installing igraph for R fails: "fatal error: glpk.h: No such file or directory"

/mingw32/bin/gcc  -I"R:/PSG Files/Semester 5/Statistics for Engineers/R-4.1.1/include" -DNDEBUG -I/mingw32/include/libxml2 -I/mingw32/include -DLIBXML_STATIC -DUSING_R -DHAVE_FMEMOPEN=0 -DHAVE_OPEN_MEMSTREAM=0 -DHAVE_RINTF -DWin32 -DHAVE_LIBXML -DHAVE_UNISTD_H -Wall -DPACKAGE_VERSION=\"1.2.8\" -DHAVE_FMIN=1 -DHAVE_LOG2=1 -DHAVE_SNPRINTF -Ics -I/mingw32/include -DHAVE_GLPK=1 -Iplfit -Iprpack -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -I. -Iinclude -ISuiteSparse_config -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -I/mingw32/include -DINTERNAL_SUITESPARSE      -DINTERNAL_ARPACK -I. -I/mingw32/include -DHAVE_GFORTRAN   -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c feedback_arc_set.c -o feedback_arc_set.o
In file included from feedback_arc_set.c:31:
igraph_glpk_support.h:36:10: fatal error: glpk.h: No such file or directory
 #include <glpk.h>
          ^~~~~~~~
compilation terminated.
make: *** [R:/PSG Files/Semester 5/Statistics for Engineers/R-4.1.1/etc/i386/Makeconf:238: feedback_arc_set.o] Error 1
ERROR: compilation failed for package 'igraph'
* removing 'R:/PSG Files/Semester 5/Statistics for Engineers/R-4.1.1/library/igraph'
* restoring previous 'R:/PSG Files/Semester 5/Statistics for Engineers/R-4.1.1/library/igraph'
Warning in install.packages :
  installation of package ‘igraph’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\ranga\AppData\Local\Temp\Rtmp48RMAU\downloaded_packages’

Can someone help me with this issue ?

Update: The solution is now described here:


Please see what I wrote here.

We recommend that you wait for the binary release. You can use 1.2.7 until a binary becomes available for 1.2.8.

If you still want to compile it from source, you need to install GLPK in such a way that it becomes available to your compiler. If you are using Rtools4, the documentation is here: Using Rtools4 on Windows See “Using pacman” for how to install libraries such as GLPK.