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

推荐订阅源

WordPress大学
WordPress大学
N
News | PayPal Newsroom
雷峰网
雷峰网
Y
Y Combinator Blog
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
The Cloudflare Blog
The GitHub Blog
The GitHub Blog
Recorded Future
Recorded Future
Vercel News
Vercel News
N
Netflix TechBlog - Medium
GbyAI
GbyAI
博客园 - 司徒正美
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
P
Proofpoint News Feed
I
InfoQ
IT之家
IT之家
F
Full Disclosure
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
Forbes - Security
Forbes - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cyber Attacks, Cyber Crime and Cyber Security
The Last Watchdog
The Last Watchdog
月光博客
月光博客
W
WeLiveSecurity
S
Securelist
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
T
Threat Research - Cisco Blogs
D
DataBreaches.Net
P
Privacy & Cybersecurity Law Blog
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Scott Helme
Scott Helme
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - Franky
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org

博客园 - 想飞

区块链应用场景 系统微服务架构 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文件包括的文件。