Comments (13)
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_initIs this an issue on my side or a bug?
—
Reply to this email directly or view it on GitHub
#4.
from libzippp.
Ah thanks a lot for your fast response that did do the job
from libzippp.
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.
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/iJGBSAk8It 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.
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.
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.
I did this already, but it seems like it wants to call the private copy constructor of ZipArchive
from libzippp.
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.
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.
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.
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.
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.
Since I did never reproduce the issue and never had any other report about it, I close this...
from libzippp.
Related Issues (20)
- Issue opening zip file (constructor or .open() call) HOT 3
- Minor: when the zip is aborted the percent is modified to 100% HOT 3
- Set compression method in addData
- ZipArchive::readEntry doesn't handle entries of zero size
- Add the possibility to set the compression level
- setCompressionMethod silently fail when the archive is not yet opened
- Is it possible to incrementally append data to a file already added to an archive? HOT 1
- Memory leak when archive `close` is not successful HOT 2
- ZipArchive::close: zip_close called before saving buffer data. HOT 8
- Modification Time Not Updated for Overwritten Files in Zip Archive
- [macOS] After unzip archive binary file become text file HOT 1
- The install of libzippp.pc is not working HOT 1
- LIBZIPPP_ENABLE_ENCRYPTION does not set LIBZIPPP_WITH_ENCRYPTION in .pc file
- BUG: null pointer dereference after cancelling a `close()` HOT 2
- Issue when closing a zip HOT 3
- Extract have something wrong HOT 4
- Failed to build in Codespace HOT 8
- ZipArchive::addFile needs variant with std::wstring HOT 3
- Archive with encryption causes zip_fopen_index() to fail HOT 2
- Add data files and then delete other entries, abnormal data will appear in the zip archive. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libzippp.