开发者

Xcode 3 gcc 4.2 error: 'min' was not declared in this scope

for some reason now and again xcode/gcc4.2 complains about

error: 'min' was not declared in this scope 

and the same for max

it seems to happen totally randomly, even开发者_JS百科 if i #define them my self at a top level

any ideas?

edit. i think this may have started happening after i installed Xcode 4, but not sure


(it may help to specify the language you're using...)

what you see could be a few things. if you are expecting this to be c++'s std::min, then you probably have a rogue using namespace std; declared in the global namespace, which is not included ahead of every file.

if this is the case:

1) delete every global using namespace std declaration (optional, but worthwhile).

2) and/or qualify min with std::min


This sounds like you are accessing the math.h libraries or something is wrong with your install. I'd be inclined to suggest removing xcode completely including all developer tools. The read me's have instructions for doing this. Then reboot your machine and reinstall again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