Skip to main content
gamedev.net
🔒 Locked

error LNK2001

Started by kudi Jan 19, 2002 at 10:19 AM 3 replies 2.1k views
Original Post
kudi
kudi
Hi, have some problems about this error:
        
Compiling...
flight.cpp
Linking...
flight.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7
flight.obj : error LNK2001: unresolved external symbol _IID_IDirect3D7
flight.obj : error LNK2001: unresolved external symbol _IID_IDirect3DRGBDevice
flight.obj : error LNK2001: unresolved external symbol _IID_IDirect3DHALDevice
flight.obj : error LNK2001: unresolved external symbol _IID_IDirect3DMMXDevice
flight.obj : error LNK2001: unresolved external symbol _IID_IDirect3DTnLHalDevice
Debug/flight.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.
flight.exe - 7 error(s), 0 warning(s)
   
I get this error with this code:
  

#ifndef _f_graph_cpp_
#define _f_graph_cpp_



#define  D3D_OVERLOADS

#include <d3dtypes.h>

#include "d3dmath.h"

#include "d3dutil.h"

#include "f_graph.h"

#include "f_driver.cpp"



BOOL InitDirectDraw (HWND hWnd)
{
	DDSURFACEDESC2	DDS..................
}
        
But when I include "f_driver.cpp" at first, it functions. What is my mistake ? Edited by - kudi on January 19, 2002 11:22:57 AM
The problem of Object Oriented Programming:Everybody tells you how to use his classes, but nobody how not to do it !
BitBlt
BitBlt
You need to add the location of the directX7 headers and .libs to your compilers list so it knows where to look for them. Make sure you put them at the top of the list, because VC++ comes with an old version of DirectX headers and libraries, and it might try to use those first if they''re above the new ones. Also add ddraw.lib and any others necessary to your project libraries. I can''t remember exactly where these options are, but look around in the menus and you''ll find them.
S1CA
S1CA
You need to link with dxguid.lib

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
BitBlt
BitBlt
I didn''t look at your code close before. Looks like you''ll also need d3dim.lib and d3d7.lib, I''m pretty sure that''s what they''re called
Oluseyi
Oluseyi
See: S1CA.

Explanation: to obtain a COM object, you need to pass in a Globally Unique Identifier (GUID). These are 128-bit numbers guaranteed to be unique to the particular interface you''re interested in. The import libraries and wrapper functions in DirectX already do this for you, but they use aliases to the actual values. You can either a) add dxguid.lib to your project; or b) ''#define INITGUID'' before including any DirectX headers to resolve this.

Happy Hacking!

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.