Sign in to follow this  
fallhunter

VC++ link error, no detail information?

Recommended Posts

fallhunter    144
I am using Microsoft Visual Studio 2003, when I build the project, in the output window, just look like this: xx.obj : error LNK2019: Debug/xx.exe : fatal error LNK1120: 1 this happen after I reinstall my operating system and visual studio, before that it was look like: xx.obj : error LNK2019: unresolved external symbol 'symbol' referenced in function 'function' so, there is no detail information now!!! Please tell me how to fix this? I mean how to setup the IDE to show me the detail error information, thank you

Share this post


Link to post
Share on other sites
Drew_Benton    1861
LNK1120 gives you the information on how many linker errors you have in the project, which in this case, is 1.

LNK2019 usually means that you are using a function from another library that you did not link in, you are using a class member function that was not implemented, or you prototyped a function or extern'd a variable and did not define/implement it.

If this only happened after reinstalling Visual Studio, I would guess that you are using some 3rd party library that you had VS's paths set to look in its /lib folder. Now that you have a clean install, it is not looking there anymore.

Can you give us details on your project? Specifically, what external libraries are you using? Did the project 'completely' work before you reinstalled everything?

Share this post


Link to post
Share on other sites
fallhunter    144
thank you

just now I built a standard win32 application under the wizard in visual studio,
and made a samll change, adding a header and a little code in main:
----------------------------------------
#include "stdafx.h"
#include "xx.h"
#define MAX_LOADSTRING 100

#include <d3d9.h> // added

......

int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{

....
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_XX);

// added
IDirect3D9 * m_pD3d;
m_pD3d = Direct3DCreate9( D3D_SDK_VERSION );
// end added

// 主消息循环:
while (GetMessage(&msg, NULL, 0, 0))
{
.....
}
---------------------------------------------

the left was not changed.

I installed directx9 2005 april and integrated it into visual studio, so the include path and lib path is ok.
I added "d3d9.lib" to link options and built. It was ok.

and if I remove the "d3d9.lib" from the link options, the linker will give the message:

xx.obj : error LNK2019:
Debug/xx.exe : fatal error LNK1120: 1

I know how to fix the link error. But I don't know why it could not give the detailed information as before. When I build a large project, there would be many link errors that very hard to trace by such a little information.

Share this post


Link to post
Share on other sites
Drew_Benton    1861
Quote:
Original post by fallhunter
I know how to fix the link error. But I don't know why it could not give the detailed information as before. When I build a large project, there would be many link errors that very hard to trace by such a little information.


No problem! I'm not really sure why that information was not generated, it *should* be. I'm not sure what happened in your case, I've never had something like this happened before with 2003. Hopefully you won't get any more of those errors though, especially if you have a larger project [wink]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this