www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - Error 42: Symbol Undefined _DirectDrawCreate 12 (And I'm already

reply SL <shadowlord13 users.sourceforge.net> writes:
I'm getting this error (Error 42: Symbol Undefined _DirectDrawCreate 12) 
from the linker, despite the fact that I'm including ddraw.lib (which I 
generated from c:\windows\system32\ddraw.dll using implib (Digital Mars 
Import Library Manager Version 7.6B1n)) in the compile-line.

Compile line:

sc.exe -mn win.cpp noctis.cpp noctis-0.cpp noctis-1.cpp noctis.def 
user32.lib kernel32.lib winmm.lib ddrawex.lib advapi32.lib shell32.lib 
ddraw.lib gdi32.lib -oNoctis_D -dDEBUGBUILD -gp -s -Ju -L/co/ma -g -cpp 
| more

(No, all those libs aren't needed, but since this didn't want to work, I 
added anything that looked like it might remotely help)

The output after compilation is:
-----------------
link 
win+noctis+noctis-0+noctis-1,Noctis_D,,user32+kernel32+winmm+ddrawex+advapi
32+shell32+ddraw+gdi32+user32+kernel32,noctis/co/noi/co/ma;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

win.obj(win)
  Error 42: Symbol Undefined _DirectDrawCreate 12

--- errorlevel 1

-----------------

DirectDrawCreate does indeed exist in ddraw.dll, and it looks like it's 
in the lib as well, or so I'm guessing since it's in the text in the lib 
when I look at it in a hex-editor, though the text does not have a _ 
before DirectDrawCreate, or an  12 after it, anywhere 
("DirectDrawCreate" is in the lib file several times).

These are in the includes:
#include <initguid.h>
#include <ddraw.h>
#include <winuser.h>

(P.S. MSDN says that I only need to import ddraw.h and include ddraw.lib 
in the libraries to use DirectDrawCreate. 
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/direct
raw7/ddref_3h6f.asp 
)

I was having a problem where IID_IDirectDraw2 didn't exist before, but 
solved it by adding #include <initguid.h> there... #define INITGUID 
didn't work (I tried that first), but #include <initguid.h> did.

Also, I had to define DDSURFACEDESC2 (A struct) myself in order to use 
it, since it wasn't in ddraw.h either.

Also, IID_IDirectDraw7 didn't (doesn't) seem to exist either, and I had 
(have) no effective way to fix that, since I would have to know the 
massively long number it's made from....

-----

I thought that the problem might have been the ddraw header file being 
out of date, so I downloaded the DirectX SDK, and installed it, and took 
the ddraw.h from there and threw it in the program source folder, and 
changed the #include <ddraw.h> to #include "ddraw.h" - And, well, 
DDSURFACEDESC2 exists now, so I commented out mine, but it still won't 
link, still giving that error about _DirectDrawCreate 12. :/

I tried implib /system, too, by the way, and didn't notice any 
difference. Also tried running implib on a ddraw.def I got from 
http://programming.ccp14.ac.uk/ftp-mirror/programming/mingw32/home/janjaap/mingw32/platfo
m-SDK/def/ddraw.def 
(found via google), which didn't solve the linking problem either.

