Solved

fatal error LNK1120: 1 unresolved externals

Posted on 2002-05-28
4
6,254 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

14 Experts available now in Live!

Get 1:1 Help Now