Coder Social home page Coder Social logo

Comments (13)

ctabin avatar ctabin commented on July 23, 2024

Hello,

You have also to link against libzip and zlib statically (the order is
important).

Regards,
Cédric

On Tue, Sep 16, 2014 at 12:19 PM, feliwir [email protected] wrote:

Hi, i did built the library succesfully with MSVC 2013 and i now link
against libzippp_static.lib and get the following linker errors:
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_close
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_delete
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_dir_add
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_discard
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_fclose
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_file_add
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_file_get_comment
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_file_rename
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_file_set_comment
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_fopen_index
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_fread
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_get_archive_comment
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_get_num_entries
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_name_locate
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_open
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_set_archive_comment
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_set_default_password
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_source_buffer
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_source_file
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_source_free
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_stat_index
1>libzippp_static.lib(libzippp.obj) : error LNK2001: unresolved external
symbol _zip_stat_init

Is this an issue on my side or a bug?


Reply to this email directly or view it on GitHub
#4.

from libzippp.

feliwir avatar feliwir commented on July 23, 2024

Ah thanks a lot for your fast response that did do the job

from libzippp.

feliwir avatar feliwir commented on July 23, 2024

Sorry to bother you again but the following code just won't compile on msvc 2013:
http://pastebin.com/iJGBSAk8

It seems like i can't access the constructor of ZipArchive:
error C2248: 'libzippp::ZipArchive::ZipArchive' : cannot access private member declared in class 'libzippp::ZipArchive'

i is of type string

from libzippp.

ctabin avatar ctabin commented on July 23, 2024

Hello,

Did you declare the libzippp namespace somewhere ? Otherwise you'll have to
explicitly put libzippp::ZipArchive arch(i).
I did not test libzippp under MS VS2013, but since the code works with MS
VS2012, it should be also working in new versions....

Best,
Cédric

On Wed, Sep 17, 2014 at 12:36 PM, feliwir [email protected] wrote:

Sorry to bother you again but the following code just won't compile on
msvc 2013:
http://pastebin.com/iJGBSAk8

It seems like i can't access the constructor of ZipArchive:
error C2248: 'libzippp::ZipArchive::ZipArchive' : cannot access private
member declared in class 'libzippp::ZipArchive'

i is of type string


Reply to this email directly or view it on GitHub
#4 (comment).

from libzippp.

feliwir avatar feliwir commented on July 23, 2024

yes i am using namespace libzippp. I better gonna show you the hole file:
.cpp: http://pastebin.com/FY3trSYZ
.hpp: http://pastebin.com/Ckasa9ZU

from libzippp.

ctabin avatar ctabin commented on July 23, 2024

Unfortunately, I don't see what could cause the problem... There is no
private constructor of ZipArchive in libzippp.
I would try to get rid of the auto keyword, just to see what happens.

On Wed, Sep 17, 2014 at 1:00 PM, feliwir [email protected] wrote:

yes i am using namespace libzippp. I better gonna show you the hole file:
.cpp: http://pastebin.com/FY3trSYZ
.hpp: http://pastebin.com/Ckasa9ZU


Reply to this email directly or view it on GitHub
#4 (comment).

from libzippp.

feliwir avatar feliwir commented on July 23, 2024

I did this already, but it seems like it wants to call the private copy constructor of ZipArchive

from libzippp.

ctabin avatar ctabin commented on July 23, 2024

Hello,

OK in fact the problem is caused by this line: m_archives.push_back(arch);
Since the copy constructor is private, you cannot store directly a
ZipArchive instance. You have to store a pointer instead.

Best,
Cédric

On Wed, Sep 17, 2014 at 1:32 PM, feliwir [email protected] wrote:

I did this already, but it seems like it wants to call the private copy
constructor of ZipArchive


Reply to this email directly or view it on GitHub
#4 (comment).

from libzippp.

feliwir avatar feliwir commented on July 23, 2024

well, i changed the code to this:

sage::fs::Filesystem::Filesystem() : m_rootdir("./")
{
    auto archives_names = util::listFiles(m_rootdir, ARCHIVE_EXT);
    for (auto& i: archives_names)
    {
        m_archives.push_back(new ZipArchive(i));
        ZipArchive* arch = m_archives.back();
        if (!arch->open())
            throw std::runtime_error(util::makeException("Could not open archive " + i, "sage::fs::Filesystem::Filesystem()"));

        auto entries = arch->getEntries();
        for (auto& j : entries)
        {
            m_filemap[j.getName()] = j;
        }
    }
}

But my for loop still keeps running too often and causes a crash. I made sure the auto keywords don't make a difference. The runtime error is the following;
Expression : vector iterator not dereferencable

Help is again very much appreciated

from libzippp.

feliwir avatar feliwir commented on July 23, 2024

here is a minimalistic example reproducing that error:

#include <libzippp.h>
#include <vector>
#include <string>
using namespace libzippp;

int main(int argc, char** argv)
{
    std::vector <ZipArchive*> m_archives;
    m_archives.push_back(new ZipArchive("test.zip"));
    ZipArchive* arch = m_archives.back();
    if (!arch->open())
        return -1;

    auto entries = arch->getEntries();
    std::vector<ZipEntry>::iterator it;
    for (it = entries.begin(); it != entries.end(); ++it) {
        ZipEntry entry = *it;
        std::string name = entry.getName();

    }

    return 0;
}

from libzippp.

ctabin avatar ctabin commented on July 23, 2024

Hello,

I tried your code under GCC 4.7.3 (I only needed to replace the auto
keyword with std::vector) and I didn't have any problem...
Can you also provide the zip file that is causing you trouble ?

Regards,
Cédric

On Tue, Sep 23, 2014 at 9:20 PM, feliwir [email protected] wrote:

here is a minimalistic example reproducing that error:

#include <libzippp.h>#include #include using namespace libzippp;
int main(int argc, char** argv){
std::vector <ZipArchive*> m_archives;
m_archives.push_back(new ZipArchive("test.zip"));
ZipArchive* arch = m_archives.back();
if (!arch->open())
return -1;

auto entries = arch->getEntries();
std::vector<ZipEntry>::iterator it;
for (it = entries.begin(); it != entries.end(); ++it) {
    ZipEntry entry = *it;
    std::string name = entry.getName();

}

return 0;}


Reply to this email directly or view it on GitHub
#4 (comment).

from libzippp.

feliwir avatar feliwir commented on July 23, 2024

Sure here it is:
http://www.file-upload.net/download-9574701/test.zip.html

It might be able to compile with gcc, but it would be awesome if you could check with msvc 2013

from libzippp.

ctabin avatar ctabin commented on July 23, 2024

Since I did never reproduce the issue and never had any other report about it, I close this...

from libzippp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.