markusfisch / PieDock

A dock but in shape of a pie menu
http://markusfisch.de/PieDock
MIT License
19 stars 7 forks source link

Fixed compilation with GCC 4.7 #4

Closed jgehring closed 12 years ago

jgehring commented 12 years ago

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.

markusfisch commented 12 years ago

Good point, thanks a lot!

hwoarang commented 12 years ago

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 commented 12 years ago

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 commented 12 years ago

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::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::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::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 commented 12 years ago

Well, this is weird. I'm on Gentoo myself and it works for me. Unfortunately, I'm on vacation right now and won't have access to a computer until next week. But Jonas is right, just include unistd.h and it should work. I'll fix this as soon as I'm back. Thank you for pointing this out!

Markus Fisch http://markusfisch.de

Markos Chandras reply@reply.github.com schrieb:

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::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::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::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.


Reply to this email directly or view it on GitHub: https://github.com/markusfisch/PieDock/pull/4#issuecomment-6586737

markusfisch commented 12 years ago

Fixed by including unistd.h in Application.cpp.