Hi

I have made a program that will change the settings of printer orientation.

But I am getting linker error.

" [Linker error] undefined reference to `OpenPrinterA@12' "

I am not able to find out the reason.

Kindly advice
Regards
Karan Gupta

The reason is that you did not include the correct library. Look up that function in MSDN and it will tell you what library you need. Go to www.microsoft.com and enter OpenPrinter in its search box, it will give you a list of links. Select the first link in the list, when the page comes up, scroll down to the bottom and you will see the name of the library you need.

But I am getting linker error.
" [Linker error] undefined reference to `OpenPrinterA@12' "

You (may) need to #include <winspool.h> If you are not using a MS compiler, you need to link with libwinspool.a, otherwise winspool.lib.

Hi

I am using DEV C++. Do I still need to link to libwinspool.a. If yes then what is the procedure to do that

Regards
Karan

I am using DEV C++. Do I still need to link to libwinspool.a.

Yes, to link with libwinspool.a, open the Project/Options/Parameters tab, click Add Library or Object and browse for that library.

This question has already been answered. Start a new discussion instead.