Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: 1.9.6 make errors  (Read 7880 times)

0 Members and 1 Guest are viewing this topic.

voxfames

  • Anope User
  • Offline Offline
  • Posts: 2
1.9.6 make errors
« on: February 28, 2012, 01:46:01 PM »

Im running mac os x 10.7.3.  64 bit.  Cmake version 2.8.7.  when i run make i get these errors.
[  1%] Built target version
[  1%] Generating version_build
[  1%] Built target headers
[  1%] Building CXX object src/CMakeFiles/services.dir/access.o
In file included from /Users/voxfames/anope-1.9.6/src/access.cpp:12:
In file included from /Users/voxfames/anope-1.9.6/include/services.h:26:
In file included from /usr/include/c++/4.2.1/stdexcept:43:
In file included from /usr/include/c++/4.2.1/string:46:
In file included from /usr/include/c++/4.2.1/bits/char_traits.h:45:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:48:
In file included from /usr/include/c++/4.2.1/bits/postypes.h:45:
In file included from /usr/include/c++/4.2.1/cwchar:51:
/usr/include/c++/4.2.1/ctime:65:11: error: no member named 'clock_t' in the
      global namespace
  using ::clock_t;
        ~~^
/usr/include/c++/4.2.1/ctime:67:11: error: no member named 'tm' in the global
      namespace
  using ::tm;
        ~~^
/usr/include/c++/4.2.1/ctime:69:11: error: no member named 'clock' in the global
      namespace
  using ::clock;
        ~~^
/usr/include/c++/4.2.1/ctime:70:11: error: no member named 'difftime' in the
      global namespace
  using ::difftime;
        ~~^
/usr/include/c++/4.2.1/ctime:71:11: error: no member named 'mktime' in the
      global namespace
  using ::mktime;
        ~~^
/usr/include/c++/4.2.1/ctime:72:11: error: no member named 'time' in the global
      namespace
  using ::time;
        ~~^
/usr/include/c++/4.2.1/ctime:73:11: error: no member named 'asctime' in the
      global namespace
  using ::asctime;
        ~~^
/usr/include/c++/4.2.1/ctime:74:11: error: no member named 'ctime' in the global
      namespace
  using ::ctime;
        ~~^
/usr/include/c++/4.2.1/ctime:75:11: error: no member named 'gmtime' in the
      global namespace
  using ::gmtime;
        ~~^
/usr/include/c++/4.2.1/ctime:76:11: error: no member named 'localtime' in the
      global namespace
  using ::localtime;
        ~~^
/usr/include/c++/4.2.1/ctime:77:11: error: no member named 'strftime' in the
      global namespace
  using ::strftime;
        ~~^
In file included from /Users/voxfames/anope-1.9.6/src/access.cpp:12:
In file included from /Users/voxfames/anope-1.9.6/include/services.h:26:
In file included from /usr/include/c++/4.2.1/stdexcept:43:
In file included from /usr/include/c++/4.2.1/string:46:
In file included from /usr/include/c++/4.2.1/bits/char_traits.h:45:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:70:
In file included from /usr/include/c++/4.2.1/iosfwd:48:
In file included from /usr/include/c++/4.2.1/bits/postypes.h:45:
In file included from /usr/include/c++/4.2.1/cwchar:54:
In file included from /usr/include/wchar.h:116:
/usr/include/_wctype.h:52:9: error: unknown type name '__darwin_wctype_t'
typedef __darwin_wctype_t       wctype_t;
        ^
In file included from /Users/voxfames/anope-1.9.6/src/access.cpp:12:
In file included from /Users/voxfames/anope-1.9.6/include/services.h:26:
In file included from /usr/include/c++/4.2.1/stdexcept:43:
In file included from /usr/include/c++/4.2.1/string:46:
/usr/include/c++/4.2.1/bits/char_traits.h:356:44: error: use of undeclared
      identifier '__DARWIN_WEOF'
      eof() { return static_cast<int_type>(WEOF); }
                                           ^
/usr/include/_wctype.h:56:16: note: expanded from macro 'WEOF'
#define WEOF                    __DARWIN_WEOF
                                ^
In file included from /Users/voxfames/anope-1.9.6/src/access.cpp:12:
In file included from /Users/voxfames/anope-1.9.6/include/services.h:40:
/System/Library/Frameworks/Kernel.framework/Headers/sys/fcntl.h:400:2: error:
      unknown type name 'user32_addr_t'; did you mean 'user_addr_t'?
        user32_addr_t   fs_blob_start;
        ^~~~~~~~~~~~~
        user_addr_t
/usr/include/i386/types.h:114:20: note: 'user_addr_t' declared here
typedef u_int64_t               user_addr_t;   
                                ^
In file included from /Users/voxfames/anope-1.9.6/src/access.cpp:12:
In file included from /Users/voxfames/anope-1.9.6/include/services.h:40:
/System/Library/Frameworks/Kernel.framework/Headers/sys/fcntl.h:401:2: error:
      unknown type name 'user32_size_t'; did you mean 'user_size_t'?
        user32_size_t   fs_blob_size;
        ^~~~~~~~~~~~~
        user_size_t
/usr/include/i386/types.h:115:20: note: 'user_size_t' declared here
typedef u_int64_t               user_size_t;   
                                ^
In file included from /Users/voxfames/anope-1.9.6/src/access.cpp:12:
In file included from /Users/voxfames/anope-1.9.6/include/services.h:40:
/System/Library/Frameworks/Kernel.framework/Headers/sys/fcntl.h:443:3: error:
      unknown type name 'user32_size_t'; did you mean 'user_size_t'?
  user32_size_t fbt_length;          /* IN: number of bytes to transfer */
  ^~~~~~~~~~~~~
  user_size_t
