Routine for compressing folders in Visual studio - windows

I am trying to write a routine that compress folder/multiple files for Embedded applications in Visual studio.For that I thought of using combination of zlib and tar.I could successfully run the zlib in visual studio but in case of tar the source code refers to some linux headers and results in error.I am a newbie in this area.Could any one tell me how to create the routine.I found a UnxUtils (sourceforge, GNU utilities for Win32 http://unxutils.sourceforge.net.) while browsing,Is that useful? Any help is appreciated.

You might also look at DotNetZip library, as it may work in your situation.
Quote:
Is this thing supported on Mono/Linux?
It's not supported at all. But, it apparently works on Mono/Ubuntu. I don't test it that way. If you'd like to volunteer, let me know.

Related

Why does my C++ compiled Windows .exe have .h source code in it?

I've been making an application in Qt (highly recommended for quick GUI-centric applications). I'm compiling with Microsoft Visual C++ 15.0 in Qt. Everything works fine, just wondering why the resulting .exe has one of the header files fully pasted in the middle of the program with line breaks and everything. Has anyone experienced this or heard of this? I can't find one reason why this would happen. Something to do with my includes maybe?
Thanks for any input.
.h was included as a resource. Thanks to Mike and MrEricSir.

XERCES XML parser

I am relatively new to programming and have been tasked with writing an xml parser using Xerces. My project is in c++ on Microsoft Visual Studio 2015. Are there any good examples for Xerces being used on Windows? I have looked through Apache and it is horrible and has been talked down on by all my coworkers. Most of the help I've found has been for Linux command line or overly complicated examples for specific use cases. Is there anywhere to find a simple example of xerces being used to parse a simple, known xml file? Thank you for any and all help as it is much appreciated!
The official Xerces documentation provides a lot of examples using both DOM and SAX parsing technique. You can find it here: https://xerces.apache.org/xerces-c/samples-3.html.
In order to build the examples and use them as direct references for your code, you have to follow the build instructions in https://xerces.apache.org/xerces-c/build-3.html.
For my personal requirements I created a VS 2013 solution for both Xerces library generation and samples compilation. The command to invoke for generation of the VS solution should for you be something simliar like
cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=D:\libs \path\to\xerces-c\source
where you can set the destination path of the output files via CMAKE_INSTALL_PREFIX , while \path\to\xerces-c\source should be the top level directory of the Xerces download, where the CMakeLists.txt file is located. Naturally you will need to install cmake on your Windows computer, which can be downloaded here: https://cmake.org/download/
Finally in order to start the examples, just use the generated VS solution or open a command prompt and start the desired program. For example use the "DOMPrint" application by calling .\DOMPrint.exe xxx.xml. The location of the binaries is in ${CMAKE_INSTALL_PREFIX}/bin.
Please be aware that you will have to compile or provide the Xerces .dll files to be able to start any programm related with the library. It also can be built using the generated VS solution out of cmake.
Please don't hesitate to ask further questions, if the issue is still up-to-date!

Visualstudio makefile (NMAKE)

I am in need to create a makefile for visual studio. however the documentation for this on Microsoft websites is very gently speaking: lousy. Googling doesn't help either. Could somebody paste a link or simple tutorial on how to create such makefile (for example compiling one program from two cpp files). Also mentioning if include files like in GNU are possible to use (and how to import them in makefile). Or how can i echo something in makefile.
I have seen this but is of not much help.
Try using CMake. It's a cross platform build system. I have used it to generate project and solution files for VS 2010, however there is NMake generator also.
This video should get you started - http://www.youtube.com/watch?v=w9sKd8f0kFo.

Compiling libexif as static lib with Visual Studio 2010 - then linking from Visual C++ project

Is it possible to compile libexif with Visual Studio 2010? I have been trying to do so and have been running into a whole slew of problems. I cannot find any information about whether anybody has successfully done this before. I know I can use MinGW to compile the library, but I am in a situation where I need it to be compiled with Visual Studio and then need to link to it from a Visual C++ app. Is this possible?
To answer your question: Yes it is possible... but it is a bit of a hack. Libexif uses functions that MSVC has chosen not to implement. See my working example VS2010 project below (if you don't like downloading files then skip to my explanation of what needed changing to get it to work below):
https://www.dropbox.com/s/l6wowl8pouux01a/libexif-0.6.21_CompiledInVS2010%2BExample.7z?dl=0
To elaborate, the issues that needed a "hack" (as hinted in the LibExif readme-win32.txt documentation) are:
Libexif uses inline in several places which is not defined in VS for C, only C++ (see this)
Libexif uses snprintf extensively in the code which is not defined in VS (see here)
You need to create the config.h yourself without a ./configure command to help you. You could read through the script but most of it doesn't make sense for Windows VS2010.
You will need to define GETTEXT_PACKAGE because it's probably setup in the configure file. I just choose UTF-8, whether that is correct or not I'm not sure.
There was a random unsigned static * that needed to be moved from a .c file to the .h file as C in VS doesn't allow you to create new variables inside functions in the particular way they were trying to do.
Read the "readme-win32.txt" file. Advice is:
hack yourself a build system somehow. This seems to be the Windows way of doing things.
Don't get your hopes up. The *nix way of doing things is the configuration script that needs to be run first. It auto-generates source files to marry the library to the specific flavor of *nix. The configuration script is almost half a megabyte. Three times as much code as in the actual .c files :) You cannot reasonably get that working without MinGW so you can execute the script. Once you got that done, you've got a better shot at it with a VS solution. As long as it doesn't use too much C99 specific syntax.

Using a .lib built with Visual Studio in Eclipse/CDT/gcc

I am having some trouble compiling a programm with gcc on windows which was initially developed with Visual Studio. So far I was able to resolve almost all problems like missing header files and such, but now I am stuck at one last thing: gcc fails to link to one of the third party libs my program uses (FlyCapture2.lib). It tells me that it does not find any of the functions/methods there. I already checked if the library is actually on the library path and that sort of things, but it still does not work.
I searched a bit around and learned that it might have something to do with the format of .libs created with the Microsoft compiler. Is there any way to convert such a lib to be compatible with gcc? Anything else I might have missed?
(I already found this similar question, but its solution won't work here)
In this page the author gives several ways to achieve what you want

Resources