Solved

fatal error LNK1120: 1 unresolved externals

Posted on 2002-05-28
4
6,289 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
  • 2
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
fl0yd earned 50 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sameEnds challenge 3 187
countEvens challenge 2 115
Line meaning 9 91
Use of condition with 'serial' in ansible 2 88
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

733 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