/usr/include/i386/types.h:115:20: note: 'user_size_t' declared here
typedef u_int64_t               user_size_t;   
                                ^
In file included from /Users/voxfames/anope-1.9.6/src/access.cpp:12:
In file included from /Users/voxfames/anope-1.9.6/include/services.h:40:
/System/Library/Frameworks/Kernel.framework/Headers/sys/fcntl.h:444:3: error:
      unknown type name 'user32_addr_t'; did you mean 'user_addr_t'?
  user32_addr_t fbt_buffer;             /* IN: buffer to be read/written */
  ^~~~~~~~~~~~~
  user_addr_t
/usr/include/i386/types.h:114:20: note: 'user_addr_t' declared here
typedef u_int64_t               user_addr_t;   
                                ^
In file included from /Users/voxfames/anope-1.9.6/src/access.cpp:12:
In file included from /Users/voxfames/anope-1.9.6/include/services.h:110:
In file included from /usr/include/c++/4.2.1/iostream:44:
In file included from /usr/include/c++/4.2.1/ostream:44:
In file included from /usr/include/c++/4.2.1/ios:49:
In file included from /usr/include/c++/4.2.1/bits/basic_ios.h:43:
In file included from /usr/include/c++/4.2.1/bits/locale_facets.h:45:
In file included from /usr/include/c++/4.2.1/cwctype:52:
/usr/include/wctype.h:39:9: error: unknown type name '__darwin_wctrans_t'
typedef __darwin_wctrans_t      wctrans_t;
        ^
In file included from /Users/voxfames/anope-1.9.6/src/access.cpp:12:
In file included from /Users/voxfames/anope-1.9.6/include/services.h:110:
In file included from /usr/include/c++/4.2.1/iostream:44:
In file included from /usr/include/c++/4.2.1/ostream:571:
In file included from /usr/include/c++/4.2.1/bits/ostream.tcc:45:
In file included from /usr/include/c++/4.2.1/locale:45:
/usr/include/c++/4.2.1/bits/locale_facets.tcc:1838:47: error: member access into
      incomplete type 'tm'
                  __beg = _M_extract_name(__beg, __end, __tm->tm_wday, __days1,
                                                            ^
/usr/include/wchar.h:156:19: note: forward declaration of 'tm'
            const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
                         ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/CMakeFiles/services.dir/access.o] Error 1
make[1]: *** [src/CMakeFiles/services.dir/all] Error 2
make: *** [all] Error 2

Any solutions?
« Last Edit: August 19, 2020, 06:25:03 PM by voxfames »
Logged

Alexander Barton

  • Anope User
  • Offline Offline
  • Posts: 1
Re: 1.9.6 make errors on Mac OS X
« Reply #1 on: February 28, 2012, 05:03:06 PM »

The problem is, that cmake (and/or CMakeLists.txt) adds "/System/Library/Frameworks/Kernel.framework/Headers/sys" to the include paths when calling c++. So some headers, for example sys/time.h, are included from the kernel API directory instead of the userland API (which would be stored in the default search path /usr/include[/sys/time.h]).

I'm not familiar with cmake … but removing the strange loop in CMakeLists.txt which adds all standard search paths of gcc and which adds this (and other framework directories to DEFAULT_INCLUDE_DIRS) isn't enough: even when DEFAULT_INCLUDE_DIRS doesn't include this framework search path at the end of CMakeLists.txt, cmake (?) still adds it to the Makefiles -- this is, c++ still is called with "-I/System/Library/Frameworks/Kernel.framework/Headers/sys". Huh!?

So a very dirty hack is this:

$ ./Config
$ cd build
$ for f in `find . -name CMakeDirectoryInformation.cmake -exec grep -l Kernel {} \;`; do echo $f; sed -i '.bak' '/  "\/System\/Library\/Frameworks\/Kernel.framework\/Headers\/sys"/d' "$f"; done
$ for f in `find . -name flags.make -exec grep -l Kernel {} \;`; do echo $f; sed -i '.bak' 's/-I\/System\/Library\/Frameworks\/Kernel.framework\/Headers\/sys//' "$f"; done

But someone with a better knowledge of cmake really should fix this strange adding of (unused and silly) search paths ...

Regards
Alex

Logged

voxfames

  • Anope User
  • Offline Offline
  • Posts: 2
Re: 1.9.6 make errors
« Reply #2 on: February 28, 2012, 07:09:37 PM »

Thanks  :) Worked great.
Logged

Naram Qashat

  • Team
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 192
    • CBX's Sprite Animations
Re: 1.9.6 make errors
« Reply #3 on: September 22, 2012, 07:16:03 AM »

So, after seeing some talk in #anope and #anope-devel about a recent fix for 1.8.x under Mac OS X, I was looking into this.  The issue was our own calculate_depends() function and the way CMake's find_path() works.  For some reason, even though the CMake docs state that I should've just been able to set CMAKE_FIND_FRAMEWORK to "NEVER", that didn't cut it.  Instead, I had to fix the loop that finds the default include dirs to properly get the framework directories, and then change calculate_depends() to loop over those and do a find based on the include directory found.  That fixes this.  Now the issue is more to do with one of the modules for 1.9.7 (or rather, 1.9 git) not compiling but that's a different story.
Logged
Pages: [1]   Go Up