title: How to call/Link GLPK for Windows in Makefile? [cannot find -lglpk]
body: <p>I am trying to use an open-source program called PumpKin, which is a plasma kinetics solver.</p>
  <p>It works with Makefile, and the Makefile uses g++ and GLPK. So I installed g++ via MinGW, downloaded GLPK for Windows, unzipped it, and placed it in C drive. g++ was not problematic. The environmental variable was also added in Path like below:</p>
  <pre><code>C:\MinGW\bin
  C:\glpk-5.0\w64
  </code></pre>
  <p>The following is the entire code of the Makefile.</p>
  <pre><code>OBJ = PumpKin.o pk_IO.o pk_Array.o pk_Pathways.o pk_Print.o
  #Auxiliary.o Tests.o Print.o Pathways.o Optimize.o OptimizeDifferent.o
  
  #CFLAGS    = -std=gnu++0x -g 
  DFLAGS    = -DCOMPILING_HOSTNAME=\&quot;$(HOSTNAME)\&quot;
  INCLUDE_DIRS += -I/opt/local/include -I$(HOME)/include
  #LFLAGS    =  -stdlib=libc++
  LIBS =  -L/opt/local/lib -lglpk -lm 
  #LIBS += = -L/usr/local/NLopt/lib -lnlopt -lm
  CC   = g++
  LINK = g++
  
  all:    pumpkin
  
  %.o:    %.cpp
      $(CC) $(CFLAGS) $(DFLAGS) $(INCLUDE_DIRS) -O3 -o $@ -c $&lt; 
  #   $(CC) $(CFLAGS) $(DFLAGS) $(INCLUDE_DIRS) -g -o $@ -c $&lt; 
  
  %.o:    %.cc
      $(CC) $(CFLAGS) $(DFLAGS) $(INCLUDE_DIRS) -g -o $@ -c $&lt; 
  
  pumpkin:  $(OBJ)
      $(LINK) $(LFLAGS) -std=gnu++0x $(OBJ) -o $@ $(LIBS)
  
  
  clean:  
  rm *.o *.*~ pumpkin 2&gt; /dev/null
  </code></pre>
  <p>But when I type &quot;make&quot; in the prompt, it returns an error that says &quot;cannot find -lglpk&quot;</p>
  <pre><code>D:\workfiles\pumpkin-1.5\src&gt;make
  
  g++  -std=gnu++0x PumpKin.o pk_IO.o pk_Array.o pk_Pathways.o pk_Print.o -o pumpkin -L/opt/local/lib -lglpk -lm
  c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lglpk
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  <p>I guess it is because the directory of GLPK is not properly directed, but I am not sure.</p>
  <p>I am very new to Makefile programming, and I actually do not understand a single command in this Makefile.</p>
  <p>I am studying about it, but I wonder if this is a simple problem so someone may be able to fix it at a glance.</p>
  <p>Thank you for your replies.</p>