Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed compilation with GCC 4.7 #4

Merged
merged 1 commit into from

3 participants

@jgehring

GCC 4.7 "avoid[s] polluting the global namespace and do[es] not include ." (see http://gcc.gnu.org/gcc-4.7/changes.html). Thus, I've added #include unistd.h when necessary.

@jgehring jgehring Fixed compilation with GCC 4.7
unistd.h is not included by default any more.
0637cec
@markusfisch markusfisch merged commit 5cb8273 into markusfisch:master
@markusfisch
Owner

Good point, thanks a lot!

@hwoarang

Is this fixed? I am still getting compilation problem when trying to build it for Gentoo

Application.cpp: In member function ‘bool PieDock::Application::remote(const char) const’:
Application.cpp:94:31: error: ‘unlink’ was not declared in this scope
Application.cpp:112:12: error: ‘close’ was not declared in this scope
Application.cpp: In member function ‘int PieDock::Application::run(bool
)’:
Application.cpp:348:11: error: ‘close’ was not declared in this scope
Application.cpp:349:29: error: ‘unlink’ was not declared in this scope
make[1]: *** [Application.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/x11-misc/piedock-1.6.1/work/piedock-1.6.1/src'
make: *** [all-recursive] Error 1

testing dev # gcc --version
gcc (Gentoo 4.7.1 p1.0, pie-0.5.3) 4.7.1

@jgehring

It works with GCC 4.7.0 and 4.7.1 on Arch Linux for me because unistd.h is being pulled in by some X11 headers. An additional #include <unistd.h> in Application.cpp should fix this. Could you please re-compile with make -s -k, so we can see all remaining errors?

@hwoarang

Yeah sure

testing piedock-1.6.1 # make -s -k
Making all in src
Application.cpp: In member function ‘bool PieDock::Application::remote(const char) const’:
Application.cpp:94:31: error: ‘unlink’ was not declared in this scope
Application.cpp:112:12: error: ‘close’ was not declared in this scope
Application.cpp: In member function ‘int PieDock::Application::run(bool
)’:
Application.cpp:348:11: error: ‘close’ was not declared in this scope
Application.cpp:349:29: error: ‘unlink’ was not declared in this scope
make[1]: *** [Application.o] Error 1
make[1]: Target all' not remade because of errors.
Making all in utils
In file included from ../src/WorkspaceLayout.cpp:15:0:
../src/WindowManager.h: In constructor ‘PieDock::WindowManager::Property<T>::Property(Display*, Window, Atom, const char*)’:
../src/WindowManager.h:86:22: warning: delegating constructors only available with -std=c++11 or -std=gnu++11 [enabled by default]
In file included from ../src/WindowManager.cpp:14:0:
../src/WindowManager.h: In constructor ‘PieDock::WindowManager::Property<T>::Property(Display*, Window, Atom, const char*)’:
../src/WindowManager.h:86:22: warning: delegating constructors only available with -std=c++11 or -std=gnu++11 [enabled by default]
In file included from Utilities.cpp:15:0:
../src/WindowManager.h: In constructor ‘PieDock::WindowManager::Property<T>::Property(Display*, Window, Atom, const char*)’:
../src/WindowManager.h:86:22: warning: delegating constructors only available with -std=c++11 or -std=gnu++11 [enabled by default]
make: *** [all-recursive] Error 1
make: Target
all' not remade because of errors.

@markusfisch
Owner
@markusfisch
Owner

Fixed by including unistd.h in Application.cpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 17, 2012
  1. @jgehring

    Fixed compilation with GCC 4.7

    jgehring authored
    unistd.h is not included by default any more.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +1 −0  src/Environment.cpp
  2. +1 −0  src/WindowManager.cpp
View
1  src/Environment.cpp
@@ -16,6 +16,7 @@
#include <sys/types.h>
#include <pwd.h>
#include <stdlib.h>
+#include <unistd.h>
using namespace PieDock;
View
1  src/WindowManager.cpp
@@ -23,6 +23,7 @@
#include <stdint.h>
#include <string.h>
+#include <unistd.h>
using namespace PieDock;
Something went wrong with that request. Please try again.