1

我刚刚发现了一个名为三角形的网格生成器,可以在这里找到http://www.cs.cmu.edu/~quake/triangle.html

我在使用提供的 make 文件构建它时遇到了一些问题。当我通过命令提示符将 makefile 传递到我的 Visual Studio 时,出现错误

Microsoft (R) Program Maintenance Utility Version 11.00.50727.1
Copyright (C) Microsoft Corporation.  All rights reserved.

NMAKE : fatal error U1073: don't know how to make './triangle.c'
Stop.

我不知道如何调试这个。

4

5 回答 5

4

诶?你看过里面的大量评论了makefile吗?只需-DLINUXCSWITCHES. 不要尝试构建showme. 使用 gcc。

因此,安装了 cygwin(不要忘记makegcc包):

C> bash --login
$ vim makefile

删除-DLINUX,然后

$ make triangle
cc -O -I/usr/X11R6/include -L/usr/X11R6/lib -o ./triangle ./triangle.c -lm
$ make tricall
cc -O -I/usr/X11R6/include -L/usr/X11R6/lib -DTRILIBRARY -c -o ./triangle.o \
    ./triangle.c
cc -O -I/usr/X11R6/include -L/usr/X11R6/lib -o ./tricall ./tricall.c \
    ./triangle.o -lm
$ ./triangle.exe
triangle [-prq__a__uAcDjevngBPNEIOXzo_YS__iFlsCQVh] input_file
    -p  Triangulates a Planar Straight Line Graph (.poly file).
    -r  Refines a previously generated mesh.
    ...

容易,不是吗?

于 2013-05-08T17:38:06.057 回答
0

Janus 的回答在一些工作后奏效了。如果您在使用他编写的 bat 文件时遇到问题,请打开 SetEnv.cmd(将 C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd 粘贴到任何文件浏览器/cmd 中,然后按 Enter)。然后使用“cd Path”导航到项目。比输入“cl /DNO_TIMER /DCPU86 triangle.c”。基本上它是手动执行的bat文件。(蝙蝠对我不起作用)

于 2015-04-18T16:45:03.367 回答
0

我同意 getack 的观点,即在 Windows 上构建通常会让人头疼。但是Jonathan Richard Shewchuk 的三角形是(一个很棒的)没有依赖关系的单文件程序,所以在这种情况下你很好:

1)安装微软SDK(命令行的东西是免费的)。

2)build.bat然后在解压后的源文件所在文件夹中创建以下文件:

REM Compile Triangle using Microsoft C compiler
REM You must install the msvc SDK
REM Janus, 2013

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"
cl /DNO_TIMER /DCPU86 triangle.c

3)运行build.bat文件。这应该创建一个不错的triangle.exe.

背景:需要调用 来C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd为 microsoft build 系统设置环境。或者,SDK 会在运行的位置安装Windows SDK 7.1 命令提示符SetEnv。有关详细信息,请参阅此页面

于 2014-01-09T06:34:29.123 回答
0

Compiling this on windows is gonna make your head sore... It's not portable. I think I saw a few Linux Syscalls in there.

So like the previous answer said, either install a Linux distribution or get yourself MiniGW or CygWin - My Personal favorite.

于 2013-05-08T12:58:31.540 回答
0

那是一个makefile。 nmake实际上不是一个 make 程序,或者说清楚,它不符合 make 的 POSIX 定义。它不能与这个 makefile 一起使用。假设你不想去寻找一个基于 POSIX 的系统(GNU/Linux、Mac OSX、Solaris 等)来使用它,你需要(a)手动编译它(它没有' t 看起来文件太多)或(b)为您的 Windows 系统获取 make 的副本。有多种 GNU make for Windows 的端口;您可能最容易获得的是来自 MinGW:http: //sourceforge.net/projects/mingw/files/MinGW/Extension/make/make-3.82-mingw32/

于 2013-05-08T11:58:08.743 回答