How to use libunrar.so in my c program?
Deal all,
I've download unrarsrc-3.9.4.tar.gz and make a libunrar.so lib, and I want to use it in my c code, I can hardly find any api docs using google, how to use libunrar.so in my c program? Thanks. |
When you made the library; e.g., with make, did you also (as super user) execute make install? Did the library get install in /usr/local/lib? Do you have a file, ld.so.conf somewhere in your /etc directory (or a sub-directory of /etc? If so, is there a line in that file like this:
Code:
/usr/local/lib Code:
cc -o prog prog.c -lunrar Code:
cc -o prog prog.c -LPATH_TO_DIRECTORY -lunrar The above is purposely simplified; it's probable that you'll need to include a header file, possibly ubnrar.h, that contains the definitions of the various functions contained in that library -- wouldn't be a bad idea to read the documentation that came with the unrarsrc package (README, manual pages, etc.). Hope this helps some. |
Thanks, but what I mean is that I dont know how to use functions the libunrar.so provide, is there any api docs for libunrar?
|
I've just spent about 30 minutes bouncing around looking for documentation for this thing... and, well, there just doesn't seem to be any. Odd, that. The unrarlib home site, http://www.unrarlib.org, tells us that the project is inactive (since October 2007), provides a bunch of links (none of which appear to document how to actually use the thing), and I'm at a loss.
I did download unrarsrc-3.7.8.tar.gz and did make -f makefile.unix which resulted in unrar (not a library, an executable utility). Executing that as unrar -help produces a listing of all the command line options -- maybe that's what you're looking for? Best of luck with it. |
Thanks for your work...
I use `make lib -f makefile.unix`, and got a `libunrar.so`, just dont know how to call the functions libunrar.so provide... |
After I couldn't find anything, anywhere that looked anything like documentation, I scanned through all the source code to see if there were any comments in the files describing what the functions was supposed to do and the like; nuthin, nowhere, nohow. From what I could gather, RAR appears to be a windows-only thing that's been ported to other systems (I think once in the last 10 years somebody has sent me a RAR file and I had to dig around to find unrar so I could unpack the thing). I looks to me like if you just make -f makefile.unix you'll get the utility, unrar, and you can figure out how to use it from the help; there's no man page, no documentation, but there is that utility. I just doesn't look like RAR is a going concern any more and it might be beating a dead horse.
Hope this helps some. |
All times are GMT -5. The time now is 03:38 PM. |