www.digitalmars.com         C & C++   DMDScript  

D - Making windows API Calls

reply tbayne hiwaay.net writes:
Hi,

I have a question.  I have just started playing with 'D' under windows.  I am
trying to call the OutputDebugString() function and can't quite figure out how
to make this work.

I keep getting a "Error 42: Symbol Undefined _OUTPUTDEBUGSTRING 4" message from
the linker.

Thanks

Terry Bayne
tbayne hiwaay.net
Jul 23 2003
next sibling parent Paul Runde <prunde consolidated.net> writes:
Try adding the declaration:

export void OutputDebugStringA(LPCTSTR);

or for wchar:

export void OutputDebugStringW(LPCWSTR);

windows.d is not complete yet.  You could create a file to hold
API declarations specific to your needs and remove them later as they
are added to the D distribution.  You may also find existing files for
download at any of the sites listed on the D Links page.  Try DedicateD 
(http://int19h.tamb.ru/).

Paul


tbayne hiwaay.net wrote:

 Hi,
 
 I have a question.  I have just started playing with 'D' under windows.  I am
 trying to call the OutputDebugString() function and can't quite figure out how
 to make this work.
 
 I keep getting a "Error 42: Symbol Undefined _OUTPUTDEBUGSTRING 4" message from
 the linker.
 
 Thanks
 
 Terry Bayne
 tbayne hiwaay.net
Jul 23 2003
prev sibling next sibling parent Burton Radons <loth users.sourceforge.net> writes:
tbayne hiwaay.net wrote:

 I have a question.  I have just started playing with 'D' under windows.  I am
 trying to call the OutputDebugString() function and can't quite figure out how
 to make this work.
Use: extern (Windows) void OutputDebugStringA (char*); And then when calling DMD to compile it, include "kernel32.lib" as an option.
Jul 23 2003
prev sibling parent Helmut Leitner <helmut.leitner chello.at> writes:
tbayne hiwaay.net wrote:
 
 Hi,
 
 I have a question.  I have just started playing with 'D' under windows.  I am
 trying to call the OutputDebugString() function and can't quite figure out how
 to make this work.
 
 I keep getting a "Error 42: Symbol Undefined _OUTPUTDEBUGSTRING 4" message from
 the linker.
Added to the FAQ page: <http://www.prowiki.org/wiki4d/wiki.cgi?FaqRoadmap#CallaWindowsfunction> -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Jul 24 2003