VC++ 6.0 error LNK2001: unresolved external symbol

error LNK2001: unresolved external symbol _IID_IObjectConstructString

Page 1 of 1

2 Replies - 7728 Views - Last Post: 15 February 2008 - 08:03 AM Rate Topic: -----

#1 chaucer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-January 08

VC++ 6.0 error LNK2001: unresolved external symbol

Post icon  Posted 08 January 2008 - 02:05 PM

I am getting the following error when compiling a vendor supplied project:
CommsWorker.obj : error LNK2001: unresolved external symbol _IID_IObjectConstructString.

The vendor is no longer supporting this application, and we are trying to compile for an upgrade.

The problem is occurring in code that is using an interface. I'm hoping this is just a project set-up issue. Any help will be greatly appreciated!
//IObjectConstruct implementation
STDMETHODIMP CCommsWorker::Construct(IDispatch * pCtorObj)
{
   //	construct_string method is called by COM+
   //	if so configured in Component Services.
   //	Component Properties, Activation tab, Object 
   //   constructor settings.
   HRESULT hr;
   CComPtr<IObjectConstructString> object_construct_string=NULL;
   BSTR construct_string=NULL;

   USES_CONVERSION;
   
   m_strConfigFileName = "";
   if (pCtorObj==NULL) return S_OK;

   try
   {
	  // first get the IObjectConstructString interface from the
	  // constructor object
	  // THE CODE BELOW CAUSES THE COMPILE ERROR
	  hr = pCtorObj->QueryInterface(IID_IObjectConstructString, 
		 reinterpret_cast<void**>(&object_construct_string) );
	  if (!SUCCEEDED(hr) || object_construct_string==NULL) return S_OK;
		 
	  // Get the constructor string
	  hr = object_construct_string->get_ConstructString(&construct_string);	  
	  if (!SUCCEEDED(hr)) return S_OK;

	  // copy the string -- memory allocated by OLE2CA will
	  // be automatically released when the method ends.
	  m_strConfigFileName = (construct_string == NULL ? "" : OLE2CA(construct_string));
	  
	  // free the string we got from IObjectConstructString
	  SysFreeString(construct_string);
   }
   catch(...)
   {
	  // ignore any exceptions...
   }
   return S_OK;
}



Is This A Good Question/Topic? 0
  • +

Replies To: VC++ 6.0 error LNK2001: unresolved external symbol

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4364
  • View blog
  • Posts: 12,182
  • Joined: 18-April 07

Re: VC++ 6.0 error LNK2001: unresolved external symbol

Posted 08 January 2008 - 04:01 PM

Well the error means that it simply can't find, and thus doesn't know what IID_IObjectConstructString even is, where you are using it. Look for the definition of this object and see if it is in a scope where this part of the program knows what it is or not. If it can't see what this object means, then it is going to throw this error. Also double check spelling and case to make sure it exactly matches its declaration.

:)

This post has been edited by Martyr2: 08 January 2008 - 04:02 PM

Was This Post Helpful? 0
  • +
  • -

#3 chaucer  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-January 08

Re: VC++ 6.0 error LNK2001: unresolved external symbol

Posted 15 February 2008 - 08:03 AM

I was able to compile by downloading and installing Microsoft Platform SDK. Becuase I'm using VC++ 6.0, I could not use the most current version. I had to go back to the February 2003 Update (version 5.2.3790.0).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1