Giter VIP home page Giter VIP logo

Comments (5)

troglobit avatar troglobit commented on May 29, 2024

No problem, getting to know autotools & friends can be a bit of a hassle to most people.

The configure script is generated before release by the maintainers and included in the release tarballs. Generated files are usually not stored in version control systems, it's considered bad form.

Fellow developers learn to have all the autotools installed and run the autogen.sh script that most projects have. It creates all the files needed to build the project, including the configure script.

However, I always recommend regular users to download the latest release tarball instead.

Merry Christmas 😊

from editline.

neatville avatar neatville commented on May 29, 2024

Thanks... after installing autoconf, automake, and libtool, I re-ran the installation steps, and did not see any error messages. However, this still gives me an error, whether I include the folder name or not:

#include <editline/readline.h>

When I run gcc -Wall file.c -o out

edit: I'm sorry, I'm going through a book called "Build your own lisp", and I missed a step: su -c "yum install libedit-dev*" Hopefully this thread might even help someone else at some point. For those of you who are doing the exact same thing, you may need to comment-out the inclusion of readline and history so you don't get a not found error, as I did. Interestingly enough though, I do get these warnings despite the program now appearing to work as expected:

repl.c: In function ‘main’:
repl.c:15:17: warning: implicit declaration of function ‘readline’; did you mean ‘getline’? [-Wimplicit-function-declaration]
   char* input = readline("lispy> ");
                 ^~~~~~~~
                 getline
repl.c:15:17: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
repl.c:17:3: warning: implicit declaration of function ‘add_history’ [-Wimplicit-function-declaration]
   add_history(input);
   ^~~~~~~~~~~
At top level:
repl.c:8:13: warning: ‘input’ defined but not used [-Wunused-variable]
 static char input[2048];
             ^~~~~

The code:

#include <stdio.h>
#include <stdlib.h>

// #include <editline/readline.h>
// #include <editline/history.h>


static char input[2048];

int main(int arc, char** argv) {
	puts("lispy version 1");
	puts("ctrl+c to exit.\n");

	while(1) {
		char* input = readline("lispy> ");

		add_history(input);

		printf("no you are a %s", input);

		free(input);
	}

	return 0;

}

from editline.

rofl0r avatar rofl0r commented on May 29, 2024

it's because you dont grok C. after building a library, you must tell your compiler where to find the library and headers, or install them into the path where the compiler looks into by default. that would typically mean ./configure --prefix=/usr followed by make && make install. those warnings are serious and you have to include the headers.

from editline.

troglobit avatar troglobit commented on May 29, 2024

@neatville I've update the example in the README.md to provide better instructions to first time users, of both GNU configure and editline.

Some other points to notice:

  1. You mention #include <editline/readline.h> above, that does not exist, only #include <editline.h>
  2. You also mention su -c "yum install libedit-dev*", which likely installs some other version of this
    library, in /usr/ unlike the defaults of this library which is /usr/local

If you want to use this library, and not libedit as provided by yum, then follow my updated example, or see the comment by @rofl0r

I'm preparing a new release of this library soon, so please let me know if this answer was to your satisfactory, so we can close this issue.

from editline.

troglobit avatar troglobit commented on May 29, 2024

No activity, closing. Version 1.16.0 released today.

from editline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.