(I managed to get it to link by hex-editing the .lib to say 
_irectDrawCreate, and changing the function name in the ddraw.h and the 
source files which use it to irectDrawCreate (no D), but of course, the 
program won't run. :P)

I suppose the question I should be asking is "How do I make DM stop 
adding that _ before the function name and the  12 after the function 
name, because the .dll and the .lib don't have it?"

Oh, P.S. I tried fiddling with the declaration of DirectDrawCreate in 
ddraw.h (changing it from WINAMP to __cdecl, __stdcall, FAR PASCAL, etc, 
but it didn't help. What? I was desparate!).

(I also tried searching old posts here, now that I have mozilla set up 
to read from the news-server, but I didn't find much except something 
that indicated that someone might have to send me a ddraw.lib to fix the 
problem, since apparently implib doesn't work on 100% of DLLs or 
something? (It seemed to work fine on all the other (system) DLLs I used 
it on, and I didn't use /system... Oh well.)
Mar 05 2004
next sibling parent Jan Knepper <jan smartsoft.us> writes:
Which IMPLIB did you use?



SL wrote:
 I'm getting this error (Error 42: Symbol Undefined _DirectDrawCreate 12) 
 from the linker, despite the fact that I'm including ddraw.lib (which I 
 generated from c:\windows\system32\ddraw.dll using implib (Digital Mars 
 Import Library Manager Version 7.6B1n)) in the compile-line.
 
 Compile line:
 
 sc.exe -mn win.cpp noctis.cpp noctis-0.cpp noctis-1.cpp noctis.def 
 user32.lib kernel32.lib winmm.lib ddrawex.lib advapi32.lib shell32.lib 
 ddraw.lib gdi32.lib -oNoctis_D -dDEBUGBUILD -gp -s -Ju -L/co/ma -g -cpp 
 | more
 
 (No, all those libs aren't needed, but since this didn't want to work, I 
 added anything that looked like it might remotely help)
 
 The output after compilation is:
 -----------------
 link 
 win+noctis+noctis-0+noctis-1,Noctis_D,,user32+kernel32+winmm+ddrawex+advapi
 32+shell32+ddraw+gdi32+user32+kernel32,noctis/co/noi/co/ma;
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
 
 win.obj(win)
  Error 42: Symbol Undefined _DirectDrawCreate 12
 
 --- errorlevel 1
 
 -----------------
 
 DirectDrawCreate does indeed exist in ddraw.dll, and it looks like it's 
 in the lib as well, or so I'm guessing since it's in the text in the lib 
 when I look at it in a hex-editor, though the text does not have a _ 
 before DirectDrawCreate, or an  12 after it, anywhere 
 ("DirectDrawCreate" is in the lib file several times).
 
 These are in the includes:
 #include <initguid.h>
 #include <ddraw.h>
 #include <winuser.h>
 
 (P.S. MSDN says that I only need to import ddraw.h and include ddraw.lib 
 in the libraries to use DirectDrawCreate. 
 http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/direct
raw7/ddref_3h6f.asp 
 )
 
 I was having a problem where IID_IDirectDraw2 didn't exist before, but 
 solved it by adding #include <initguid.h> there... #define INITGUID 
 didn't work (I tried that first), but #include <initguid.h> did.
 
 Also, I had to define DDSURFACEDESC2 (A struct) myself in order to use 
 it, since it wasn't in ddraw.h either.
 
 Also, IID_IDirectDraw7 didn't (doesn't) seem to exist either, and I had 
 (have) no effective way to fix that, since I would have to know the 
 massively long number it's made from....
 
 -----
 
 I thought that the problem might have been the ddraw header file being 
 out of date, so I downloaded the DirectX SDK, and installed it, and took 
 the ddraw.h from there and threw it in the program source folder, and 
 changed the #include <ddraw.h> to #include "ddraw.h" - And, well, 
 DDSURFACEDESC2 exists now, so I commented out mine, but it still won't 
 link, still giving that error about _DirectDrawCreate 12. :/
 
 I tried implib /system, too, by the way, and didn't notice any 
 difference. Also tried running implib on a ddraw.def I got from 
 http://programming.ccp14.ac.uk/ftp-mirror/programming/mingw32/home/janjaap/mingw32/platfo
m-SDK/def/ddraw.def 
 (found via google), which didn't solve the linking problem either.
 
 (I managed to get it to link by hex-editing the .lib to say 
 _irectDrawCreate, and changing the function name in the ddraw.h and the 
 source files which use it to irectDrawCreate (no D), but of course, the 
 program won't run. :P)
 
 I suppose the question I should be asking is "How do I make DM stop 
 adding that _ before the function name and the  12 after the function 
 name, because the .dll and the .lib don't have it?"
 
 Oh, P.S. I tried fiddling with the declaration of DirectDrawCreate in 
 ddraw.h (changing it from WINAMP to __cdecl, __stdcall, FAR PASCAL, etc, 
 but it didn't help. What? I was desparate!).
 
 (I also tried searching old posts here, now that I have mozilla set up 
 to read from the news-server, but I didn't find much except something 
 that indicated that someone might have to send me a ddraw.lib to fix the 
 problem, since apparently implib doesn't work on 100% of DLLs or 
 something? (It seemed to work fine on all the other (system) DLLs I used 
 it on, and I didn't use /system... Oh well.)
-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 05 2004
prev sibling parent reply Jan Knepper <jan smartsoft.us> writes:
Also... Trying to search for direct draw, ddraw or DirectX might help...
http://search.atomz.com/search/?sp-a=sp1000ce79&sp-f=iso-8859-1&sp-q=directx



SL wrote:

 I'm getting this error (Error 42: Symbol Undefined _DirectDrawCreate 12) 
 from the linker, despite the fact that I'm including ddraw.lib (which I 
 generated from c:\windows\system32\ddraw.dll using implib (Digital Mars 
 Import Library Manager Version 7.6B1n)) in the compile-line.
 
 Compile line:
 
 sc.exe -mn win.cpp noctis.cpp noctis-0.cpp noctis-1.cpp noctis.def 
 user32.lib kernel32.lib winmm.lib ddrawex.lib advapi32.lib shell32.lib 
 ddraw.lib gdi32.lib -oNoctis_D -dDEBUGBUILD -gp -s -Ju -L/co/ma -g -cpp 
 | more
 
 (No, all those libs aren't needed, but since this didn't want to work, I 
 added anything that looked like it might remotely help)
 
 The output after compilation is:
 -----------------
 link 
 win+noctis+noctis-0+noctis-1,Noctis_D,,user32+kernel32+winmm+ddrawex+advapi
 32+shell32+ddraw+gdi32+user32+kernel32,noctis/co/noi/co/ma;
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
 
 win.obj(win)
  Error 42: Symbol Undefined _DirectDrawCreate 12
 
 --- errorlevel 1
 
 -----------------
 
 DirectDrawCreate does indeed exist in ddraw.dll, and it looks like it's 
 in the lib as well, or so I'm guessing since it's in the text in the lib 
 when I look at it in a hex-editor, though the text does not have a _ 
 before DirectDrawCreate, or an  12 after it, anywhere 
 ("DirectDrawCreate" is in the lib file several times).
 
 These are in the includes:
 #include <initguid.h>
 #include <ddraw.h>
 #include <winuser.h>
 
 (P.S. MSDN says that I only need to import ddraw.h and include ddraw.lib 
 in the libraries to use DirectDrawCreate. 
 http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/direct
raw7/ddref_3h6f.asp 
 )
 
 I was having a problem where IID_IDirectDraw2 didn't exist before, but 
 solved it by adding #include <initguid.h> there... #define INITGUID 
 didn't work (I tried that first), but #include <initguid.h> did.
 
 Also, I had to define DDSURFACEDESC2 (A struct) myself in order to use 
 it, since it wasn't in ddraw.h either.
 
 Also, IID_IDirectDraw7 didn't (doesn't) seem to exist either, and I had 
 (have) no effective way to fix that, since I would have to know the 
 massively long number it's made from....
 
 -----
 
 I thought that the problem might have been the ddraw header file being 
 out of date, so I downloaded the DirectX SDK, and installed it, and took 
 the ddraw.h from there and threw it in the program source folder, and 
 changed the #include <ddraw.h> to #include "ddraw.h" - And, well, 
 DDSURFACEDESC2 exists now, so I commented out mine, but it still won't 
 link, still giving that error about _DirectDrawCreate 12. :/
 
 I tried implib /system, too, by the way, and didn't notice any 
 difference. Also tried running implib on a ddraw.def I got from 
 http://programming.ccp14.ac.uk/ftp-mirror/programming/mingw32/home/janjaap/mingw32/platfo
m-SDK/def/ddraw.def 
 (found via google), which didn't solve the linking problem either.
 
 (I managed to get it to link by hex-editing the .lib to say 
 _irectDrawCreate, and changing the function name in the ddraw.h and the 
 source files which use it to irectDrawCreate (no D), but of course, the 
 program won't run. :P)
 
 I suppose the question I should be asking is "How do I make DM stop 
 adding that _ before the function name and the  12 after the function 
 name, because the .dll and the .lib don't have it?"
 
 Oh, P.S. I tried fiddling with the declaration of DirectDrawCreate in 
 ddraw.h (changing it from WINAMP to __cdecl, __stdcall, FAR PASCAL, etc, 
 but it didn't help. What? I was desparate!).
 
 (I also tried searching old posts here, now that I have mozilla set up 
 to read from the news-server, but I didn't find much except something 
 that indicated that someone might have to send me a ddraw.lib to fix the 
 problem, since apparently implib doesn't work on 100% of DLLs or 
 something? (It seemed to work fine on all the other (system) DLLs I used 
 it on, and I didn't use /system... Oh well.)
-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 05 2004
parent reply SL <shadowlord13 users.sourceforge.net> writes:
Jan Knepper wrote:

 Also... Trying to search for direct draw, ddraw or DirectX might help...
 http://search.atomz.com/search/?sp-a=sp1000ce79&sp-f=iso-8859-1&sp-q=directx 
Haven't heard of atomz before, but I spent about 3 hours googling and trying to figure this out. Jan Knepper wrote:
 Which IMPLIB did you use?
SL wrote:
 using implib (Digital Mars Import Library Manager Version 7.6B1n)
I also tried (after making that post) VCPP6SE's 'link /lib /convert ddraw.lib' on the VCPP6SE version of ddraw.lib, followed by 'coff2omf' (From Borland C++ 5.5, since I didn't see the DM version for download anywhere) - The resulting lib file was about 2 KB (The ones made by implib were 4 KB when I imported from the ddraw.def which I mentioned and 4.5 KB when I imported from ddraw.dll), and didn't work any better than the others (i.e. I got the same error message from the linker after I tried it).
Mar 05 2004
next sibling parent reply Jan Knepper <jan smartsoft.us> writes:
Try this and see what it does for you.
http://www.digitalmars.com/~jan/
There have been others in the past that worked with DirectX/Direct Draw 
and got it working.



SL wrote:
 Jan Knepper wrote:
 
 Also... Trying to search for direct draw, ddraw or DirectX might help...
 http://search.atomz.com/search/?sp-a=sp1000ce79&sp-f=iso-8859-1&sp-q=directx 
Haven't heard of atomz before, but I spent about 3 hours googling and trying to figure this out. Jan Knepper wrote: > Which IMPLIB did you use? SL wrote: > using implib (Digital Mars Import Library Manager Version 7.6B1n) I also tried (after making that post) VCPP6SE's 'link /lib /convert ddraw.lib' on the VCPP6SE version of ddraw.lib, followed by 'coff2omf' (From Borland C++ 5.5, since I didn't see the DM version for download anywhere) - The resulting lib file was about 2 KB (The ones made by implib were 4 KB when I imported from the ddraw.def which I mentioned and 4.5 KB when I imported from ddraw.dll), and didn't work any better than the others (i.e. I got the same error message from the linker after I tried it).
-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 06 2004
parent reply "Phill" <phill pacific.net.au> writes:
Yes I did a fair while ago, in fact I believe I
had the same problem, and when I posted on
this group my problem was solved, by some
good soul who sent me two LIB's, that he created.

I beleive Nic Tiger was his name.
I dont know that I have permission to pass these
on though.

what can I do?

Phill.



"Jan Knepper" <jan smartsoft.us> wrote in message
news:c2cuf7$fh0$1 digitaldaemon.com...
 Try this and see what it does for you.
 http://www.digitalmars.com/~jan/
 There have been others in the past that worked with DirectX/Direct Draw
 and got it working.



 SL wrote:
 Jan Knepper wrote:

 Also... Trying to search for direct draw, ddraw or DirectX might
help...

http://search.atomz.com/search/?sp-a=sp1000ce79&sp-f=iso-8859-1&sp-q=directx
 Haven't heard of atomz before, but I spent about 3 hours googling and
 trying to figure this out.

 Jan Knepper wrote:

  > Which IMPLIB did you use?

 SL wrote:

  > using implib (Digital Mars Import Library Manager Version 7.6B1n)

 I also tried (after making that post) VCPP6SE's 'link /lib /convert
 ddraw.lib' on the VCPP6SE version of ddraw.lib, followed by 'coff2omf'
 (From Borland C++ 5.5, since I didn't see the DM version for download
 anywhere) - The resulting lib file was about 2 KB (The ones made by
 implib were 4 KB when I imported from the ddraw.def which I mentioned
 and 4.5 KB when I imported from ddraw.dll), and didn't work any better
 than the others (i.e. I got the same error message from the linker after
 I tried it).
-- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 08 2004
parent Jan Knepper <jan smartsoft.us> writes:
Phill wrote:

 Yes I did a fair while ago, in fact I believe I
 had the same problem, and when I posted on
 this group my problem was solved, by some
 good soul who sent me two LIB's, that he created.
 
 I beleive Nic Tiger was his name.
 I dont know that I have permission to pass these
 on though.
 
 what can I do?
Ask Nic Tiger... ;-) -- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Mar 08 2004
prev sibling parent Phil Thompson <phil electricvisions.com> writes:
SL, mail me as I may be able to assist.


Regards,
Phil


SL wrote:

 Jan Knepper wrote:
 
 Also... Trying to search for direct draw, ddraw or DirectX might help...
 http://search.atomz.com/search/?sp-a=sp1000ce79&sp-f=iso-8859-1&sp-q=directx 
Haven't heard of atomz before, but I spent about 3 hours googling and trying to figure this out. Jan Knepper wrote: > Which IMPLIB did you use? SL wrote: > using implib (Digital Mars Import Library Manager Version 7.6B1n) I also tried (after making that post) VCPP6SE's 'link /lib /convert ddraw.lib' on the VCPP6SE version of ddraw.lib, followed by 'coff2omf' (From Borland C++ 5.5, since I didn't see the DM version for download anywhere) - The resulting lib file was about 2 KB (The ones made by implib were 4 KB when I imported from the ddraw.def which I mentioned and 4.5 KB when I imported from ddraw.dll), and didn't work any better than the others (i.e. I got the same error message from the linker after I tried it).
Mar 08 2004