CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    May 2000
    Location
    England
    Posts
    574

    What do these 2 Errors mean ?

    Hi
    What does this Error message mean ?

    FSInsertLink.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall RfcCommand::~RfcCommand(void)" (??1RfcCommand@@UAE@XZ)
    FSInsertLink.obj : error LNK2001: unresolved external symbol "public: __thiscall RfcCommand::RfcCommand(void)" (??0RfcCommand@@QAE@XZ)

    Thanks

    P

  2. #2
    Join Date
    May 2000
    Location
    England
    Posts
    574
    The problem i am getting
    is that im including a file which declares a class RfcCommand
    and now im trying to instantiate an object of that class

    ie - RfcCommand cmd;

    but im getting the Errors above ?

    any help would be appreciated!

  3. #3
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    LNK2001...

  4. #4
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    In other words...you need to provide the implementation of the class as well...

  5. #5
    Join Date
    May 2000
    Location
    England
    Posts
    574
    So i can't just #include "TheFile.h"
    and then create an object of the class defined .

    i have to #include "TheFile.h"

    what do u mean by an implementation ?
    surely i can use the one in the .h file ?

  6. #6
    Join Date
    May 2000
    Location
    England
    Posts
    574
    Hi
    Ive now addedd the MyFile.h and MyFile.cpp which include the class required
    which gets rid of the Error message

    Thanks

    But now im getting this Error message
    fatal error C1010: unexpected end of file while looking for precompiled header directive

    in this file

    Code:
    // FSInsertLink.cpp : Implementation of CFSInsertLink
    #include "stdafx.h"
    #include "AOSAPInsertLink.h"
    #include "FSInsertLink.h"
    
    #include "FSInsertLinkDlg.h"
    
    #include "sap/RfcCommand.h"
    #include "sap/RFCParameter.h"
    
    /////////////////////////////////////////////////////////////////////////////
    // CFSInsertLink
    
    
    CFSInsertLink::CFSInsertLink()
    {
    	m_enableTracing = false;
    	m_traceDirectory = "";
    }
    
    //IFSAddon
    void CFSInsertLink::onGetInfo(AFPString& strName, AFPString& strGroup, AFPString& strDescription, HICON *phIcon)
    {
    	strName = "SAP Insert Link";
    	strGroup = PACKAGE_SAPRDI;
    	strDescription = "Allows an external reference to be added to a SAP business document";
    	*phIcon = ::LoadIcon(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_ICON_FSSAPINSERTLINK));
    }
    
    
    BOOL CFSInsertLink::onCreate()
    {
    	if (!m_sapObjectId.create(getSite(), "Text", "SAP Object Identifier"))
    		return FALSE;
    	if (!m_externalDocumentId.create(getSite(), "Text", "External Document Identifier"))
    		return FALSE;
    	if (!m_contentRepositoryIdentifier.create(getSite(), "Text", "Content Respository Identifier"))
    		return FALSE;
    	if (!m_objectType.create(getSite(), "Text", "Object Type"))
    		return FALSE;
    	if (!m_documentType.create(getSite(), "Text", "Document Type"))
    		return FALSE;
    	if (!m_documentClass.create(getSite(), "Text", "Document Class"))
    		return FALSE;
    	if (!m_clientNumber.create(getSite(), "Text", "Client Number"))
    		return FALSE;
    	if (!m_userName.create(getSite(), "Text", "User Name"))
    		return FALSE;
    	if (!m_userName.create(getSite(), "Text", "User Password"))
    		return FALSE;
    	if (!m_userHostName.create(getSite(), "Text", "SAP Host Name"))
    		return FALSE;
    	if (!m_userSystemNumber.create(getSite(), "Text", "User Client Number"))
    		return FALSE;
    	if (!m_userSystemNumber.create(getSite(), "Text", "System Number"))
    		return FALSE;
    
    	return TRUE;
    }
    
    
    //IFSAddonDocumentationHTML
    STDMETHODIMP CFSInsertLink::GetDocumentationPath(LPOLESTR *ppStrPath)
    {
    	//TODO:
    	*ppStrPath = AFPAllocOLEString(L"jdeoneworld\\fsref\\osa\\osa.htm");
    	return S_OK;
    }
    
    STDMETHODIMP CFSInsertLink::GetPackageOverview(LPOLESTR *ppStrTitle, LPOLESTR *ppStrPath)
    { 
    	//TODO:
    	*ppStrPath = AFPAllocOLEString(L"saprdi\\default.htm");
    	*ppStrTitle = AFPAllocOLEString(L"SAP Support");
    	
    	return S_OK;
    }
    
    //IFSProperties
    STDMETHODIMP CFSInsertLink::OpenNotify(IFSNotify *pNotify, IFSNotifySite **ppSite, DWORD *pdwCookie)
    {
    	AFPConnector<IFSProperties> p;
    
    	return p->OpenNotify(pNotify, ppSite, pdwCookie);
    
    }
    
    STDMETHODIMP CFSInsertLink::BeginWalk(IFSWalkProperties **ppEnum)
    {
    	AFPConnector<IFSProperties> p;
    
    	return p->BeginWalk(ppEnum);
    }
    
    STDMETHODIMP CFSInsertLink::GetItem(LPCOLESTR pStrName, IFSConnector **ppCon)
    {
    	AFPConnector<IFSProperties> p;
    
    	return p->GetItem(pStrName, ppCon);
    }
    
    STDMETHODIMP CFSInsertLink::GetType(LPCOLESTR pStrName, const IID **piid, LPOLESTR *pReserved)
    {
    	AFPConnector<IFSProperties> p;
    	return p->GetType(pStrName, piid, pReserved);
    }
    
    
    //IFSPersistRecord
    STDMETHODIMP CFSInsertLink::Transfer(IFSRecord *pRec)
    {
    	m_sapObjectId.transfer(L"SAPObjectIdentifier", pRec, getSite());
    	m_externalDocumentId.transfer(L"ExternalDocumentIdentifier", pRec, getSite());
    	m_contentRepositoryIdentifier.transfer(L"ContentRespositoryIdentifier", pRec, getSite());
    	m_objectType.transfer(L"ObjectType", pRec, getSite());
    	m_documentType.transfer(L"DocumentType", pRec, getSite());
    	m_documentClass.transfer(L"DocumentClass", pRec, getSite());
    	m_clientNumber.transfer(L"ClientNumber", pRec, getSite());
    	m_userName.transfer(L"UserName", pRec, getSite());
    	m_userName.transfer(L"UserPassword", pRec, getSite());
    	m_userHostName.transfer(L"SAPHostName", pRec, getSite());
    	m_userSystemNumber.transfer(L"UserClientNumber", pRec, getSite());
    	m_userSystemNumber.transfer(L"SystemNumber", pRec, getSite());
    
    	//
    	BOOL				boolValue;
    	AFPPersistUString	stringValue;
    
    	BOOL isStoring;
    	pRec->IsStoring(&isStoring);
    	if (isStoring)
    	{
    		boolValue	= m_enableTracing;
    		stringValue.str = AFPNativeToUnicode(m_traceDirectory);
    
    		pRec->TransferBOOL(L"EnableTracing", &boolValue);
    		pRec->TransferString(L"TraceDirectory", &stringValue);
    	}
    	else
    	{
    		pRec->TransferBOOL(L"EnableTracing", &boolValue);
    		pRec->TransferString(L"TraceDirectory", &stringValue);
    
    		m_enableTracing = (boolValue == TRUE);
    		m_traceDirectory = AFPUnicodeToNative(stringValue.str);
    	}
    
    	return S_OK;
    }
    
    //IFSEditModal
    STDMETHODIMP CFSInsertLink::DoModal(HWND hWndParent)
    {
    	FSInsertLinkDlg dlg(m_enableTracing,m_traceDirectory);
    	if (dlg.DoModal() != IDOK)
    		return S_FALSE;
    
    	dlg.getSettings(m_enableTracing,m_traceDirectory);
    	return S_OK;
    }
    
    
    // IFSAction
    STDMETHODIMP CFSInsertLink::Do()
    {
    	// The function that should be used to do all the work //
    
    	RfcCommand command;
    
    //	RfcCommand::ParamStatus paramStatus;
    
    	const std::string hostName("sapdev");
    	const std::string systemName("00");
    	const std::string client("900");
    	const std::string userId("andyc");
    	const std::string userPassword("formpass");
    
    //	paramStatus = command.setConnectionInfo(hostName,systemName,client,userId,userPassword);
    
    	return S_OK;
    }
    can you explain this one ?

    Thanks Andreas

    P

  7. #7
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Originally posted by posty68
    So i can't just #include "TheFile.h"
    and then create an object of the class defined .

    i have to #include "TheFile.h"

    what do u mean by an implementation ?
    surely i can use the one in the .h file ?
    Well...yes and no...if the implementation of member functions are being made within the header file, then the header file would be sufficient...
    Code:
    // header
    class CFoo
    {
      void Func();
    };
    With this header you declare a class named 'CFoo' which contains a function named 'Func()'. If you want to use the function in your code, the compiler needs to know where to find the implementation of this function...in other words, the .cpp file
    Code:
    // .ccp
    void CFoo::Func()
    {
      // Do something
    }

  8. #8
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Originally posted by posty68
    But now im getting this Error message
    fatal error C1010: unexpected end of file while looking for precompiled header directive
    I actually do not have much time at the moment...thus, I could not look at your code, however the following might already help...

  9. #9
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354
    Your project settings option might have specified that the file ( in which you are getting this precompiled header ) is to use a precompiled header ( in most cases it would be stdafx.h , or in general it is a file you specify that with which to create precompiled header ).

    So, if the compiler sees that there is no #include <stadfx.h> ( for example ), it will complain.

    Merely adding the include will resolve the problem.

    More info:
    1. Go to project settings, select the C/C++ tab, select category as precompil... headers.
    2. Now, when the project is selected, you might possibly see Use precom... option selected.
    3. Now, expand the project tree on the LHS and select stdafx.cpp if you have one. In this case , you will probably see that the option selected is Create precompiled header using stdafx.h

    Precompiled headers are used to speed up compilation. Normally, the commonly used includes are included in the stdafx.h. So, compiler will create a precompiled header file ( .pch ) as a timesaving step.

  10. #10
    Join Date
    May 2000
    Location
    England
    Posts
    574
    Yes i found that it was the stdafx include problem
    which i have solved by changing the settings

    thanks one and all
    now to look at the other issues ....


    ohhh how debugging never seems to stop

    P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured