Jump to content
  • Advertisement
Sign in to follow this  
Rakkar2

Importing static lib that uses COM

This topic is 5473 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm importing the static lib for LZMA into another project (this is all related to compressing resources for a game). The problem is the author's code uses COM, which I don't know. This is the error I get when I try to import the code in the static lib:
Linking...
LZMAWrapperDebug.lib(LZMAEncoder.obj) : error LNK2001: unresolved external symbol _IID_IMatchFinderSetCallback
LZMAWrapperDebug.lib(LZMAEncoder.obj) : error LNK2001: unresolved external symbol _IID_ICompressWriteCoderProperties
LZMAWrapperDebug.lib(LZMAEncoder.obj) : error LNK2001: unresolved external symbol _IID_ICompressSetCoderProperties
LZMAWrapperDebug.lib(LZMAEncoder.obj) : error LNK2001: unresolved external symbol _IID_ICompressSetOutStream
This is the line of code that I added, which is the function that I call from the second project:
int Zip(char *inputPath, char *outputPath, int properties)
{
	NCompress::NLZMA::CEncoder *encoderSpec = new NCompress::NLZMA::CEncoder;
	CMyComPtr<ICompressCoder> encoder = encoderSpec;

	return 0;
}
This is the place where he defines those functions:
 STDMETHOD(SetCoderProperties)(const PROPID *propIDs, 
      const PROPVARIANT *properties, UInt32 numProperties);
etc. This is the place where he implements those functions:
STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs, 
    const PROPVARIANT *properties, UInt32 numProperties)
etc. This is some kind of GUID thing:
// {23170F69-40C1-278A-0000-000200200000}
DEFINE_GUID(IID_ICompressSetCoderProperties, 
0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x02, 0x00, 0x20, 0x00, 0x00);
MIDL_INTERFACE("23170F69-40C1-278A-0000-000200200000")
ICompressSetCoderProperties: public IUnknown
{
  STDMETHOD(SetCoderProperties)(const PROPID *propIDs, 
      const PROPVARIANT *properties, UInt32 numProperties) PURE;
};
What do I need to do to get it to link properly?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!