Hi

I am writing a code in which I have to display the print dialog.

PRINTDLG pdlg;
memset( &pdlg, 0, sizeof( PRINTDLG ) );
pdlg.lStructSize = sizeof( PRINTDLG );
pdlg.Flags = PD_RETURNDEFAULT | PD_RETURNDC;
PrintDlg( &pdlg );

But I am getting an error message

"[Linker error] undefined reference to `PrintDlgA@4' "

When I debug the code I found that I am getting this error on this line

PrintDlg( &pdlg );

Am I missing something.

Kindly advice

Regards
Karan

Edited 3 Years Ago by mike_2000_17: Fixed formatting

I think the library you need is libcomdlg32.a.

Generally, when you get linker errors related to Windows API functions, lookup the function's documentation in MSDN, scroll down to the bottom of page where you can find the name of the required .lib (i.e. in this case: Import library Comdlg32.lib). That gives you enough information to map the Win .lib file to the Dev-Cpp's counterpart.

Hi

Linking problem is solved but Print Dialog is not shown

Regards
Karan

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