Help using 7z.dll in a Qt project

estux
2013-07-09
2014-02-12
  • estux
    estux
    2013-07-09

    I am trying to use 7z.dll in a Qt project, I am using VisualStudio 2010 for compiling the project. I having some linker errors, fe:

    or LNK2019: unresolved external symbol "public: thiscall NWindows::NFile::NIO::CFileBase::~CFileBase(void)" (??1CFileBase@NIO@NFile@NWindows@@QAE@XZ) referenced in function "public: thiscall NWindows::NFile::NIO::CInFile::~CInFile(void)" (??1CInFile@NIO@NFile@NWindows@@QAE@XZ)

    Do I need to compile source files from 7z src? I was thinking that the only thing needed was load 7z.dll and use some header files. But it seems that something is missing in my source code.

    EDIT: After reading more carefully the Client7z example(I can compile it with vs2010) , I have added the missing files and defines to my project and I have updated my Include paths. But now I am stuck in this linker error:

    FileStreams.obj : error LNK2001: unresolved external symbol _IID_IStreamGetSize
    FileStreams.obj : error LNK2001: unresolved external symbol _IID_IInStream

    Any idea?

    EDIT2: I was missing a couple of includes. By now, all I need is in the Client7z example.

    Thanks

     
    Last edit: estux 2013-07-10
  • c1tru55
    c1tru55
    2013-07-09

    Hi all,
    also trying to use 7z.dll in Qt project with MSVC2010 compiler, but get next linker errors:

    mainwindow.obj : error LNK2019: unresolved external symbol "class CStringBase<wchar_t> __cdecl ConvertPropVariantToString(struct tagPROPVARIANT const &)" (?ConvertPropVariantToString@@YA?AV?$CStringBase@_W@@ABUtagPROPVARIANT@@@Z) referenced in function "private: void __thiscall MainWindow::getArchiveContent(class QString const &)" (?getArchiveContent@MainWindow@@AAEXABVQString@@@Z)

    mainwindow.obj : error LNK2019: unresolved external symbol "public: long __thiscall NWindows::NCOM::CPropVariant::Clear(void)" (?Clear@CPropVariant@NCOM@NWindows@@QAEJXZ) referenced in function "public: __thiscall NWindows::NCOM::CPropVariant::~CPropVariant(void)" (??1CPropVariant@NCOM@NWindows@@QAE@XZ)

    mainwindow.obj : error LNK2019: unresolved external symbol "public: bool __thiscall NWindows::NFile::NIO::CInFile::Open(wchar_t const *)" (?Open@CInFile@NIO@NFile@NWindows@@QAE_NPB_W@Z) referenced in function "public: bool __thiscall CInFileStream::Open(wchar_t const *)" (?Open@CInFileStream@@QAE_NPB_W@Z)

    mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall CInFileStream::Read(void ,unsigned int,unsigned int )" (?Read@CInFileStream@@UAGJPAXIPAI@Z)

    mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall CInFileStream::Seek(__int64,unsigned int,unsigned __int64 *)" (?Seek@CInFileStream@@UAGJ_JIPA_K@Z)

    mainwindow.obj : error LNK2001: unresolved external symbol "public: virtual long __stdcall CInFileStream::GetSize(unsigned __int64 *)" (?GetSize@CInFileStream@@UAGJPA_K@Z)

    mainwindow.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CInFileStream::~CInFileStream(void)" (??1CInFileStream@@UAE@XZ) referenced in function "public: virtual void * __thiscall CInFileStream::`scalar deleting destructor'(unsigned int)" (??_GCInFileStream@@UAEPAXI@Z)

    I will be grateful for any help in correcting these errors.

     
  • Ajay Jain
    Ajay Jain
    2014-02-11

    Hello,

    I am also getting the same error in my c++ project:
    or LNK2019: unresolved external symbol "public: thiscall NWindows::NFile::NIO::CFileBase::~CFileBase(void)" (??1CFileBase@NIO@NFile@NWindows@@QAE@XZ) referenced in function "public: thiscall NWindows::NFile::NIO::CInFile::~CInFile(void)" (??1CInFile@NIO@NFile@NWindows@@QAE@XZ)

    Can you please let me know how you resolved it ?

    Also if you can please send me your working code, it would be great.

    Thanks,
    AJ

     
    Attachments
    • Igor Pavlov
      Igor Pavlov
      2014-02-12

      Try to add CPP\Windows\FileIO.cpp to project.

       
      Attachments
      • Ajay Jain
        Ajay Jain
        2014-02-12

        It worked.
        In addition to CPP\Windows\FileIO.cpp, I also added CPP\7zip\Common\FileStreams.cpp in my project.
        Thanks a lot....:-)

         
        Attachments