?
Solved

fatal error LNK1120: 1 unresolved externals

Posted on 2002-05-28
4
Medium Priority
?
6,313 Views
Last Modified: 2013-11-20
This should be an easy question.

I'm using C++6.0 and DirectX 7.0 with the SDK.

I'm trying to do this:
hRet = DirectDrawCreate(NULL, &pDD, NULL);

and then compile.
I get the following error:
--------------------Configuration: Project - Win32 Debug--------------------
Linking...
ProjectView.obj : error LNK2001: unresolved external symbol _DirectDrawCreate@12
Debug/Project.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Project.exe - 2 error(s), 0 warning(s)

What do I do about this? I have found a question with a similer problem and it said that I press alt-f7 and enter some information. I do not however, have this information.

Thanks for the help!
0
Comment
Question by:xersoft
[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
4 Comments
 
LVL 8

Accepted Solution

by:
fl0yd earned 150 total points
ID: 7040513
Project->Settings->Link: ddraw.lib guids.lib
0
 
LVL 5

Author Comment

by:xersoft
ID: 7040569
That did change the error message somewhat. Heres what I got now.

--------------------Configuration: Project - Win32 Debug--------------------
Compiling...
ProjectView.cpp
Linking...
ProjectView.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw4
Debug/Project.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...

Project.exe - 2 error(s), 0 warning(s)

anyideas on this one? And what exactly am I doing in the project settings? Is there away to just make C++ find the stuff it needs when it needs it so I don't have to do this for each project?
0
 
LVL 5

Author Comment

by:xersoft
ID: 7040575
hmmmm looks like the bad line was
hRet = pDD->QueryInterface(IID_IDirectDraw4, (LPVOID *) & lpDD);

and I don't know what it does, I commented it out and it seems to compile fine. I guess you did answer the question that I asked, Thanks for the help.
0
 
LVL 8

Expert Comment

by:fl0yd
ID: 7040675
The line of code
hRet = pDD->QueryInterface(IID_IDirectDraw4, (LPVOID *) & lpDD);
asks your currently retrieved direct draw interface pointer (pDD) whether it also exposes an IDirectDraw4-interface. If so, it is created and a pointer to it is stored in lpDD. In that case hRet is greater than 0, otherwise it is below 0 - you can use
if( SUCCEEDED( hRet ) ) ... or
if( FAILED( hRet ) ) ...
to check for success/failure. I'm not at my machine right now, so I don't have access to DX7-documentation. As far as I know the refiid for direct draw in dx7 is IID_IDirectDraw7 so you shouldn't try to query for v4, unless there is a reason to do so.
The reason for the linker error is that my last post was partially wrong: replace 'guids.lib' by 'dxguid.lib' and you should be fine. Sorry about that...
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

801 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