0

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 by mike_2000_17: Fixed formatting

3
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by mitrmkar
0

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.

0

Hi

Linking problem is solved but Print Dialog is not shown

Regards
Karan

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.