2014-02-12 284 views
0

有一個三角形網格生成器(Shewchuk,CMU), "Triangle",由於它的輕便而被人們推薦。它是用C編寫的,但是我不能在我的VS2012 C++項目中使用它。我正在使用x64平臺編譯它。我在Windows 7 64位。「三角形」VS2012?

基本上,我將triangle.c編譯爲所描述的makefile。因此,會生成一個triangle.o。然後我

  1. 添加triangle.o作爲附加依賴於我的解決方案,
  2. 添加triangle.c和triangle.h在我的項目。
  3. 改變triangle.c在C/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上設置它的正確方法是什麼?

+0

您需要[設置FP精度](http://www.cs.cmu.edu/~quake/robust.pc.html),儘管這與此錯誤無關。 – MSalters

回答