NO

Author Topic: How to link CRT library to DLL project?  (Read 3001 times)

themaster

  • Guest
How to link CRT library to DLL project?
« on: October 16, 2013, 02:55:16 PM »
Created a simply DLL project and it worked fine. Then I needed to output some debug info in message box and wanted to use Microsoft C++ CRT function swprintf. IDE highlited it for me, so I was very disappointed when saw warning message:
Code: [Select]
"d:\Docs\Pelles C Projects\Hook dll\dllmain.c(128): warning #2018: Undeclared function 'swprintf'; assuming 'extern' returning 'int'."Some search in forum topics showed than CRT functions must link by default. What should I check to prove it? How to "relink" it if they are not linked?

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: How to link CRT library to DLL project?
« Reply #1 on: October 16, 2013, 03:31:05 PM »
swprintf() is defined in <wchar.h>

You can use wsprintf() instead and that comes from user32.dll .
« Last Edit: October 16, 2013, 03:46:48 PM by timovjl »
May the source be with you