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

推荐订阅源

博客园 - Franky
博客园 - 司徒正美
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
WordPress大学
WordPress大学
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog
T
Tor Project blog
阮一峰的网络日志
阮一峰的网络日志
Recent Commits to openclaw:main
Recent Commits to openclaw:main
The Hacker News
The Hacker News
F
Full Disclosure
有赞技术团队
有赞技术团队
H
Help Net Security
Security Latest
Security Latest
P
Palo Alto Networks Blog
MyScale Blog
MyScale Blog
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
P
Privacy International News Feed
P
Proofpoint News Feed
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
罗磊的独立博客
Y
Y Combinator Blog
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
Latest news
Latest news
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Hacker News: Ask HN
Hacker News: Ask HN
爱范儿
爱范儿
T
Threat Research - Cisco Blogs
Last Week in AI
Last Week in AI
The Last Watchdog
The Last Watchdog
N
Netflix TechBlog - Medium
D
DataBreaches.Net
L
LINUX DO - 热门话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
L
Lohrmann on Cybersecurity
O
OpenAI News
S
SegmentFault 最新的问题
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - 想飞

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