[sane-devel] Canoscan 8400F

Myroslav Kavatsyuk m.kavatsyuk at yahoo.com
Wed Oct 29 11:18:44 UTC 2014


Dear Stef,
Thanks a lot for a provided example. From your code I have made a program (see attachment) whichcompiles. However, I can not link it with the libsane-genesys. apparently I miss something.
I have compiled SANE libraries as following:> export BACKENDS=genesys> export CFLAGS="-D UNIT_TESTING"> ./configure --prefix=.....
The program compiles perfectly as:> gcc -I ./compile/include/ -I ./compile/backend/ -c tst_scan.c
But when trying to link against libsane-genesys library gcc complains:> gcc -I ./compile/include/ -I ./compile/backend/ -L ./local/lib/sane/ -l sane-genesys tst_scan.c -o tst_scan/tmp/cc958m4x.o: In function `sanei_debug_genesys_call':
tst_scan.c:(.text+0xad): undefined reference to `sanei_debug_msg'
/tmp/cc958m4x.o: In function `main':
tst_scan.c:(.text+0xcd): undefined reference to `sanei_init_debug'
tst_scan.c:(.text+0xe0): undefined reference to `sane_genesys_init'
tst_scan.c:(.text+0xf3): undefined reference to `sane_strstatus'
tst_scan.c:(.text+0x120): undefined reference to `sane_genesys_open'
tst_scan.c:(.text+0x133): undefined reference to `sane_strstatus'
tst_scan.c:(.text+0x14a): undefined reference to `sane_genesys_exit'
tst_scan.c:(.text+0x188): undefined reference to `sanei_genesys_compute_dpihw'
tst_scan.c:(.text+0x2b0): undefined reference to `gl843_init_scan_regs'
tst_scan.c:(.text+0x2ec): undefined reference to `sane_strstatus'
tst_scan.c:(.text+0x32c): undefined reference to `gl843_begin_scan'
tst_scan.c:(.text+0x33f): undefined reference to `sane_strstatus'
tst_scan.c:(.text+0x3b8): undefined reference to `sanei_genesys_read_data_from_scanner'
tst_scan.c:(.text+0x3d4): undefined reference to `gl843_end_scan'
tst_scan.c:(.text+0x3e7): undefined reference to `sane_strstatus'
tst_scan.c:(.text+0x42b): undefined reference to `sanei_genesys_write_pnm_file'
tst_scan.c:(.text+0x45b): undefined reference to `sane_genesys_close'
tst_scan.c:(.text+0x460): undefined reference to `sane_genesys_exit'
If I try to use libtool, it complains that I am linking against loadable module

Apparently I am doing something wrong.Please let me know what is the proper way of compiling a  unit testing program.
Thanks a lot,Myroslav

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20141029/1edd8187/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst_scan.c
Type: text/x-csrc
Size: 2730 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20141029/1edd8187/attachment-0001.c>


More information about the sane-devel mailing list