Author Topic: Compile errors  (Read 4934 times)

Offline Am0k

  • Acquaintance
  • *
  • Posts: 9
    • View Profile
Compile errors
« on: February 12, 2014, 02:33:58 PM »
Hi,

I've tried compiling FluffOS 3.0-alpha7.4, 3.0-alpha8 and 2.27. Made an attempt with one version, it gave me compile errors, moved on to the next version and so on. Posting errors below.

Any help is appreciated.

I'm using a late 2013 MBP running Mac OS X 10.9.1.

gcc -v
Code: [Select]
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.2
Thread model: posix

error compiling alpha7.4
Code: [Select]
....
In file included from backend.cc:2:
In file included from ./std.h:14:
In file included from ./options_incl.h:2:
./local_options:941:9: warning: 'CFG_MAX_GLOBAL_VARIABLES' macro redefined
#define CFG_MAX_GLOBAL_VARIABLES         256
        ^
./options_internal.h:215:9: note: previous definition is here
#define CFG_MAX_GLOBAL_VARIABLES        65536
        ^
backend.cc:166:18: error: no matching conversion for functional-style cast from
      '__bind<int (&)(bool), bool>' to 'tick_event::callback_type'
      (aka 'function<void ()>')
                 tick_event::callback_type(std::bind(reclaim_objects, true)));
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1137:5: note:
      candidate constructor not viable: no known conversion from '__bind<int
      (&)(bool), bool>' to 'nullptr_t' for 1st argument
    function(nullptr_t) _NOEXCEPT : __f_(0) {}
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1138:5: note:
      candidate constructor not viable: no known conversion from '__bind<int
      (&)(bool), bool>' to 'const std::__1::function<void ()>' for 1st argument
    function(const function&);
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1139:5: note:
      candidate constructor not viable: no known conversion from '__bind<int
      (&)(bool), bool>' to 'std::__1::function<void ()>' for 1st argument
    function(function&&) _NOEXCEPT;
    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1142:35: note:
      candidate template ignored: disabled by 'enable_if' [with _Fp =
      std::__1::__bind<int (&)(bool), bool>]
               typename enable_if<__callable<_Fp>::value>::type* = 0);
                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1146:7: note:
      candidate constructor template not viable: requires 2 arguments, but 1 was
      provided
      function(allocator_arg_t, const _Alloc&) _NOEXCEPT : __f_(0) {}
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1149:7: note:
      candidate constructor template not viable: requires 3 arguments, but 1 was
      provided
      function(allocator_arg_t, const _Alloc&, nullptr_t) _NOEXCEPT : __f_(0) {}
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1151:7: note:
      candidate constructor template not viable: requires 3 arguments, but 1 was
      provided
      function(allocator_arg_t, const _Alloc&, const function&);
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1153:7: note:
      candidate constructor template not viable: requires 3 arguments, but 1 was
      provided
      function(allocator_arg_t, const _Alloc&, function&&);
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1155:7: note:
      candidate constructor template not viable: requires at least 3 arguments,
      but 1 was provided
      function(allocator_arg_t, const _Alloc& __a, _Fp __f,
      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/functional:1135:5: note:
      candidate constructor not viable: requires 0 arguments, but 1 was provided
    function() _NOEXCEPT : __f_(0) {}
    ^
3 warnings and 1 error generated.
make[1]: *** [backend.o] Error 1
make: *** [all] Error 2

error compiling alpha8
Code: [Select]
....
In file included from ./options_incl.h:2:
./local_options:941:9: warning: 'CFG_MAX_GLOBAL_VARIABLES' macro redefined
#define CFG_MAX_GLOBAL_VARIABLES         256
        ^
./options_internal.h:214:9: note: previous definition is here
#define CFG_MAX_GLOBAL_VARIABLES 65536
        ^
3 warnings generated.
Creating 'grammar.y' from 'grammar.y.pre' ...

./edit_source -build_efuns -build_applies
./portability.h:11: Invalid type: typedef
make: *** [files] Error 1

error compiling FluffOS 2.27
Code: [Select]
gcc -std=c99 -D_GNU_SOURCE -m64 -flto -D__USE_FIXED_PROTOTYPES__ -O3 -o obj/interpret.o -c interpret.c
interpret.c:318:1: error: conflicting types for 'push_number'
push_number (LPC_INT n)
^
./interpret.h:299:13: note: previous declaration is here
INLINE void push_number (long);
            ^
interpret.c:2378:38: warning: format specifies type 'long' but the argument has
      type 'LPC_INT' (aka 'long long') [-Wformat]
                sprintf(buff, "%ld", (sp+1)->u.number);
                               ~~~   ^~~~~~~~~~~~~~~~
                               %lld
...

Offline quixadhal

  • BFF
  • ***
  • Posts: 619
    • View Profile
    • A Waste of Time
Re: Compile errors
« Reply #1 on: February 12, 2014, 03:02:12 PM »
The last error, from 2.27, actually told you how to fix it.

The printf() statement used a long int token %ld, but the data being passed was a long long int.  Change the token to a %lld.

I have to assume that's another 32-bit vs. 64-bit annoyance. :)

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Compile errors
« Reply #2 on: February 12, 2014, 03:30:21 PM »
That is not the last error :
real problem is :

Code: [Select]
interpret.c:318:1: error: conflicting types for 'push_number'
push_number (LPC_INT n)
^
./interpret.h:299:13: note: previous declaration is here
INLINE void push_number (long);
You need to change interpret.h to use LPC_INT instead of long. (This error should have been fixed).


On other 3.X errors, it looks like you are using a very old version of C++ header
Code: [Select]
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
can you paste the full "./build.FluffOS" output ? 

Offline Am0k

  • Acquaintance
  • *
  • Posts: 9
    • View Profile
Re: Compile errors
« Reply #3 on: February 12, 2014, 03:40:44 PM »
Output from FluffOS-3.0alpha8

./build.FluffOS
Code: [Select]
Preparing to build standard driver ...
checking build system type... x86_64-apple-darwin13.0.2
checking host system type... x86_64-apple-darwin13.0.2
checking target system type... x86_64-apple-darwin13.0.2
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for bison... bison -y
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... yes
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... yes
checking whether C++ compiler accepts ... yes
checking whether C++ compiler accepts -D_GNU_SOURCE... yes
checking whether C++ compiler accepts -fno-omit-frame-pointer... yes
checking whether the linker accepts ... yes
checking whether the linker accepts -flto... yes
checking whether the linker accepts -flto... (cached) yes
checking whether C++ compiler accepts -flto... yes
checking whether the linker accepts -rdynamic... yes
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for sys/types.h... (cached) yes
checking for netinet/in.h... yes
checking for arpa/nameser.h... yes
checking for netdb.h... yes
checking for resolv.h... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking whether sys/types.h defines makedev... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking arpa/telnet.h usability... yes
checking arpa/telnet.h presence... yes
checking for arpa/telnet.h... yes
checking crypt.h usability... no
checking crypt.h presence... no
checking for crypt.h... no
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking float.h usability... yes
checking float.h presence... yes
checking for float.h... yes
checking for inttypes.h... (cached) yes
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking malloc.h usability... no
checking malloc.h presence... no
checking for malloc.h... no
checking for netdb.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/crypt.h usability... no
checking sys/crypt.h presence... no
checking for sys/crypt.h... no
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/rusage.h usability... no
checking sys/rusage.h presence... no
checking for sys/rusage.h... no
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for sys/stat.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking values.h usability... no
checking values.h presence... no
checking for values.h... no
checking whether byte ordering is bigendian... no
checking for int64_t... yes
checking for pid_t... yes
checking for size_t... (cached) yes
checking for struct stat.st_rdev... yes
checking for uint32_t... yes
checking size of int... 4
checking size of char *... 8
checking for library containing sqrt... none required
checking for library containing crypt... none required
checking for library containing malloc... none required
checking for library containing backtrace... none required
checking for int64_t... (cached) yes
checking for pid_t... (cached) yes
checking for size_t... (cached) yes
checking for struct stat.st_rdev... (cached) yes
checking for uint32_t... (cached) yes
checking for uint64_t... yes
checking for sighandler_t... no
checking for error_at_line... no
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking whether lstat correctly handles trailing slash... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for working strtod... yes
checking for dup2... yes
checking for floor... yes
checking for getcwd... yes
checking for gethostname... yes
checking for gettimeofday... yes
checking for memchr... yes
checking for memmove... yes
checking for memset... yes
checking for mkdir... yes
checking for munmap... yes
checking for pow... yes
checking for putenv... yes
checking for regcomp... yes
checking for rmdir... yes
checking for setlocale... yes
checking for socket... yes
checking for sqrt... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strcspn... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strpbrk... yes
checking for strrchr... yes
checking for strspn... yes
checking for strstr... yes
checking for strtol... yes
checking for strtoul... yes
checking for tzset... yes
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for libevent >= 2.0... yes
checking for library containing evthread_use_pthreads... -levent_pthreads
configure: creating ./config.status
config.status: creating Makefile
config.status: creating packages/Makefile
config.status: creating configure.h
***************** Configuration completed **************
Compiling FluffOS 3.0-alpha8 (fluffos-3.0-alpha7.4-32-g2ae4947) as driver for x86_64-apple-darwin13.0.2.

INSTALL: '/usr/bin/install -c'
INSTALL DIR: '/Users/amok/Documents/code/fluffos-next-3.0/bin'
BISON/YACC: 'bison -y'
PREPROCESSING: 'g++ -E -march=native  -O3 -g -gdwarf-2 -std=c++11 -D_GNU_SOURCE -fno-omit-frame-pointer -flto'
COMPILE: 'g++ -march=native  -O3 -g -gdwarf-2 -std=c++11 -D_GNU_SOURCE -fno-omit-frame-pointer -flto'
LINK: 'g++ -march=native  -O3 -g -gdwarf-2 -std=c++11 -D_GNU_SOURCE -fno-omit-frame-pointer -flto  -flto -rdynamic'

LIBEVENT: '-levent', '', ''

Compiler Version:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.2
Thread model: posix
Edit Makefile if this is not what you want

Otherwise, type '/Applications/Xcode.app/Contents/Developer/usr/bin/make' to build FluffOS, then '/Applications/Xcode.app/Contents/Developer/usr/bin/make install'.

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Compile errors
« Reply #4 on: February 12, 2014, 04:53:51 PM »
try

CXX=clang++ ./build.FluffOS

FluffOS 3.0 require gcc 4.6+, the gcc bundled with mac is not going to cut it. the best bet for you is to switch to clang++ instead.

Offline Am0k

  • Acquaintance
  • *
  • Posts: 9
    • View Profile
Re: Compile errors
« Reply #5 on: February 13, 2014, 02:49:14 AM »
Unfortunately I get the same errors for alpha8 and alpha7.4 using clang++. Anything else i could try here ?


I got FluffOS 2.27 to compile after yet another error following the 'LPC_INT' fix.
error with #undef POSIX_TIMERS in local_options.
Code: [Select]
....
gcc -std=c99 -D_GNU_SOURCE -m64 -flto -D__USE_FIXED_PROTOTYPES__ -O3 -o obj/posix_timers.o -c posix_timers.c
posix_timers.c:9:8: error: unknown type name 'timer_t'; did you mean 'time_t'?
static timer_t eval_timer_id,  hb_timer_id;
       ^~~~~~~
       time_t
/usr/include/sys/_types/_time_t.h:30:26: note: 'time_t' declared here
typedef __darwin_time_t         time_t;
                                ^
1 error generated.
make[1]: *** [obj/posix_timers.o] Error 1
make: *** [main_build] Error 2


Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Compile errors
« Reply #6 on: February 13, 2014, 02:50:27 AM »
please  post clang++ errors.

Offline Am0k

  • Acquaintance
  • *
  • Posts: 9
    • View Profile
Re: Compile errors
« Reply #7 on: February 13, 2014, 02:59:42 AM »
As I said, I get exactly the same error messages for alpha8 and alpha7.4 using clang++ as posted in my first post.

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Compile errors
« Reply #8 on: February 13, 2014, 02:19:35 PM »
can you try this?  install gcc48 via homebrew

https://apple.stackexchange.com/questions/38222/how-do-i-install-gcc-via-homebrew

For 2.27: it was never fixed to compile on different platforms . From the look of it,  it may also be resolvable through installing gcc48

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Compile errors
« Reply #9 on: February 18, 2014, 10:10:34 PM »
Any update?  Did that work?

FluffOS as in current shape is best to be compiled on ubuntu/debian/centos.  It is the plan to make 3.0 more accessible in other platforms/development environment.

Offline Maze of Ith

  • Acquaintance
  • *
  • Posts: 33
  • Sometimes nothing can be a really cool hand.
    • View Profile
Re: Compile errors
« Reply #10 on: April 22, 2014, 10:15:45 PM »
I am running into the same issue compiling on OS X 10.9.2 - exact errors and everything. I am installin gcc48 now and will let you all know how it goes (thank you, fink).
zed @ looney2.com 8888
zed <at> lilypadmudlib <dot> com

Offline Maze of Ith

  • Acquaintance
  • *
  • Posts: 33
  • Sometimes nothing can be a really cool hand.
    • View Profile
Re: Compile errors
« Reply #11 on: April 23, 2014, 11:56:04 PM »
Same error when using gcc 4.8 and clang:
Code: [Select]
backend.cc:161:22: error: no matching conversion for functional-style cast from
      '__bind<int (&)(bool), bool>' to 'tick_event::callback_type'
      (aka 'function<void ()>')
  ...tick_event::callback_type(std::bind(reclaim_objects, true)));

