Hi all,
Hydrogen-0.9.5 failed to build from source against gcc-4.7. I prepared
the attached patch to fix this issue (note that the patch is against
0.9.5. Since the portmidi driver sources are moved in the trunk, you
will have to do the fixes manually there).
Basically the "#include <unistd.h>" directive has been removed from a
bunch of headers (e.g. <string> <iostream> and some STL headers) and
now we have to add this directive directly if we want to call
functions like sleep() close() write() etc.
Note that I tested this only on Linux/gcc. I am not sure whether there
is a unistd.h on other platforms.
Best,
Orcan
diff -rupN hydrogen-0.9.5.old/gui/src/MainForm.cpp hydrogen-0.9.5/gui/src/MainForm.cpp
--- hydrogen-0.9.5.old/gui/src/MainForm.cpp 2011-02-08 04:15:04.000000000 -0500
+++ hydrogen-0.9.5/gui/src/MainForm.cpp 2012-01-16 15:44:14.137527313 -0500
@@ -70,6 +70,7 @@ using namespace H2Core;
#include <memory>
#include <cassert>
+#include <unistd.h>
using namespace std;
using namespace H2Core;
diff -rupN hydrogen-0.9.5.old/gui/src/SongEditor/SongEditor.cpp hydrogen-0.9.5/gui/src/SongEditor/SongEditor.cpp
--- hydrogen-0.9.5.old/gui/src/SongEditor/SongEditor.cpp 2010-03-28 06:06:05.000000000 -0400
+++ hydrogen-0.9.5/gui/src/SongEditor/SongEditor.cpp 2012-01-16 15:26:17.172588849 -0500
@@ -23,6 +23,7 @@
#include <assert.h>
#include <algorithm>
#include <memory>
+#include <unistd.h>
#include <hydrogen/Song.h>
#include <hydrogen/hydrogen.h>
diff -rupN hydrogen-0.9.5.old/libs/hydrogen/src/IO/portmidi_driver.cpp hydrogen-0.9.5/libs/hydrogen/src/IO/portmidi_driver.cpp
--- hydrogen-0.9.5.old/libs/hydrogen/src/IO/portmidi_driver.cpp 2010-02-01 16:06:17.000000000 -0500
+++ hydrogen-0.9.5/libs/hydrogen/src/IO/portmidi_driver.cpp 2012-01-16 15:58:07.592740458 -0500
@@ -30,6 +30,8 @@
#ifdef WIN32
#include <windows.h>
+#else
+#include <unistd.h>
#endif
#ifdef PORTMIDI_SUPPORT
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel