Solved

error LNK2001: unresolved external symbol _GUID_SysKeyboard

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
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 learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

825 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