Installing/compiling in Cygwin/MinGW - How to set the include “path”? (symbolic link?)

前端 未结 4 1206
梦如初夏
梦如初夏 2021-01-12 19:33

I have been trying to install/compile C libraries in Windows 7 using Cygwin and MinGW. However, I am getting errors like these during make:

sys/         


        
相关标签:
4条回答
  • 2021-01-12 20:13

    Build libigraph with minGW without having "sys/times.h"

    That may be interesting for all building "igraph" and don't want to create it with "cygwin" but with "mingw".

    In my "msys / mingw" environment, I have my "source code" in. "C:\msys\1.0\src" directory.
    igraph dir. == C:\msys\1.0\src\igraph-0.6

    • Run c:\msys\1.0\msys.bat
    • cd to the top root cd /
    • cd to igraph cd usr/src/igraph-0.6
      Note: There is no usr folder in C:\msys\1.0\. Take care do'nt create a usr folder !!!
    • Type ./configure Now the msys shell look something like

    Administrator@drserver-p /usr/src/igraph-0.6
    $ ./configure

    • hit "Enter"

    it takes a while.

    Change of files.

    • goto igraph-0.6\src
    • Open with Notepadd++ or another editor the "Makefile"
      Goto line 832 or search for libf2c_la_CFLAGS =
      Put -DUSE_CLOCK after libf2c_la_CFLAGS =
      Now it looks like libf2c_la_CFLAGS = -DUSE_CLOCK -DSkip_f2c_Undefs ....
    • Open igraph-0.6\src\f2c\uninit.c
    • Goto Line 182 or serach for _control87(EM_DENORMAL
      comment this line /* _control87(EM_DENORMAL ..... */
    • Open igraph-0.6\src\f2c\s_paus.c
      Goto Line 84 or search for pause();
      comment this line /* pause(); */

    • Type make Now the msys shell look something like

    Administrator@drserver-p /usr/src/igraph-0.6
    $ make

    • hit "Enter"

    If it works it takes about 1 hour !

    0 讨论(0)
  • 2021-01-12 20:15

    see http://mail.kde.org/pipermail/kde-windows/2006-May/000194.html as they say even if the times.h is put there its functions may not be implemented by mingw

    when running ./configure i'm getting this(its hard to notice)

    so first try copying the times.h and then use ./configure and see if this error isn't there

    0 讨论(0)
  • 2021-01-12 20:16

    you should check your makefile, the CFLAGS/CPPFLAGS has -DWIN32 -D_WINDOWS for windows. in other words, you should never access the sys/times code branch on windows.

    0 讨论(0)
  • 2021-01-12 20:20

    After much investigation, the problem turned out to be that:

    1. MinGW does not have sys/times.h.
    2. Cygwin has it, but my Cyqwin was using the gcc in my python directory, which is MinGW's gcc.

    This was discovered while trying to resolve another problem here:

    Cannot compile C code with #include <sys/times.h> in Cygwin

    So it turns out that my problem had nothing to do with the include path or making symbolic links, but rather, the gcc version/type was wrong. This fact eluded me because I was running a clean installation of Cygwin and didn't know that it would automatically use the MinGW's gcc in my Python folder.

    0 讨论(0)
提交回复
热议问题