I needed SQLite for Win x64 to use in the C++ project in MS VS 2010. And I found this post with the link to x64 build, but it needs .net framework. Can I use in the my project? Also, I am about to use automated building on server side in this project, so it can be a problem to meet additional requirements (does it?).
So, does anyone have a link to precompiled SQLite DLL for x64 or I need to build it from sources? Also, if I am wrong about .net version and it is the one I need, let me know, please.
There is no official precompiled 64-bit Windows DLL of SQLite.
However, compiling it yourself is trivial: just download the amalgamation and add the .c file to your project; there are no additional configuration steps or requirements.
If you do not wish to link the library statically (or compile it directly into your application as suggested in the only answer available here so far), you can use the short tutorial I created recently. The binaries are available there as well if you need them. It uses MS VS 2015. A long time passed since your original question, but maybe someone else can find this useful.
Edit: As somebody stated below, simply providing the link is not enough, so just briefly the basics of the tutorial: You have to download the amalgamation source code from the original SQLite page and you can compile dll from it in your visual studio, but crucial is to set proper pre-processor directives for the compiler:
SQLITE_ENABLE_FTS4=1
SQLITE_ENABLE_RTREE=1
SQLITE_ENABLE_COLUMN_METADATA=1
SQLITE_API=__declspec(dllexport)
Especially last one is the one which makes your library usable. This information is not mentioned in the original instructions for building the library from the sources using the Microsoft toolchain.
Related
I was always using Windows, have very limited Linux experience.
My Visual Studio solution contains 5 C++ projects - 4 of them are static libs, and one is main application (that use these static libs), I want to move it to Ubuntu.
I do not use any windows specific code, so with minor changes I should be abble to compile under Linux.
How to do this? What exactly software should I use under Linux? What should I do with static libs, should I keep using static libs in Linux? How to convert Visual Studio solution to something Linux-like?
upd what if I just download Eclipse in Linux and then file by file, project by project, recreate and copy everything from VC++ to Eclipse? this should work, isn't it? I have just 100-200 files so it's possible to do this by hand.
I can think of two reasonable options. The first one is to create a makefile that will compile everything for you. There was once a utility called Make It So that did this automatically. Their page specifies compatibility with Visual Studio 2010, it might work with Visual Studio 2012 as well.
You can also use cmake. It's a bit more involving to get right, but the end result will be the ability to compile your code more or less anywhere.
Use xbuild? So if you install Mono, then you have xbuild which is the OSS version of msbuild. You can just build your .sln file by something like "xbuild solution.sln"
Clion can generate cmake file automatically for .sln project under linux.
If your code is not dependant on any Window specific library then you can use make the utility to make any lib, bin.
You can also provide different rules to link your library based on your specific requirement. You can also link third party library using Make utility.
I have downloaded LEDA free edition from this website
http://www.algorithmic-solutions.com/leda/ledak/index.htm
First quetion:
I want to use this library with my project in VS2010 ide, but i didn't really catch from installation notes, how can i install this library on windows platform.
There were already some static libs (you can see them on the image), which i added to my project with appropriate headers. But that, i suggest, is not a right way. So i will be glad if you will briefly describe the steps, which i should make to compile this library...
The root library directory looks like this
Second question:
In leda's installation guide i can see two main sections:
1.) CONFIGURATION/INSTALLATION FOR UNIX
2.) CONFIGURATION/INSTALLATION for MS Visual C++
In "CONFIGURATION/INSTALLATION for MS Visual C++" i can see the following:
Go to the LEDA main directory (at the command prompt used above).
Type: lconfig msc [dll] [ ml | mld | md | mdd | mt | mtd ]
I'am sorry, i have never seriously used UNIX based systems, but i always thought that MS Visual C++ is a thing, strongly connected with Windows, and lconfig is a unix command?
So i confused, this guide is for unix or for windows or ...?
Thank you, sorry for possibly stupid questions.
The LEDA "free" edition does not include source code. They sell the source code for users who want to modify / compile it. What you have downloaded can be used by including the .h in \incl and linking against the appropriate .lib files. It appears that the package gives you several .lib files to cover all the options of static linking or dynamic linking.
The lconfig instructions are for when you do have the source code, and you want to control which configuration of dll/lib gets built.
"lconfig" is not a standard or even niche UNIX tool; a quick google suggests it's something that actually comes with LEDA itself. Since you've downloaded it, you ought to see it someplace in the bundle.
I have some C++ code which uses boost's GIL image library, and wants to write files using boost::gil::png_write_view from boost/gil/extension/io/png_io.hpp. That header itself includes png.h, and of course results on a link dependency.
On Debian it compiles and links fine. If it did complain about anything missing, the necessary headers and libs would be a few seconds away via an aptitude install libpng-dev.
On Windows (VisualStudio 2008 on XP64), I'm having to face the idea that it looks like I'll have to build libpng from source (and so also its zlib dependency) myself. If there's an obvious packaging already out there, I'm not seeing it. Can anyone enlighten me if there is such a useful resource anywhere ?
Libpng's own packaging itself seems to supply project files for vc6 and VC7.1 (VS2003). And more recent releases also come with VC10 project files. But nothing for VC8(VS2005) or VC9(VS2008). However there are instructions here (which I've yet to try) which describe building for 2008 after running the 7.1 project files through the conversion wizard.
I did initally try the GnuWin32 build of libpng, but (apart from being 32 bit only) it crashed in a libpng call to fwrite when passed a FILE* from VS2008's CRT. libpng's own documentation has something to say about this and the perils of mixing different versions of MSVC but their suggested workround is only relevant to direct libpng users (and I'm using it via boost GIL).
Update: the converted project files do work pretty well (maybe some minor obvious fixups). By far the biggest part of the job was creating the 64bit builds; the original and converted project files don't include any such configuration and while visual studio will have a go at creating them, there was a fair amount of config dialog editing to get consistent folder/file names etc.
I am a Java programmer and have come across a very nasty situation. For POC purposes, I need to write down a small segment of my solution that will run as a standalone application doing something very specific.
I have 2 questions:-
I can write the code, but what I don't know is how do I create an installer and exe out of that C++ code.
Secondly, I need to parse a sqlite db file and show its data in the application. Is there a sqlite windows dll or some C++ library or something that I can use, instead of asking the user to install sqlite (or doing it myself through the installer)? So basically, I don't want an extra program to be pushed in, just a dll or some C++ library..
Please let me know if you have an answer to either or both the issues that I'm facing.
Thanks
Compiling your code will turn it in to an executable. For distribution, you'll want to build it in Release mode. I'm not sure what version of Visual Studio you are using, but you might have a "Setup and Deployment" Project type which will enable you to create an installer. Failing that, you may have to look at InstallShield or a tool like that to ensure that the installer has all necessary files (such as the runtime libraries).
SQLLite is called light for a reason! The source code for it can be incorporated directly in to your project and compiled alongside the rest of the files (see: http://www.sqlite.org/selfcontained.html ). This means no external libraries are necessary to link against, and no extra DLLs need to be redistributed alongside your executable.
I'm working on a project using C++, Boost, and Qt. I understand how to compress single files and bytestreams using, for example, the qCompress() function in Qt.
How do I zip a directory of multiple files, including subdirectories? I am looking for a cross-platform (Mac, Win, Linux) solution; I'd prefer not to fire off a bunch of new processes.
Is there a standard way to combine bytestreams from multiple files into a zipped archive, or maybe there is a convenience function or method that would be available in the Boost iostream library?
Many thanks for the assistance.
Update: The QuaZip library looks really great. There is an example in the download package (in the "tests" dir) that shows very clearly how to zip up a directory of files.
Update 2: After completing this task on my Linux build environment, I discovered that QuaZip doesn't work at all with the Visual Studio compiler. It may be possible to tackle all those compiler errors, but a word of caution to anyone looking down this path.
I have found the following two libraries:
ZipIOS++. Seems to be "pure" C++. They don't list Windows explicitly as a supported platform. So i think you should try your luck yourself.
QuaZIP. Based on Qt4. Actually looks nice. They list Windows explicitly (Using mingw). Apparently, it is a C++ wrapper for [this] library.
Ah, and of course, i have ripped those sites from this Qt Mailinglist question about Zipping/Unzipping of directories :)
Just for the record...
Today, I needed to do something very similar in Visual C++. (Though wanted to maintain the possibility to compile the project on other platforms; however preferred not to adopt Qt just for this purpose.)
Ended up using the Minizip library. It is written in plain C, but devising a simple C++ wrapper around it was a breeze, and the end result works great, at least for my purposes.
I have built a wrapper around minizip adding some features that I needed and making it nicer to use it. Is does use the latest c++11 and is developed using Visual Studio 2013, so it should work out-of-the-box for you.
There's a full description here: https://github.com/sebastiandev/zipper
you can zip entire folders, streams, vectors, etc. Also a nice feature is doing everything entirely in memory.
Poco::Zip is also a choice, it has clearly documentation and some code for demo.
Poco::Zip Document
system("zip myarchive.zip *");
I tried QuaZIP 0.4.3 on Windows with VisualStudio 2010 -- there are still issues but can be resolved easily.
To build with VS:
Use CMake to configure and generate VS solution for QuaZIP.
Open soltion with VS and build -- you'll first notice that it can't find 'zlib.h'.
Open preferences for quazip project and add path to Qt's copy of Zlib to C/C++->General->Additional Include Directories: $(QTDIR)/src/3rdparty/zlib.
Rebuild again and you'll get lots of warnings and one error C2491: dllimport static issue on QuaZipFile::staticMetaObject.
This is because QuaZipFile is declared like "class QUAZIP_EXPORT QuaZipFile" and QUAZIP_EXPORT needs to resolve to Q_DECL_EXPORT for dll and to Q_DECL_IMPORT for application, based on whether QUAZIP_BUILD is defined or not. When building QuaZIP QUAZIP_BUILD should be defined but isn't -- configuration process defines in error completely useless "quazip_EXPORTS" instead.
To fix, just remove "quazip_EXPORTS" from all build configurations and add QUAZIP_BUILD instead -- QuaZIP will now build fine.