PDA

View Full Version : Windows OpenPrinter problem



dougbroadwell
5th April 2010, 20:58
I realize that this is more of a Windows problem than a Qt problem, but I don't know how to proceed debugging this problem.

I have a Qt program that is printing to a Dymo labeler with two sets of labels. My program does not pop up a QPrintDialog, and none of the defined enumerations for QPrinter::PaperSource will select the Left labels.

I found an example program to print directly to the printer so that I could send the Escape code to the printer to select the label ("RawDataToPrinter") but when I compile it I get the error "undefined reference to 'OpenPrinterW@12' ". I can find the OpenPrinterW(...) in winspool.h but I've never seen a function with something like "@12" appended to it.

Any ideas on how to proceed with debugging this - or other ways I can get some raw data to the printer - would be appreciated.

Thanks

dougbroadwell
9th April 2010, 19:23
Found the answer: I needed to tell the linker to include the winspool library (libwinspool.a). Added "LIB += -lwinspool" to the .pro file and all fixed.