This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with libiconv


Rifat Mahmud <rftmhmd@gmail.com> writes:

> My libiconv.so file is in /usr/local/lib and it's a shared library.
> How do I compile the source foo.c which contains iconv.h header? I
> normally compile like this, 'gcc  -Wall -g foo.c -o foo' . I used
> 'gcc  -Wall -g -I/usr/local/lib foo.c -o foo' . but still there's same
> error. Tried with  'gcc  -Wall -g -I/usr/local/include foo.c -o foo' ,
> still the problem persists.

As Marc said, you need a -l option.  Something like:
    gcc -Wall -g -o foo foo.c -liconv
You may also need -L /usr/local/lib .

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]