Code: [Select]
make[1]: *** [backend.o] Error 1
make: *** [all] Error 2

I am going to poke around a bit and see if I can get it to work. If I find anything, I will post back, but am definitely open to suggestions.
zed @ looney2.com 8888
zed <at> lilypadmudlib <dot> com

Offline Maze of Ith

  • Acquaintance
  • *
  • Posts: 33
  • Sometimes nothing can be a really cool hand.
    • View Profile
Re: Compile errors
« Reply #12 on: April 25, 2014, 03:29:43 PM »
Well, the motherboard in my mac ate it. It doesn't surprise me all that much, as I knew it was coming. Ha! Oh well. I have ordered replacement parts which I should be getting soon. Once I get it back up and running I will see what progress I can make on the OS X compile issues.

Ith\Zed
zed @ looney2.com 8888
zed <at> lilypadmudlib <dot> com

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Compile errors
« Reply #13 on: April 26, 2014, 11:00:03 AM »
I'm sorry to hear that:  I'm still not quite sure why the problem arose: can you post the gcc commandline executed that produced this error (it should be just above the error you cut)

look for -I in the command line and see if it is correctly referencing the correct 4.8 c++ headers.

Offline FallenTree

  • BFF
  • ***
  • Posts: 476
    • View Profile
Re: Compile errors
« Reply #14 on: September 05, 2014, 02:00:01 PM »
Has this been resolved?