hefeix / szl

Automatically exported from code.google.com/p/szl
Other
0 stars 0 forks source link

complie error #28

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
complie error

engine/code.cc: In static member function ‘static void 
sawzall::Code::MemMapCode(sawzall::Instr*, size_t, sawzall::Instr**, 
size_t*)’:
engine/code.cc:364:48: error: ‘getpagesize’ was not declared in this scope
make[3]: *** [code.lo] Error 1
make[3]: Leaving directory `/data/opencode/szl/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/data/opencode/szl/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/data/opencode/szl'
make: *** [all] Error 2

 3.2.0-4-686-pae #1 SMP Debian 3.2.35-2 i686 GNU/Linux
gcc --version
gcc (Debian 4.7.2-5) 4.7.2

Original issue reported on code.google.com by Helight.Xu@gmail.com on 6 Mar 2013 at 9:50

GoogleCodeExporter commented 8 years ago
I fixed this issue by adding a few includes:

===================================================================
--- src/engine/code.cc  (revision 53)
+++ src/engine/code.cc  (working copy)
@@ -18,6 +18,7 @@
 #include <string>
 #include <errno.h>
 #include <sys/mman.h>
+#include <unistd.h>

 #include "engine/globals.h"
 #include "public/logging.h"
Index: src/utilities/random_base.cc
===================================================================
--- src/utilities/random_base.cc    (revision 53)
+++ src/utilities/random_base.cc    (working copy)
@@ -18,6 +18,7 @@
 #include <string>
 #include <memory.h>
 #include <assert.h>
+#include <unistd.h>

 #include "public/porting.h"
 #include "public/logging.h"

Original comment by nathani...@qualtrics.com on 18 Mar 2013 at 10:06

GoogleCodeExporter commented 8 years ago
The missing declarations are for getpagesize (code.cc) and getpid and 
gethostname (random_base.cc). I prefer this patch because it integrates 
slightly better with the autoconf structure:

Original comment by aecolley on 13 Oct 2013 at 7:41

Attachments: