Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jul 2003 02:04:20 +0200
From:      Marcin Dalecki <mdcki@gmx.net>
To:        Priit Piipuu <priit.piipuu@mail.ee>
Cc:        hackers@freebsd.org
Subject:   Re: libedit and g++
Message-ID:  <3F11F384.6060205@gmx.net>
In-Reply-To: <20030714014658.GD5738@minerva.meskaliin.ee>
References:  <20030714014658.GD5738@minerva.meskaliin.ee>

next in thread | previous in thread | raw e-mail | index | archive | help
Priit Piipuu wrote:
> Hi!
> 
> There seems to be a problem using libedit from C++. Small test case:
> 
> 
>>cat test.c
> 
> #include <stdio.h>
> #include <histedit.h>
> 
> int
> main(void) {
>   EditLine *ed;
> 
>   ed = el_init("foo", stdin, stdout, stderr);
>   el_end(ed);
> 
>   return 0;
> }
> 
>>gcc -ledit -ltermcap -o test test.c
>>g++ -ledit -ltermcap -o test test.c
> 
> /var/tmp//ccAVIwg7.o: In function `main':
> /var/tmp//ccAVIwg7.o(.text+0x28): undefined reference to `el_init(char const*, __sFILE*, __sFILE*, __sFILE*)'
> /var/tmp//ccAVIwg7.o(.text+0x39): undefined reference to `el_end(editline*)'
> 
> What did I miss?

Some lectures in C++ classroom. Hint: extern "C"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F11F384.6060205>