Windows 7 在Windows 7上安装Mimetex

Windows 7 在Windows 7上安装Mimetex,windows-7,windows,cygwin,Windows 7,Windows,Cygwin,我正在尝试在Windows 7上安装。为了实现这一点,我首先在我的机器上安装了cygwin,然后在提示符窗口中键入: gcc-DAA-DWINDOWS mimetex.c gifsave.c-lm-o mimetex.exe 在正确的目录中。 在提示中,我看到: 但是exe还是被创建了。当我尝试启动该exe时,我看到以下错误: 可能是与我的Windows版本不兼容吗?如果是,我如何解决 提前感谢。mimetex使用的strcasestr不是C标准,也不是每个平台都提供的。 以下面的示例代码为

我正在尝试在Windows 7上安装。为了实现这一点,我首先在我的机器上安装了cygwin,然后在提示符窗口中键入:

gcc-DAA-DWINDOWS mimetex.c gifsave.c-lm-o mimetex.exe

在正确的目录中。 在提示中,我看到:

但是exe还是被创建了。当我尝试启动该exe时,我看到以下错误:

可能是与我的Windows版本不兼容吗?如果是,我如何解决


提前感谢。

mimetex使用的strcasestr不是C标准,也不是每个平台都提供的。 以下面的示例代码为例 然后放入一个strcasestr.c文件

$ cat strcasestr.c
#include <stdlib.h>
#include <ctype.h>

char *strcasestr(const char *str, const char *pattern) {
    size_t i;

    if (!*pattern)
        return (char*)str;

    for (; *str; str++) {
        if (toupper(*str) == toupper(*pattern)) {
            for (i = 1;; i++) {
                if (!pattern[i])
                    return (char*)str;
                if (toupper(str[i]) != toupper(pattern[i]))
                    break;
            }
        }
    }
    return NULL;
}
在CMD会话中测试它,您可以按照自述文件的建议验证它是否是一个独立的windows程序:

>mimetex.cgi "x^2+y^2"
+-----------------------------------------------------------------------+
|mimeTeX vers 1.75, Copyright(c) 2002-2017, John Forkosh Associates, Inc|
+-----------------------------------------------------------------------+
| mimeTeX is free software, licensed to you under terms of the GNU/GPL, |
|           and comes with absolutely no warranty whatsoever.           |
|          See http://www.forkosh.com/mimetex.html for details.         |
+-----------------------------------------------------------------------+
Most recent revision: 10 June 2017

Ascii dump of bitmap image...
.................***......................................***...
................*...*....................................*...*..
...............**...**..................................**...**.
...............**....*..................................**....*.
....................**...........*...........................**.
....................**...........*...........................**.
....................*............*...........................*..
....**..****.......*.............*...........**.....*.......*...
...*..**...*......*..............*..........*.*.....*......*....
..*...*..........*...*...........*..........*.*.....*.....*...*.
..*...*.........*....*...........*..........*.*.....*....*....*.
.....*.........*******....***************....*.....*....*******.
.....*...........................*...........*.....*............
.....*....*......................*...........*.....*............
.....*....*......................*...........*....**............
*...**...*.......................*...........*...**.............
.***..***........................*............***.*.............
.................................*................*.............
.................................*...............*..............
............................................*...*...............
.............................................***................

您正在使用cygwin编译器,并且很可能使用
-DWINDOWS
声明windows程序。要构建一个Windows程序,您需要使用交叉编译器,因为在安装这个程序包mingw之后,我必须做什么?对不起,我不太熟练。我听说cygwin的安装中已经包含了mingw。它是假的吗?该包包含交叉编译器
x86_64-w64-mingw32-gcc.exe
,该编译器在cygwin上运行,但为windows构建。Cygwin包含一些mingw编译器和库;它不包含完整的mingw环境。在构建中使用
x86\u 64-w64-mingw32-gcc
而不是
gcc
。我假设您有一个64位系统。/tmp/cce6yBjW.o:mimetex.c:(.text+0x124bf):引用未定义“strcestr”集合2:错误:ld返回1退出状态
>mimetex.cgi "x^2+y^2"
+-----------------------------------------------------------------------+
|mimeTeX vers 1.75, Copyright(c) 2002-2017, John Forkosh Associates, Inc|
+-----------------------------------------------------------------------+
| mimeTeX is free software, licensed to you under terms of the GNU/GPL, |
|           and comes with absolutely no warranty whatsoever.           |
|          See http://www.forkosh.com/mimetex.html for details.         |
+-----------------------------------------------------------------------+
Most recent revision: 10 June 2017

Ascii dump of bitmap image...
.................***......................................***...
................*...*....................................*...*..
...............**...**..................................**...**.
...............**....*..................................**....*.
....................**...........*...........................**.
....................**...........*...........................**.
....................*............*...........................*..
....**..****.......*.............*...........**.....*.......*...
...*..**...*......*..............*..........*.*.....*......*....
..*...*..........*...*...........*..........*.*.....*.....*...*.
..*...*.........*....*...........*..........*.*.....*....*....*.
.....*.........*******....***************....*.....*....*******.
.....*...........................*...........*.....*............
.....*....*......................*...........*.....*............
.....*....*......................*...........*....**............
*...**...*.......................*...........*...**.............
.***..***........................*............***.*.............
.................................*................*.............
.................................*...............*..............
............................................*...*...............
.............................................***................