惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
Cyberwarzone
Cyberwarzone
T
Troy Hunt's Blog
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
U
Unit 42
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
F
Full Disclosure
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
IT之家
IT之家
Google Online Security Blog
Google Online Security Blog
Cloudbric
Cloudbric
月光博客
月光博客
Hacker News: Ask HN
Hacker News: Ask HN
罗磊的独立博客
N
News and Events Feed by Topic
S
Secure Thoughts
The Last Watchdog
The Last Watchdog
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
I
Intezer
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 聂微东
P
Privacy International News Feed
有赞技术团队
有赞技术团队
博客园_首页
F
Fortinet All Blogs
Recent Announcements
Recent Announcements
O
OpenAI News
博客园 - 【当耐特】
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tor Project blog
B
Blog
量子位
T
Threatpost
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CXSECURITY Database RSS Feed - CXSecurity.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Vulnerabilities – Threatpost
酷 壳 – CoolShell
酷 壳 – CoolShell
S
SegmentFault 最新的问题
L
LangChain Blog

博客园 - 想飞

区块链应用场景 系统微服务架构 shell sed命令 项目pom.xml第一行报错解决方案 Fabric事务机制 MSP成员服务管理 Dockerfile 说明 Docker-Compose 配置详解 Fabric 术语 Docker数据管理:Named volume Mac 查看Volumes Android中的JSON详细总结 经典黑客程序gh0st汇编改写 关于使用WM_COPYDATA进行进程之间交换数据的问题 关于金山开源界面BkWin不能使用DDX 的解决办法 CListBox没产生LBN_SELCHANGE消息 WTL中CListViewCtrl中LVS_ICON和LVS_REPORT模式的不同 浏览器研究 图片合并工具V1.1
使用#define定义引用的编译问题
想飞 · 2011-07-31 · via 博客园 - 想飞

在一个项目使用math库时,编译出现以下错误。

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(485) : error C2059: 语法错误 : “(”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(485) : error C2059: 语法错误 : “-”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(485) : error C2059: 语法错误 : “)”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(486) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(486) : error C2447: “{”: 缺少函数标题(是否是老式的形式表?)

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(487) : error C2059: 语法错误 : “(”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(487) : error C2059: 语法错误 : “-”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(487) : error C2059: 语法错误 : “)”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(488) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(488) : error C2447: “{”: 缺少函数标题(是否是老式的形式表?)

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(491) : error C2059: 语法错误 : “(”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(491) : error C2059: 语法错误 : “-”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(491) : error C2059: 语法错误 : “)”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(492) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(492) : error C2447: “{”: 缺少函数标题(是否是老式的形式表?)

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(539) : error C2059: 语法错误 : “(”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(539) : error C2059: 语法错误 : “-”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(539) : error C2059: 语法错误 : “)”

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(540) : error C2143: 语法错误 : 缺少“;”(在“{”的前面)

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\math.h(540) : error C2447: “{”: 缺少函数标题(是否是老式的形式表?)

看提示应该是abs函数跟某个宏定义有冲突。但搜遍整个工程也没找到这个宏。 

百思不得其解!

最后在某个动态库的头文件找到这个宏定义。去掉后编译通过。

总结:

1、宏定义函数的一般情况不要定义的跟运行库相同,会引起隐患。

2、VS的搜索功能,如果不指定路径,只搜索整个工程,是没办法搜索到不在工程里,但在CPP文件包括的文件。