0
// mainfrm.h
enum
{		
    logAll = 0xff
};
void Log(int nIdx, LPCTSTR lpText, int nType = logAll, LPCTSTR lpDeviceName = NULL);

//SesLog.h
int m_nDeviceID;
CString m_strDeviceName;

// SesLog.cpp
#include "Mainfrm.h"
#include "SesLog.h"
void CSessionLog::Log(LPCSTR lpText)
{
	if(m_pParent)
		m_pParent->Log(m_nDeviceID, lpText, logAll, m_strDeviceName);

error LNK2019: unresolved external symbol "public: void __thiscall CMainFrame::Log(int,char const *,int,char const *)" (?Log@CMainFrame@@QAEXHPBDH0@Z) referenced in function "public: void __thiscall CSessionLog::Log(char const *)" (?Log@CSessionLog@@QAEXPBD@Z) \SesLog.obj

VS 2010
Help would be appreciated.

Thanks

Edited by chintan_1671: n/a

3
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by Narue
Featured Replies
  • 1
    Narue 5,707   5 Years Ago

    The overload of m_pParent->Log() you're calling isn't defined anywhere that the compiler can see. To start, make sure it has a definition for the type and number of arguments you're passing. Read More

1

The overload of m_pParent->Log() you're calling isn't defined anywhere that the compiler can see. To start, make sure it has a definition for the type and number of arguments you're passing.

0

Ok i added line
void Log(int, LPCTSTR, int, LPCTSTR);
in SesLog.cpp
Still getting that error.

Thanks

Edited by chintan_1671: n/a

0

Clearly you don't understand the difference between a declaration and a definition. What you added was a declaration, but what's missing is a definition. Have you written a body for that overload of Log anywhere?

0

Oh yes ..
There is no definition for that.

I converted old C++ code to .Net C++.

Thanks

0

Ok i figured out that the header file MainFrm.h is coming from ..\rhub\mainfrm.h.
& in that rhub directory too it has Mainfrm.cpp which has Log function.

Now what do i need to do to call the function from that .cpp?
Should i add that cpp in my project ?

Advice
Thanks

0

Unless there's a library for you to link with, adding the .cpp file to your project should be sufficient.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.