blastrock / meteor

A GameBoy Advance Emulator
GNU General Public License v3.0
10 stars 3 forks source link

Linux build failed on gcc ver >4.7 #1

Closed s1nka closed 11 years ago

s1nka commented 11 years ago

Hi. In gcc version over 4.7 in libstdc++ remove unistd.h. Then build current last git version, get error:

[ 68%] Building CXX object mym/source/CMakeFiles/mym.dir/window.cpp.o
/media/data/games/emuls/gba/emuls/meteor/meteor-git/mym/source/window.cpp: In constructor ‘mym::Window::Window()’:
/media/data/games/emuls/gba/emuls/meteor/meteor-git/mym/source/window.cpp:40:40: error: ‘syscall’ was not declared in this scope
   sched_setaffinity(syscall(__NR_gettid), sizeof(set), &set);
                                        ^
/media/data/games/emuls/gba/emuls/meteor/meteor-git/mym/source/window.cpp: In member function ‘void mym::Window::MainLoop()’:
/media/data/games/emuls/gba/emuls/meteor/meteor-git/mym/source/window.cpp:196:41: error: ‘syscall’ was not declared in this scope
    sched_setaffinity(syscall(__NR_gettid), sizeof(set), &set);

This path:

diff --git a/mym/source/window.cpp b/mym/source/window.cpp
index c58d461..556c987 100644
--- a/mym/source/window.cpp
+++ b/mym/source/window.cpp
@@ -18,6 +18,7 @@
 #include "filters/hq4x.hpp"
 #include <ameteor.hpp>
 #include <cstring>
+#include <unistd.h>
 #include <sys/syscall.h>
 #include <sched.h>
 #include <stdio.h>

remove error and build successfull

blastrock commented 11 years ago

Just fixed it, thank you! :)