zoukankan      html  css  js  c++  java
  • C 和 C++ 混合代码 cmath编译出错

    最近在网上下载了 Triangle 库,准备在程序中调用来三角化生成网格,但出现了很多错误,如下:

    1>  triangle.c
    1>d:program filesvisualstudio2010vcincludecmath(19): error C2061: 语法错误: 标识符“acosf”
    1>d:program filesvisualstudio2010vcincludecmath(19): error C2059: 语法错误:“;”
    1>d:program filesvisualstudio2010vcincludecmath(19): error C2061: 语法错误: 标识符“asinf”
    1>d:program filesvisualstudio2010vcincludecmath(19): error C2059: 语法错误:“;”
    1>d:program filesvisualstudio2010vcincludecmath(20): error C2061: 语法错误: 标识符“atanf”
    1>d:program filesvisualstudio2010vcincludecmath(20): error C2059: 语法错误:“;”
    1>d:program filesvisualstudio2010vcincludecmath(20): error C2061: 语法错误: 标识符“atan2f”
    1>d:program filesvisualstudio2010vcincludecmath(20): error C2059: 语法错误:“;”

    ………..

    由于我使用的是VS2010,用 C++ 写的程序,而Triangle库是用 C 语言写的,问题可能出在这。百度下这个错误,在自古英雄谁无泪的博客中找到了解决办法,更多请参考歆悰的博文和stackoverflow的ms vc++ iostream compile error

    项目 ––> 属性 ––> 配置属性 ––> C/C++ ––> 高级 ––> 编译为 ––> 编译为C++代码

    另外该博文的原作歆悰的心得很有道理,故放在这里同时告诫自己!

    心得:

    所有跟C++相关的语句均报错,应该能够想得到是环境的问题,不善于思考了,唉。

    代码没问题,肯定是环境的问题。

    搜索英文的解决方案比较靠谱和专业,中文的回复太多垃圾。

  • 相关阅读:
    thinkphp传递参数
    $this->display输出模板
    ConterReplaceBehavior.class.php模板内容替换,如__PUBLIC__
    Index/Common目录下文件
    thikphp创建共享数据config.php
    thinkphp连接数据库
    thinkphp笔记
    thinkphp安装 版本 3.1.3
    DIV CSS 网页兼容全搞定 (IE6 IE7 IE8 IE9 火狐 谷歌)
    js倒计时
  • 原文地址:https://www.cnblogs.com/VVingerfly/p/4670173.html
Copyright © 2011-2022 走看看