gpt4 book ai didi

c++ - "Triangle"与 VS2012?

转载 作者:行者123 更新时间:2023-11-30 17:39:40 24 4
gpt4 key购买 nike

有一个三角网格生成器(Shewchuk,CMU), "Triangle" ,由于其重量轻而受到人们的推荐。它是用 C 编写的。但是我无法在我的 VS2012 C++ 项目中使用它。我正在使用 x64 平台编译它。我使用的是 Windows 7 64 位。

基本上,我按照 makefile 的描述来编译三角形.c。这样,就生成了一个triangle.o。然后我

  1. 在我的解决方案中添加了 triangle.o 作为附加依赖项,
  2. 在我的项目中添加了triangle.c和triangle.h。
  3. 将C/C++预编译头选项中的triangle.c更改为“不使用预编译头”

然后我收到了大量这样的错误:

1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(430): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(430): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(497): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(497): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(498): error C2143: syntax error : missing ';' before '*'
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(498): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(2517): warning C4391: 'SHORT _InterlockedIncrement16(volatile SHORT *)' : incorrect return type for intrinsic function, expected 'short'

我只是想知道,有没有办法让三角网格生成器与 VS2012 C++ 项目一起工作?如果是这样,在 VS2012 C++ x64 上设置它的正确方法是什么?

最佳答案

您可能想看看这个:Compilation errors of a simple C++ project in VS 2012.RC 4禁用预编译头,并删除中间目录中的pch文件。

这最初对我不起作用,所以我尝试在所有其他包含之前将 #include 移动到文件顶部,这对我有用。

关于c++ - "Triangle"与 VS2012?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21740371/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com