fabianishere / brainfuck

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

error on make; editline/readline.h: no such file or directory #62

Closed smlavine closed 6 years ago

smlavine commented 6 years ago

Hello. When I try to make the program, an error shows that editline/readline/h does not exist.

`[ 40%] Built target libbrainfuck_static [ 60%] Building C object CMakeFiles/brainfuck.dir/src/main.c.o /media/sebastian/UUI/sml/Coding/BF/brainfuck/src/main.c:24:11: fatal error: editline/readline.h: No such file or directory

include <editline/readline.h>

       ^~~~~~~~~~~~~~~~~~~~~

compilation terminated. CMakeFiles/brainfuck.dir/build.make:62: recipe for target 'CMakeFiles/brainfuck.dir/src/main.c.o' failed make[2]: [CMakeFiles/brainfuck.dir/src/main.c.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/brainfuck.dir/all' failed make[1]: [CMakeFiles/brainfuck.dir/all] Error 2`

I have libedit in a directory in my home directory, and I have the dependencies required for that as well. Am I doing something wrong?

fabianishere commented 6 years ago

Hi! Are you sure the header files of libedit are on your include path?

What platform are you using exactly and how do you have the libedit library installed?

smlavine commented 6 years ago

Currently, the compiler is in /media/sebastian/UUI/sml/Coding/BF/brainfuck, with the build directory in the brainfuck directory. The libedit directory is in /home/sebastian. I am on Ubuntu 17.10.

fabianishere commented 6 years ago

Does it build if you install libedit (e.g. sudo apt-get install libedit-dev)?

smlavine commented 6 years ago

It built, but the command "brainfuck" doesn't work, even in the right directory.

fabianishere commented 6 years ago

In the build directory, you should invoke it by ./brainfuck instead of just brainfuck.

smlavine commented 6 years ago

Permission is denied. I have done chmod +x brainfuck, but it still won't work.


From: Fabian Mastenbroek notifications@github.com Sent: Friday, April 6, 2018 5:15 PM To: fabianishere/brainfuck Cc: Skai3v; Author Subject: Re: [fabianishere/brainfuck] error on make; editline/readline.h: no such file or directory (#62)

In the build directory, you should invoke it by ./brainfuck instead of just brainfuck.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/fabianishere/brainfuck/issues/62#issuecomment-379382079, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AgAj-CS5m9vJKHHhbKcaA6Mq47PrZ-8Gks5tl9r6gaJpZM4TKah5.

fabianishere commented 6 years ago

Could you verify that the brainfuck file is an ELF binary (file ./brainfuck) and you have execute permissions for the binary (ls -la ./brainfuck)?

smlavine commented 6 years ago

It is an ELF, but I do not have execute permissions. It's really weird, even when I do chmod +x brainfuck, it doesn't change, and even changing it through Nautilus and selecting properties, it will uncheck the box when I check it, or change any other properties. It seems I don't have any permissions for it, even in root.

fabianishere commented 6 years ago

Running sudo chmod +rx brainfuck does not solve the issue? Did you run make as normal user by the way?

smlavine commented 6 years ago

No, sudo chmod +rx brainfuck didn't do anything, and make was ran as a normal user.

fabianishere commented 6 years ago

What filesystem are you using? It could be related to your filesystem not supporting permissions or it being mounted as non-executable.

smlavine commented 6 years ago

It works now! The problem was that the interpreter was on a flash drive, I think. +++++++++++++++++++++[>++++[>+<-]<-]>>.++++++++++++++++++++.-------.+++++++++++++.---.<<++++++++[>++++[>>+<<-]<-]>>>.<++++++++++++++.----------.++++++.>.<+.-----------------.+++++++++++++.+++++++.>.<------------.++++++++.------------------.+++++.>+.