Advertisement

Visual C++ 6.0 )) unresolved external symbol _IID_IDirectDraw4

Started by February 07, 2000 06:07 AM
4 comments, last by Scorpion 24 years, 7 months ago
I have included the "ddraw.lib" & "ddraw.h" files, and opend up a sample file from a cd-rom (.cpp). It''s a "win32 app" project. I''ve added the include directory from the DirectX SDK above all other include directory''s, but it doesn''t seem to work, cause whenever it try''s to link, it generates this error: Test1.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw4 Debug/Test 1.exe : fatal error LNK1120: 1 unresolved externals What the hell is wrong? What did i forgot to do? Who can help me? Grtx, Scorp --
icq# 10251921
thescorpion@most-wanted.com
Are you sure you have told the compiler to link with ddraw.lib. You must also tell the compiler where the lib files are. (The ddraw.lib shouldn''t be _included_ in the source, but I''m sure you didn''t do that. =)

When I compile DX programs I link with dxguid.lib, as well as the others. I''m not sure exactly what this library does but maybe it will resolve your problem.



Advertisement
man this is THE most asked question. It''s either what Spellbound said, or you need to set your search path for your libraries before the other search paths. (setting them at all would be handy)
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
I have included them in the "workspace" or "project" or what ever it supposed to be called. ("Add files to project" was the option if i remember it correctly).

And no, i didn''t do a "#include " =)
Also i set the lib. paths above all others (as u suggested also), but it doesn''t work..

That of dxguid.lib what spellbound said could be the answer... i guess when i tryd to compile this last night (without knowing i had to go to school at 9:15am, and still was at the computer at 5:00 am) =) i included all libs i could find in the include directory.. It worked, but didn''t know what lib file was the answer.. thnx!

icq# 10251921
thescorpion@most-wanted.com
This problem has nothing to do with search paths. Whenever you use an IID_ISomething, you're actually using a Globally Unique Identifier (GUID). So you need to do one of 2 things (but not both!)

1) Link to dxguid.lib

OR

2) #define INITGUID in 1 (only 1)source file BEFORE any other defines or includes.

There is no dxguid.h, only the lib. Remember, do 1 but not both. The program won't compile otherwise.

As an afterthought:
GUIDs are part of the COM technology. Every COM object is assigned a number that is mathmatically guaranteed to be unique (and never duplicated). All of the DX objects are implemented as COM interfaces and are therefore assigned GUIDs (IID = Interface ID = GUID).


Edited by - Aldacron on 2/7/00 8:54:43 AM
Cool, that''s what i needed for a reply! thnx!

And indeed dxguid.lib solved the problem.. =) i''ll try the other answer later on..

thnx once again!

icq# 10251921
thescorpion@most-wanted.com

This topic is closed to new replies.

Advertisement