AMBER Archive (2008)Subject: Re: AMBER: error in compilation elsize.cc
From: Scott Brozell (sbrozell_at_scripps.edu)
Date: Mon May 05 2008 - 13:55:49 CDT
Hi,
On Mon, 14 Apr 2008, snoze pa wrote:
> After upgrading to GCC new version i am getting following error
What is the output of g++ -v
?
> message. Also with icc compiler it is giving same error message in
> compiling follwoing code. Any help or suggestions.
>
> g++ -c -o elsize.o elsize.cc
> elsize.cc: In function 'int main(int, char**)':
> elsize.cc:117: error: 'exit' was not declared in this scope
> elsize.cc:124: error: 'strcmp' was not declared in this scope
> elsize.cc:145: error: 'strcmp' was not declared in this scope
> elsize.cc:160: error: 'calloc' was not declared in this scope
> elsize.cc:171: error: 'exit' was not declared in this scope
> elsize.cc:233: error: 'exit' was not declared in this scope
> elsize.cc:295: error: 'exit' was not declared in this scope
> elsize.cc:339: error: 'exit' was not declared in this scope
> elsize.cc: In function 'atom_count GetNumberOfAtoms(const char*, int)':
> elsize.cc:504: error: 'exit' was not declared in this scope
> elsize.cc: In function 'atom_count ReadAtomicCoordinates(const char*,
> int, atom_count, double*, double*, double*, double*, double*)':
> elsize.cc:565: error: 'exit' was not declared in this scope
> make[1]: *** [elsize.o] Error 1
Your compiler is correct.
exit and calloc are declared in stdlib.h
strcmp is declared in string.h
Add these lines to the other includes near the head of the file:
#include <stdlib.h>
#include <string.h>
which is the result of applying bugfix 2:
http://amber.scripps.edu/bugfixes10.html
Note that most compilers do not complain probably because the existing
includes indirectly include these other headers.
Note also that <string.h> is different than <string>
(C-style versus C++ strings).
Scott
-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber_at_scripps.edu
To unsubscribe, send "unsubscribe amber" to majordomo_at_scripps.edu
|