Solved

error LNK2001: unresolved external symbol _GUID_SysKeyboard

Posted on 2004-10-15
5
2,436 Views
Last Modified: 2007-11-27
I've been working on a large body of code over a period  of time and up to recently it has compiled and linked OK.  Then I tried to incorporate the "playwnd" example from the MSSDK DirectX8 and started getting linking errors.  I've gone over the Project Settings many times, but still have not come up with a solution.  I feel like I'm probably missing something very simple.  I'm using Visual C++ 6.0 with the Service Pack 2 installed.
Thanks, Norv

Build notes:
Compiling...
WF_engine.cpp
Linking...
WF_engine.obj : error LNK2001: unresolved external symbol _GUID_SysKeyboard
WF_engine.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7
WF_engine.obj : error LNK2001: unresolved external symbol _GUID_SysMouse
WF_engine.obj : error LNK2001: unresolved external symbol _IID_IDirectInput8A
WF_engine.obj : error LNK2001: unresolved external symbol _DirectSoundCreate@12
WF_engine.obj : error LNK2001: unresolved external symbol __imp__mmioAscend@12
WF_engine.obj : error LNK2001: unresolved external symbol __imp__mmioRead@12
WF_engine.obj : error LNK2001: unresolved external symbol __imp__mmioClose@8
WF_engine.obj : error LNK2001: unresolved external symbol __imp__mmioDescend@16
WF_engine.obj : error LNK2001: unresolved external symbol __imp__mmioOpenA@12
dinput.lib(dilib1.obj) : error LNK2001: unresolved external symbol _GUID_ZAxis
dinput.lib(dilib1.obj) : error LNK2001: unresolved external symbol _GUID_YAxis
dinput.lib(dilib1.obj) : error LNK2001: unresolved external symbol _GUID_XAxis
dinput.lib(dilib2.obj) : error LNK2001: unresolved external symbol _GUID_Key
Debug/Wildfire.exe : fatal error LNK1120: 14 unresolved externals
Error executing link.exe.

xxx.exe - 15 error(s), 0 warning(s)
0
Comment
Question by:NorvBrooks
  • 2
  • 2
5 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 75 total points
ID: 12321402
You need to add

#ifndef INITGUID
#define INITGUID
#endif
#include <initguid.h>
#include <objbase.h>

to *one* of your .cpp filed in order to pull in the GUIDs. Additionally, you need to link with dsound.lib and Winmm.lib
0
 

Accepted Solution

by:
spines11 earned 50 total points
ID: 12321579
In your project settings, set your project to link with the dxguid.lib library.
0
 

Author Comment

by:NorvBrooks
ID: 12328786
Both jkr & spines11 answers appear to help.  For the record the order of the #include headers matter.  The <objbase.h> needs to come before <initguid.h>.  Also, I needed to remove from my Link listing in the Project Settings "Strmiids.lib" which you would not have had a way of knowing about.  I still get the following two linking errors:

Linking...
playwnd.obj : error LNK2001: unresolved external symbol _IID_IMediaSeeking
playwnd.obj : error LNK2001: unresolved external symbol _IID_IGraphBuilder
Debug/Wildfire.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

xxx.exe - 3 error(s), 0 warning(s)

Thanks,
Norv
0
 
LVL 86

Expert Comment

by:jkr
ID: 12360802
Have you tried adding the other libs, e.g. strmiids.lib?
0
 

Author Comment

by:NorvBrooks
ID: 12366087
Thanks jkr for your additional comments.  I did get the application to link OK.  I had to make sure that "quartz.lib strmbase.lib" were listed first in the Project Settings - Link tab.  Also, I had to go into Tools > Options > Directories and add C:\mssdk\samples\Multimedia\DirectShow\BaseClasses.

Once again, Thanks
Norv
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question