I have downloaded a library for the purposes of writing a program that can uncompress a RAR file. (http://www.rarlab.com/rar/UnRARDLL.exe) This supplies me with unrar.dll, unrar.h, unrar.lib and UnRDLL.def. I have copied the C example code and have tried compiling it with both Dev-Cpp and Eclipse.
I don't have much experience using DLLs, so I don't know how to deal with the following linker errors:
UnRDLL.o(.text+0x151):UnRDLL.c: undefined reference to
RAROpenArchiveEx@4' UnRDLL.o(.text+0x1c0):UnRDLL.c: undefined reference to
RARSetCallback@12' UnRDLL.o(.text+0x1e2):UnRDLL.c: undefined reference toRARReadHeader@8' UnRDLL.o(.text+0x2b9):UnRDLL.c: undefined reference to
RARProcessFile@16' UnRDLL.o(.text+0x2fe):UnRDLL.c: undefined reference toRARCloseArchive@4' UnRDLL.o(.text+0x366):UnRDLL.c: undefined reference to
RAROpenArchiveEx@4' UnRDLL.o(.text+0x3d6):UnRDLL.c: undefined reference toRARSetCallback@12' UnRDLL.o(.text+0x41c):UnRDLL.c: undefined reference to
RARReadHeaderEx@8' UnRDLL.o(.text+0x4c2):UnRDLL.c: undefined reference toRARProcessFile@16' UnRDLL.o(.text+0x4fa):UnRDLL.c: undefined reference to
RARCloseArchive@4'
Google suggested adding --def UnRDLL.def and -lunrar to the linker options and also copying the .lib file to the Dev-Cpp\lib directory.
Can you please explain to me what I'm doing wrong? If possible, tell me what files need to be in the source code directory, what needs to be with libraries, what needs to be added to the project and what linker options there need to be, as well as anything else I've totally missed.
EDIT: I don't know why, but I just manually redid all the settings as described above and now it works. Thanks for your help anyway.