Solved

error LNK2001: unresolved external symbol _GUID_SysKeyboard

Posted on 2004-10-15
5
2,388 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now