On 29/10/2014 12:18, Myroslav Kavatsyuk wrote:
Dear Stef,

Thanks a lot for a provided example. From your code I have made a program (see attachment) which compiles. 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

    Hello,

is the libsane-genesys also built with -DUNIT_TESTING ? These private symbols aren't made public until UNIT_TESTING is defined.

Regards,
    Stef
-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to sane-devel-requ...@lists.alioth.debian.org

Reply via email to