[ghemical-devel] a patch for moldyn.h

LI Daobing lidaobing at gmail.com
Tue Oct 23 11:36:20 EDT 2007


g++-4.3 report following error on moldyn.h

$ echo "#include <moldyn.h>" | /usr/lib/gcc-snapshot/bin/g++ -x c++ -c
- `pkg-config --cflags libghemical`
In file included from <stdin>:1:
/usr/include/ghemical/moldyn.h: In constructor
'moldyn_param::moldyn_param(setup*)':
/usr/include/ghemical/moldyn.h:91: error: 'strcpy' was not declared in
this scope

following patch can resolve this bug.
$ diff -u moldyn.h /usr/include/ghemical/moldyn.h
--- moldyn.h    2007-10-23 23:35:29.000000000 +0800
+++ /usr/include/ghemical/moldyn.h      2007-10-23 23:35:51.000000000 +0800
@@ -10,6 +10,8 @@
 #ifndef MOLDYN_H
 #define MOLDYN_H

+#include <cstring>
+
 class moldyn_param;

 class moldyn;
@@ -88,7 +90,7 @@

                langevin = false;

-               strcpy(filename, "untitled.traj");
+                std::strcpy(filename, "untitled.traj");
        }

        ~moldyn_param(void) { }


-- 
Best Regards,
 LI Daobing


More information about the ghemical-devel mailing list