[sane-devel] Compile problem ,please help!

Wittawat Yamwong wy-sane-devel at arcor.de
Wed Aug 2 18:58:20 UTC 2006

On Wednesday 02 August 2006 12:26, zf wrote:
>     I am a new programmer in linux. I wrote one sane-backend named khf.c .
> When I finished this code, I use gcc compiled sane-backends/frontend/test.c
> and khf.c into one executable file.Then I run it , and it works~ my code
> can control the scanner. After that , I compile khf.c into one shared
> object named libsane-khf.so.1 and do this by using this command: gcc
> -shared -fpic khf.c -o libsane-khf.so.1 After that I do two things:
>   1. copy libsane-khf.so.1 into /usr/lib/sane
>   2. Add one line in /etc/sane.d/dll.conf : khf
>     However ,when I run xsane,it can't find any scanner. And I found my so
> isn't been called, since the sane_init is not called when xsane starts.
> This problem troubled me for a long time. Please help me!

I assumed that you're using bash or similar shell.

$ export SANE_DEBUG_DLL=3
$ scanimage -L

The debug messages will tell you whether your backend was loaded by the 
libsane-dll.so. Possibly that you didn't export the API functions as 
sane_khf_init, sane_khf_exit etc.

Wittawat Yamwong
Hannover, Germany

More information about the sane-devel mailing list