alexchandel / procfs

/proc for macOS/OS X 64-bit
GNU General Public License v2.0
69 stars 11 forks source link

Fixes to build under High Sierra #8

Closed tonigi closed 6 years ago

tonigi commented 6 years ago

Had to do the following (I'm using the command line developer tools)...

diff --git a/Makefile b/Makefile
index 81774fe..a102c0b 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
 CC  ?= gcc
 CXX ?= g++

-CFLAGS_OSXFUSE=-D_FILE_OFFSET_BITS=64 -O -I/usr/local/include/osxfuse -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -Wall
+CFLAGS_OSXFUSE=-D_FILE_OFFSET_BITS=64 -O -I/usr/local/include/osxfuse -arch x86_64 # -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -Wall
 CFLAGS  :=$(CFLAGS_OSXFUSE) $(CFLAGS)
 CXXFLAGS:=$(CFLAGS_OSXFUSE) $(CXXFLAGS)
 LDFLAGS=-L/usr/local/lib -losxfuse -framework Carbon -framework IOKit -framework ApplicationServices -framework Accelerate -framework OpenGL -weak-lproc
diff --git a/procfs.cc b/procfs.cc
index 57ce86f..0a3e7eb 100755
--- a/procfs.cc
+++ b/procfs.cc
@@ -48,6 +48,8 @@
 #include "procfs_tpm.h"
 #endif /* OSXFUSE_PROCFS_ENABLE_TPM */

+using std::string;
+
 static int procfs_ui = 0;
 #define PROCFS_DEFAULT_FILE_SIZE 65536
alexchandel commented 6 years ago

I'd advise you to keep the -Wall, or move it before the -isysroot. If you're using 10.12 or 10.13, you may want to update it to simply /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk or /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk or wherever your SDK is. Or add a test in the Makefile.

alexchandel commented 6 years ago

Updated to fix the SDK and std::string issues.