SyntaxHighlighter

Wednesday, April 29, 2009

g++ 4.3 more strict with declarations

I've been moving a bunch of old C++ code over to g++ 4.3 and have found that gcc is now more strict on declarations and I often receive these sorts of errors:
error: ‘memset’ was not declared in this scope
error: ‘strncmp’ was not declared in this scope
I'm going to continually update this look-up table, which will explain what to do when receiving any of these errors:






ErrorResolution
error: ‘memset’ was not declared in this scopeAdd #include <cstring>

error: ‘strncmp’ was not declared in this scope

2 comments:

Anonymous said...

For "error: 'exit'/'atoi'/'gcvt'... add #include < cstdlib >
(remove the extra spaces inside < >)

And others here :
http://www.cyrius.com/journal/gcc/gcc-4.3-include.html

Unknown said...

Thanks for your contribution!