Latest tip fails to build with GCC 4.7


#1

Hey jules, latest git code fails to build on newer gcc, error:

==== Building juce-events ==== juce_events.cpp In file included from ../source/modules/juce_events/juce_events.cpp:98:0: ../source/modules/juce_events/native/juce_linux_Messaging.cpp: In destructor ‘juce::InternalMessageQueue::~InternalMessageQueue()’: ../source/modules/juce_events/native/juce_linux_Messaging.cpp:55:21: error: ‘close’ was not declared in this scope ../source/modules/juce_events/native/juce_linux_Messaging.cpp: In member function ‘void juce::InternalMessageQueue::postMessage(juce::MessageManager::MessageBase*)’: ../source/modules/juce_events/native/juce_linux_Messaging.cpp:75:54: error: ‘write’ was not declared in this scope ../source/modules/juce_events/native/juce_linux_Messaging.cpp: In member function ‘juce::MessageManager::MessageBase::Ptr juce::InternalMessageQueue::popNextMessage()’: ../source/modules/juce_events/native/juce_linux_Messaging.cpp:186:49: error: ‘read’ was not declared in this scope make[3]: *** [intermediate/Release/juce_events.o] Errore 1 make[2]: *** [juce-events] Errore 2 make[2]: Leaving directory `/home/speps/chroot/buildscripts/distrho/distrho-git/src/distrho-build/libs/juce-2.0/build-events' make[1]: *** [events] Errore 2 make[1]: Leaving directory `/home/speps/chroot/buildscripts/distrho/distrho-git/src/distrho-build/libs/juce-2.0' make: *** [standalone] Errore 2

Fix:

[code]— a/libs/juce-2.0/source/modules/juce_events/juce_events.cpp
+++ b/libs/juce-2.0/source/modules/juce_events/juce_events.cpp
@@ -52,6 +52,7 @@
#import <IOKit/pwr_mgt/IOPMLib.h>

#elif JUCE_LINUX

  • #include <unistd.h>
    #include <X11/Xlib.h>
    #include <X11/Xresource.h>
    #include <X11/Xutil.h>
    – [/code]

#2

Also fails on gui_basics, fix:

[code]— a/libs/juce-2.0/source/modules/juce_gui_basics/juce_gui_basics.cpp
+++ b/libs/juce-2.0/source/modules/juce_gui_basics/juce_gui_basics.cpp
@@ -90,6 +90,7 @@

//==============================================================================
#elif JUCE_LINUX

  • #include <unistd.h>
    #include <X11/Xlib.h>
    #include <X11/Xatom.h>
    #include <X11/Xresource.h>
    [/code]

#3

Cool, thanks!