First of all, be sure that you have -dev
package installed as well. On my Debian system I did:
$ sudo apt-get install libxdelta2-dev
Now you should be able to use those xdelta
headers. But they can have different naming than you use. You can check it this way:
$ dpkg -L libxdelta2-dev | grep include
For me shows:
/usr/include/edsio_edsio.h
/usr/include/edsio.h
/usr/include/xd_edsio.h
/usr/include/xdelta.h
So you can see that in this case I should use xdelta.h
header, no xdelta3.h
. Try the same dpkg -L
command with your -dev
package.
If you have different version of xdelta*-dev
package, check output of this command:
pkg-config --list-all | grep delta
For me output is empty, but if you have something like libxdelta
in output, be sure to compile your application with these options:
$ gcc $(pkg-config --cflags --libs libxdelta) main.c
UPDATE 1
As for the linking issue you have. I guess you are using gcc, so it automatically uses correct linker for you. The thing is, you should provide library name, which you want to link your program with, as a linker option.
First you should figure out your actual library name:
$ ls -1 /usr/lib | grep xdelta | grep so
You will see something like this:
libxdelta.so
libxdelta.so.2
libxdelta.so.2.0.0
Now you know your library name: it's part of library file name between lib and .so, in this case library name is xdelta.
Now you can link your program with it, using -l
option:
$ gcc -lxdelta main.c
You may be also needed to specify path to xdelta library, if it's not a standard one (like /usr/lib/
):
$ gcc -L/your/path/to/xdelta/ -lxdelta main.c
UPDATE 2
How to build and use xdelta3.
Obtain sources:
cd /tmp
wget https://xdelta.googlecode.com/files/xdelta3-3.0.8.tar.xz
tar xJvf xdelta3-3.0.8.tar.xz
cd xdelta3-3.0.8/
Build and install:
./configure
make
sudo make install
Check if it works:
cd examples/
make clean
make encode_decode_test
./encode_decode_test
If everything is fine, you should have executable file "encode_decode_test". It's example uses xdelta3. Now you can build your program the same way. See "Makefile" file inside of "examples" directory to get a clue how to build your program. Note that there is no libraries involved now.