Link error when compiling with backend API

bui bqbao at yahoo.com
Tue Mar 29 05:56:47 PDT 2011


Hi,

I am trying to use cupsBackendDeviceURI API to retrieve the printer URI. Unfortunately I get the " undefined reference to `cupsBackendDeviceURI(char**)" when compiling

My code is:

        char *backend = "usb";
        const char	*uri;
       uri = cupsBackendDeviceURI(&backend);

Below is the linker output:
/home/bao/work/buildroot/output/staging/usr/bin/arm-unknown-linux-uclibcgnueabi-g++ --sysroot=/home/bao/work/buildroot/output/staging -L/home/bao/work/buildroot/output/staging/lib -L/home/bao/work/buildroot/output/staging/usr/lib -Wl,-O1 -o AutoPrint WidgetKeyboard.o Main.o autoprint.o cupshelper.o moc_WidgetKeyboard.o moc_autoprint.o qrc_WidgetKeyboard.o -L/home/bao/work/buildroot/output/staging/usr/lib -lcups -lQtGui -L/home/bao/work/buildroot/output/staging/usr/lib -lQtNetwork -lQtCore -lpthread -lcupsdriver



/home/bao/work/buildroot/output/staging/usr/lib/libcups.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
/home/bao/work/buildroot/output/staging/usr/lib/libglib-2.0.so.0: warning: the use of OBSOLESCENT `utime' is discouraged, use `utimes'
autoprint.o: In function `autoprint::printerSelected(int)':
autoprint.cpp:(.text+0x800): undefined reference to `cupsBackendDeviceURI(char**)'
collect2: ld returned 1 exit status


Any help?

Thanks




More information about the cups mailing list