Pelles C forum

Pelles C => Bug reports => Topic started by: rko on July 12, 2018, 06:26:54 PM

Title: GetDefaultPrinterA missing from libs
Post by: rko on July 12, 2018, 06:26:54 PM
I:\openbgi\library\graphics.c(354): warning #2018: Undeclared function 'strcpy_s' (did you mean: strcpy?); assuming 'extern' returning 'int'.
I:\openbgi\library\graphics.c(1628): warning #2115: Local 'dataOffset' is initialized but never used.
I:\openbgi\library\graphics.c(1627): warning #2115: Local 'fileSize' is initialized but never used.
I:\openbgi\library\graphics.c(91): warning #2135: Static 'bitarray' is not referenced.
Erzeugen von I:\openbgi\library\bgi\bgi.dll.
POLINK: error: Unresolved external symbol 'GetDefaultPrinterA' - referenced from 'I:\openbgi\library\bgi\output\graphics.obj'.
POLINK: fatal error: 1 unresolved external(s).
Title: Re: GetDefaultPrinterA missing from libs
Post by: TimoVJL on July 12, 2018, 06:51:32 PM
I:\openbgi\library\graphics.c(354): warning #2018: Undeclared function 'strcpy_s' (did you mean: strcpy?); assuming 'extern' returning 'int'.
define __STDC_WANT_LIB_EXT1__=1
POLINK: error: Unresolved external symbol 'GetDefaultPrinterA' - referenced from 'I:\openbgi\library\bgi\output\graphics.obj'.
did you include winspool.lib
Title: Re: GetDefaultPrinterA missing from libs
Post by: rko on July 12, 2018, 07:58:53 PM
did you include winspool.lib

yes


define __STDC_WANT_LIB_EXT1__=1
thanks for that, didn't know

Title: Re: GetDefaultPrinterA missing from libs
Post by: Pelle on July 15, 2018, 01:15:15 PM
GetDefaultPrinterA/W() is included in winspool.lib, but with the same attributes as in M$ import libs. For some reason the import is by ordinal, although it looks like the export is by name (GetProcAddress by name works). No idea why. Using M$ tools and SDK gives the same linker error.

Use GetProcAddress(..., "GetDefaultPrinterA") or build your own import lib for winspool.