与VS2012“三角”?

时间:2014-02-12 21:44:02

标签: c++ c visual-studio compiler-construction compiler-errors

有一个三角形网格生成器(Shewchuk,CMU), "Triangle",由于它的轻量级,由人们推荐。它是用C语言编写的。但我不能在我的VS2012 C ++项目中使用它。我正在使用x64平台编译它。我在Windows 7 64位上。

基本上,我编译了three.c作为描述的makefile。因此,生成了一个triangle.o。然后我

  1. 在我的解决方案中添加了triangle.o作为附加依赖项,
  2. 在我的项目中添加了triangle.c和triangle.h。
  3. 将C / C ++预编译标题选项中的triangle.c更改为“不使用预编译标题”
  4. 然后我遇到了很多这样的错误:

    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上设置它的正确方法是什么?

1 个答案:

答案 0 :(得分:0)

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

这对我来说最初没有用,所以我尝试在文件的顶部移动#include,然后再包含所有其他内容,这对我有用。

相关问题