Harald van D?k
5/6/2011 6:30:00 AM
On May 6, 2:17 am, Heinrich Wolf wrote:
> Hello,
>
> which lib must I add for wchar_t?
>
> cc -o nim nim.c -lcurses
> /tmp/ccD8wZTE.o: In function `SetHolz':
> nim.c:(.text+0x23b): undefined reference to `addwstr'
> nim.c:(.text+0x24a): undefined reference to `addwstr'
> collect2: ld gab 1 als Ende-Status zurück
> make: *** [nim] Fehler 1
On May 6, 4:36 am, Heinrich Wolf wrote:
> The compiler did not complain about addwstr. Only the linker did.
Looking at how you're invoking the compiler, you're not asking it to
tell you when anything is wrong. Unfortunately, for several compilers,
including gcc which you are probably using, no warning is emitted by
default for implicit function declarations. First, try enabling
warnings. If you still get no warning for the implicit function
declaration, then you're using the header files for the wide-char-
aware version of ncurses, but linking with the non-wide-char-aware
version (which suggests the problem is with your (distro's) setup).
But if you do get a warning after that, then it's just because you
aren't using the wide-char-aware version of ncurses. How to install
and use that depends on exactly what system you're running. It may be
available as a replacement for the lib(n)curses you have installed
now, or it may install its header files and library using another name.