okay, you want details ill give you details. i use windows xp, VC++ 98, and i compiled a .lib static link library with a function of mine in it. Then i copied the .lib to the lib folder in the Visual Studio folder.
In another one of my projects i added the library to the linking tab of the project settings, then included in all my source files a header file that declared the function.
When i try to compile the project, it gives me a linker error.
Code:
unresolved external symbol _DoStuff
DoStuff is the name of the function.
here is the library source.
Code:
//lib.cpp
#include "stdafx.h"
void DoStuff(HWND hwnd)
{
MessageBox(hwnd,"Call from lib.lib","Warning",MB_OK);
}
Code:
//stdafx.cpp
#include "stdafx.h"
Code:
//stdafx.h
#if !defined(AFX_STDAFX_H__00001EB2_D2F6_484A_8FA3_0A60F71DD686__INCLUDED_)
#define AFX_STDAFX_H__00001EB2_D2F6_484A_8FA3_0A60F71DD686__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
// TODO: reference additional headers your program requires here
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__00001EB2_D2F6_484A_8FA3_0A60F71DD686__INCLUDED_)
is there anything wrong with this code?