Page 1 of 1

Animorph build failed ...fixed

PostPosted: Sat Jul 26, 2008 3:11 pm
by m.e
I tried to build animorph and got the following error:
Code: Select all
make[2]: Entering directory `..../animorph-0.3/src'
/bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    -Wall -g -O2 -MT BodySettings.lo -MD -MP -MF .deps/BodySettings.Tpo -c -o BodySettings.lo BodySettings.cpp
 g++ -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -MT BodySettings.lo -MD -MP -MF .deps/BodySettings.Tpo -c BodySettings.cpp  -fPIC -DPIC -o .libs/BodySettings.o
BodySettings.cpp: In member function 'void Animorph::BodySettings::fromStream(std::ifstream&)':
BodySettings.cpp:54: error: 'strlen' was not declared in this scope
make[2]: *** [BodySettings.lo] Error 1


OK, fixed that, now I get:
Code: Select all
In file included from VertexVector.cpp:2:
../include/animorph/util.h: In function 'void Animorph::stringTokeni(const std::string&, const std::string&, T&)':
../include/animorph/util.h:169: error: 'atoi' is not a member of 'std'
../include/animorph/util.h:174: error: 'atoi' is not a member of 'std'
make[2]: *** [VertexVector.lo] Error 1


I'm sure I have compiled all this on this box [update: I did, in January. See http://www.dedalo-3d.com/public/forum/index.php?a=topic&topic=1199947767_31&page=last]. Maybe it was an earlier version. But I would have thought it would have fallen over with these errors before... It looks like the code has been written for some other version of C++. I am using g++.

Ok, I have found it. See http://gcc.gnu.org/gcc-4.3/porting_to.html. The new version of g++ has changed its handling of libraries.

Patch:
Code: Select all
diff -r -u animorph-0.3/include/animorph/BodySettings.h animorph-0.3-patch/include/animorph/BodySettings.h
--- animorph-0.3/include/animorph/BodySettings.h   2007-12-03 06:30:40.000000000 +0800
+++ animorph-0.3-patch/include/animorph/BodySettings.h   2008-07-27 01:04:53.000000000 +0800
@@ -36,6 +36,7 @@
 #include <fstream>
 #include <map>
 #include <vector>
+#include <cstring>
 #include "FileReader.h"
 #include "FileWriter.h"
 
diff -r -u animorph-0.3/include/animorph/FaceGroup.h animorph-0.3-patch/include/animorph/FaceGroup.h
--- animorph-0.3/include/animorph/FaceGroup.h   2007-12-03 06:30:40.000000000 +0800
+++ animorph-0.3-patch/include/animorph/FaceGroup.h   2008-07-27 01:08:05.000000000 +0800
@@ -29,6 +29,7 @@
 
 #include <map>
 #include <ios>
+#include <cstring>
 #include "Face.h"
 #include "FaceVector.h"
 #include "FileWriter.h"
diff -r -u animorph-0.3/include/animorph/Hotspot.h animorph-0.3-patch/include/animorph/Hotspot.h
--- animorph-0.3/include/animorph/Hotspot.h   2007-11-25 17:34:57.000000000 +0800
+++ animorph-0.3-patch/include/animorph/Hotspot.h   2008-07-27 01:07:17.000000000 +0800
@@ -36,6 +36,7 @@
 #include <vector>
 #include <iostream>
 #include <fstream>
+#include <cstring>
 #include "FileReader.h"
 
 namespace Animorph {
diff -r -u animorph-0.3/include/animorph/util.h animorph-0.3-patch/include/animorph/util.h
--- animorph-0.3/include/animorph/util.h   2007-11-25 17:34:57.000000000 +0800
+++ animorph-0.3-patch/include/animorph/util.h   2008-07-27 01:05:25.000000000 +0800
@@ -37,6 +37,7 @@
 #include <iomanip>
 #include <vector>
 #include <iostream>
+#include <cstdlib>
 #include "Vector3.h"
 #include "Vertex.h"
 #include "VertexVector.h"


And here is the corresponding patch for makehuman (mhgui does not need patching):
Code: Select all
diff -r -u makehuman-0.9.1-rc1a/src/BodyPanel.h makehuman-0.9.1-rc1a-patch/src/BodyPanel.h
--- makehuman-0.9.1-rc1a/src/BodyPanel.h   2007-11-25 17:28:06.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/BodyPanel.h   2008-07-27 01:24:28.000000000 +0800
@@ -34,6 +34,7 @@
 #include <vector>
 #include <mhgui/Panel.h>
 #include <mhgui/Image.h>
+#include <algorithm>
 #include "util.h"
 #include "TargetSelectionListener.h"
 
diff -r -u makehuman-0.9.1-rc1a/src/CharacterSettingPanel.h makehuman-0.9.1-rc1a-patch/src/CharacterSettingPanel.h
--- makehuman-0.9.1-rc1a/src/CharacterSettingPanel.h   2007-12-03 06:30:18.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/CharacterSettingPanel.h   2008-07-27 01:29:49.000000000 +0800
@@ -32,6 +32,7 @@
 #endif
 
 #include <vector>
+#include <algorithm>
 #include <mhgui/Panel.h>
 #include <mhgui/ImageSlider.h>
 #include <mhgui/Image.h>
diff -r -u makehuman-0.9.1-rc1a/src/ClothesPanel.h makehuman-0.9.1-rc1a-patch/src/ClothesPanel.h
--- makehuman-0.9.1-rc1a/src/ClothesPanel.h   2007-11-25 17:28:07.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/ClothesPanel.h   2008-07-27 01:30:23.000000000 +0800
@@ -32,6 +32,7 @@
 #endif
 
 #include <vector>
+#include <algorithm>
 #include <mhgui/Panel.h>
 #include <mhgui/Image.h>
 #include "util.h"
diff -r -u makehuman-0.9.1-rc1a/src/FacePanel.h makehuman-0.9.1-rc1a-patch/src/FacePanel.h
--- makehuman-0.9.1-rc1a/src/FacePanel.h   2007-11-25 17:28:07.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/FacePanel.h   2008-07-27 01:25:49.000000000 +0800
@@ -32,6 +32,7 @@
 #endif
 
 #include <vector>
+#include <algorithm>
 #include <mhgui/Panel.h>
 #include <mhgui/Image.h>
 #include "TargetSelectionListener.h"
diff -r -u makehuman-0.9.1-rc1a/src/FileTools.h makehuman-0.9.1-rc1a-patch/src/FileTools.h
--- makehuman-0.9.1-rc1a/src/FileTools.h   2007-11-25 17:28:06.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/FileTools.h   2008-07-27 01:42:29.000000000 +0800
@@ -35,6 +35,8 @@
 #include <string>
 #include <list>
 #include <cassert>
+#include <cstring>
+#include <cstdlib>
 
 using std::string;
 using std::list;
diff -r -u makehuman-0.9.1-rc1a/src/HandsPanel.h makehuman-0.9.1-rc1a-patch/src/HandsPanel.h
--- makehuman-0.9.1-rc1a/src/HandsPanel.h   2007-11-25 17:28:07.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/HandsPanel.h   2008-07-27 01:27:17.000000000 +0800
@@ -32,6 +32,7 @@
 #endif
 
 #include <vector>
+#include <algorithm>
 #include <mhgui/Panel.h>
 #include <mhgui/Image.h>
 #include "util.h"
diff -r -u makehuman-0.9.1-rc1a/src/PosesBodyPanel.h makehuman-0.9.1-rc1a-patch/src/PosesBodyPanel.h
--- makehuman-0.9.1-rc1a/src/PosesBodyPanel.h   2007-11-25 17:28:07.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/PosesBodyPanel.h   2008-07-27 01:29:13.000000000 +0800
@@ -32,6 +32,7 @@
 #endif
 
 #include <vector>
+#include <algorithm>
 #include <mhgui/Panel.h>
 #include <mhgui/Image.h>
 #include "util.h"
diff -r -u makehuman-0.9.1-rc1a/src/TeethPanel.h makehuman-0.9.1-rc1a-patch/src/TeethPanel.h
--- makehuman-0.9.1-rc1a/src/TeethPanel.h   2007-11-25 17:28:06.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/TeethPanel.h   2008-07-27 01:26:42.000000000 +0800
@@ -32,6 +32,7 @@
 #endif
 
 #include <vector>
+#include <algorithm>
 #include <mhgui/Panel.h>
 #include <mhgui/Image.h>
 #include "util.h"
diff -r -u makehuman-0.9.1-rc1a/src/ToolbarPanel.h makehuman-0.9.1-rc1a-patch/src/ToolbarPanel.h
--- makehuman-0.9.1-rc1a/src/ToolbarPanel.h   2007-11-25 17:28:07.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/ToolbarPanel.h   2008-07-27 01:28:32.000000000 +0800
@@ -32,6 +32,7 @@
 #endif
 
 #include <vector>
+#include <algorithm>
 #include <mhgui/Panel.h>
 #include <mhgui/Image.h>
 #include "ImageListener.h"
diff -r -u makehuman-0.9.1-rc1a/src/UtilitiesPanel.h makehuman-0.9.1-rc1a-patch/src/UtilitiesPanel.h
--- makehuman-0.9.1-rc1a/src/UtilitiesPanel.h   2007-11-25 17:28:07.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/UtilitiesPanel.h   2008-07-27 01:43:21.000000000 +0800
@@ -32,6 +32,7 @@
 #endif
 
 #include <vector>
+#include <algorithm>
 #include <mhgui/Panel.h>
 #include <mhgui/ImageSlider.h>
 #include <mhgui/Image.h>
diff -r -u makehuman-0.9.1-rc1a/src/UtilitybarPanel.h makehuman-0.9.1-rc1a-patch/src/UtilitybarPanel.h
--- makehuman-0.9.1-rc1a/src/UtilitybarPanel.h   2007-11-25 17:28:07.000000000 +0800
+++ makehuman-0.9.1-rc1a-patch/src/UtilitybarPanel.h   2008-07-27 01:27:56.000000000 +0800
@@ -32,6 +32,7 @@
 #endif
 
 #include <vector>
+#include <algorithm>
 #include <mhgui/Image.h>
 #include <mhgui/Panel.h>
 #include "ImageListener.h"