Dear Stef,
The SANE was configured with the proper CFLAGS shell variables:
export CFLAGS="-DUNIT_TESTING=1"
export LDFLAGS="-DUNIT_TESTING=1"
export CPPFLAGS="-DUNIT_TESTING=1"
export BACKENDS=genesys
export PRELOADABLE_BACKENDS=genesys
./configure --prefix=/home/xxx/4_pwork/SANE/local/
I have checked, during the compilation process definition statements were
passed to compiler:
/bin/bash ../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H
-I. -I../include/sane -I/usr/local/include -I. -I. -I../include -I../include
-DLIBDIR="/home/xxx/4_pwork/SANE/local/lib/sane" -DBACKEND_NAME=genesys
-DUNIT_TESTING=1 -D_REENTRANT
-DPATH_SANE_CONFIG_DIR=/home/xxx/4_pwork/SANE/local/etc/sane.d
-DPATH_SANE_DATA_DIR=/home/xxx/4_pwork/SANE/local/share
-DPATH_SANE_LOCK_DIR=/home/xxx/4_pwork/SANE/local/var/lock/sane -DV_MAJOR=1
-DV_MINOR=0 -DUNIT_TESTING=1 -W -Wall -Wcast-align -Wcast-qual
-Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wreturn-type
-Wstrict-prototypes -pedantic -ansi -MT libgenesys_la-genesys_gl843.lo -MD -MP
-MF .deps/libgenesys_la-genesys_gl843.Tpo -c -o libgenesys_la-genesys_gl843.lo
`test -f 'genesys_gl843.c'
But the resulting library does not make functions public.
Best regards,Myroslav
From: Stef <[email protected]>
To: Myroslav Kavatsyuk <[email protected]>;
"[email protected]" <[email protected]>
Sent: Thursday, October 30, 2014 9:07 PM
Subject: Re: Canoscan 8400F
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: [email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
to [email protected]