?
Solved

error LNK2001: unresolved external symbol _GUID_SysKeyboard

Posted on 2004-10-15
5
Medium Priority
?
2,483 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 225 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 150 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

764 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