0
votes

My dev environment is windows xp, eclipse 3.3, cdt 4.0.3, mingw 3.17 (in fact I use easymingwtoolkit)

I'd like to use functions like iconv_open() or related in c lanague. I included the , then I build my source file - test.c, and I got errors: gcc -octest.exe test.o test.o: In function code_convert': G:\workspace\ctest\Debug/../test.c:49: undefined reference tolibiconv_open' G:\workspace\ctest\Debug/../test.c:52: undefined reference to libiconv' G:\workspace\ctest\Debug/../test.c:53: undefined reference tolibiconv_close' collect2: ld returned 1 exit status Build error occurred, build is stopped Time consumed: 1343 ms.

I'm a total beginner at this, can anyone tell me what to do to check where I went wrong? Great thanks!

1

1 Answers

0
votes

Somewhere in the preferences you included your libraries. You clicked a little "+" sign and wrote "libiconv", "libiconv_open", etc. The string "lib" is automatically prefixed to libraries some time. So instead, try "iconv" and "iconv_open" and see if that works. If that doesn't work then find the name of the library files, (probably something like "libiconv.a") and enter in the box ":libiconv.a" You then notice that when the linker get's called is will use the "-l:libiconv.a" parameter which tells the linker to look for that exact file name.