fabianishere / brainfuck

Brainfuck interpreter written in C
Apache License 2.0
541 stars 74 forks source link

libedit/history.h include error #57

Closed ghost closed 7 years ago

ghost commented 7 years ago

So , I got the interpreter working but just letting you know about this bug.

my software specs:

 OS: Arch Linux
 KDE Plasma Version: 5.10.5
 KDE Frameworks Version: 5.37.0
 Qt Version: 5.9.1
 Kernel Version: 4.12.8-2-ARCH
 OS Type: 64-bit
 ------------------------------------------------------------
  COMPILER
 ------------------------------------------------------------
 gcc (GCC) 7.1.1 20170630
 Copyright (C) 2017 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 --------------
  LIBEDIT
 --------------

 libedit 20170329_3.1-1 [installed]

When I compiled it shot with a include error ,

fatal error: editline/history.h: No such file or directory
   #include <editline/history.h>
            ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/brainfuck.dir/build.make:63: CMakeFiles/brainfuck.dir/src/main.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/brainfuck.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

So what I did was comment this line in src/main.c

#ifdef BRAINFUCK_EDITLINE_LIB
        #include <editline/readline.h>
/*      
 * This line caused the compile error , even if it is not mac
 * I think , We don't need to include editline/history.h when
 * We already included editline/readline.h
        #ifndef __APPLE__ 
                #include <editline/history.h>  
        #endif
*/
#endif

After editing this , I compiled successfully!

is this intensional?...... just reporting!

fabianishere commented 7 years ago

Thanks for the report! This should not happen.

The editline/history.h include is indeed not needed. An include like that is to my knowledge only required when using the GNU readline library.

ghost commented 7 years ago

okay!