gCling linking error when compiling ROOT 6.26/06

In my original post I installed root using homebrew, and I do not have a custom .rootrc file as far as I know.

After reading through forum posts, I found that people were able to run root on 13.0 by building from source from the master branch. This did not work for me either, as cmake would throw errors before the build completed.

Errors:

[ 61%] Building CXX object core/meta/CMakeFiles/Meta.dir/src/TListOfFunctions.cxx.o
In file included from /Applications/root-master/core/base/src/TApplication.cxx:23:
In file included from /Applications/root-master/core/base/inc/TApplication.h:30:
In file included from /Applications/root-master/core/base/inc/TQObject.h:42:
/Applications/root-master/core/base/inc/TVirtualQConnection.h:34:30: error: unknown type name 'Longptr_t'
   virtual void SetArg(const Longptr_t *, Int_t = -1) = 0;
                             ^
/Applications/root-master/core/base/inc/TVirtualQConnection.h:74:23: error: unknown type name 'Longptr_t'
   void SetArgs(const Longptr_t* argArray, Int_t nargs = -1)
                      ^
/Applications/root-master/core/base/inc/TVirtualQConnection.h:36:43: error: use of undeclared identifier 'Longptr_t'
   void SetArg(const void *ptr) { SetArg((Longptr_t)ptr); };
                                          ^
/Applications/root-master/core/base/inc/TVirtualQConnection.h:36:28: warning: unused parameter 'ptr' [-Wunused-parameter]
   void SetArg(const void *ptr) { SetArg((Longptr_t)ptr); };
                           ^
/Applications/root-master/core/base/inc/TVirtualQConnection.h:43:18: error: use of undeclared identifier 'Longptr_t'
         SetArg((Longptr_t)val);
                 ^
/Applications/root-master/core/base/inc/TVirtualQConnection.h:45:18: error: use of undeclared identifier 'ULongptr_t'; did you mean 'kLong_t'?
         SetArg((ULongptr_t)val);
                 ^~~~~~~~~~
                 kLong_t
/usr/local/include/TDataType.h:30:36: note: 'kLong_t' declared here
   kInt_t    = 3,  kUInt_t   = 13, kLong_t     = 4,  kULong_t  = 14,
                                   ^
In file included from /Applications/root-master/core/base/src/TApplication.cxx:23:
In file included from /Applications/root-master/core/base/inc/TApplication.h:30:
In file included from /Applications/root-master/core/base/inc/TQObject.h:42:
/Applications/root-master/core/base/inc/TVirtualQConnection.h:40:25: warning: unused parameter 'val' [-Wunused-parameter]
   void SetArg(const T& val)
                        ^
In file included from /Applications/root-master/core/base/src/TApplication.cxx:23:
/Applications/root-master/core/base/inc/TApplication.h:86:12: error: unknown type name 'Longptr_t'
   virtual Longptr_t  ProcessRemote(const char *line, Int_t *error = nullptr);
           ^
/Applications/root-master/core/base/inc/TApplication.h:113:12: error: unknown type name 'Longptr_t'
   virtual Longptr_t ProcessLine(const char *line, Bool_t sync = kFALSE, Int_t *error = nullptr);
           ^
/Applications/root-master/core/base/inc/TApplication.h:114:12: error: unknown type name 'Longptr_t'
   virtual Longptr_t ProcessFile(const char *file, Int_t *error = nullptr, Bool_t keep = kFALSE);
           ^
/Applications/root-master/core/base/inc/TApplication.h:157:11: error: unknown type name 'Longptr_t'
   static Longptr_t ExecuteFile(const char *file, Int_t *error = nullptr, Bool_t keep = kFALSE);
          ^
In file included from /Applications/root-master/core/base/src/TApplication.cxx:26:
/Applications/root-master/core/base/inc/TVirtualX.h:108:33: error: unknown type name 'ULongptr_t'
   virtual Int_t     InitWindow(ULongptr_t window);
                                ^
/Applications/root-master/core/base/inc/TVirtualX.h:109:32: error: unknown type name 'ULongptr_t'
   virtual Int_t     AddWindow(ULongptr_t qwid, UInt_t w, UInt_t h);
                               ^
/Applications/root-master/core/base/inc/TVirtualX.h:110:32: error: unknown type name 'ULongptr_t'
   virtual Int_t     AddPixmap(ULongptr_t pixid, UInt_t w, UInt_t h);
                               ^
/Applications/root-master/core/base/inc/TVirtualX.h:111:35: error: unknown type name 'ULongptr_t'
   virtual void      RemoveWindow(ULongptr_t qwid);
                                  ^
/Applications/root-master/core/base/inc/TVirtualX.h:170:36: error: unknown type name 'ULongptr_t'
   virtual Bool_t       NeedRedraw(ULongptr_t tgwindow, Bool_t force);
                                   ^
In file included from /Applications/root-master/core/base/src/TApplication.cxx:27:
/Applications/root-master/core/base/inc/TROOT.h:293:4: error: unknown type name 'Longptr_t'
   Longptr_t         Macro(const char *filename, Int_t *error = nullptr, Bool_t padUpdate = kTRUE);
   ^
/Applications/root-master/core/base/inc/TROOT.h:297:4: error: unknown type name 'Longptr_t'
   Longptr_t         ProcessLine(const char *line, Int_t *error = nullptr);
   ^
/Applications/root-master/core/base/inc/TROOT.h:298:4: error: unknown type name 'Longptr_t'
   Longptr_t         ProcessLineSync(const char *line, Int_t *error = nullptr);
   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make[2]: *** [core/base/CMakeFiles/Base.dir/src/TApplication.cxx.o] Error 1
make[1]: *** [core/base/CMakeFiles/Base.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

I also found another post with similar cmake errors, but they were able to fix it by uninstalling root and then trying again. I think I have already uninstalled root completely, but is there any way to make sure I have removed it entirely?

Thanks!
Caley