Using libzip library from Visual Studio 2017 and cmake - c++

I have a c++ program that was originally written in Linux. The program uses functions from the library libzip:
https://libzip.org
I am now working on a windows-based platform in Visual Studio 2017. Everthing works, as I could basically use the same cmake-files as I used on the Linux-platform. However, in Linux I used the package manager to install libzip. I do not have that option in Windows. I somehow need to build a Windows-version for libzip and include the files (header files and lib files) in my CMakeLists.txt file. Can someone help me with a step-by-step guide for this?

Take a look at vcpkg. It is a package manger for the Windows platform. It builds and installs many open source libraries for Windows. libzip is mentioned specifically as one of the ports.

Is it possible for you to use the Nuget Package Manager within Visual Studio?
right click on your solution
select "Manage packages for your solution"
search for libzip
select lipzip and click install
you should now be able to #include "zip.h"

Related

Visual Studio 2017 cross-platform Linux project with boost

I'd like to ask how to include boost hpp files in cross platform Linux project. I am developing on Windows and compiling remotely on Linux with VS 2017.
For IntelliSense the C++ header files from Linux are automatically copied to Windows machine.
Is it the case with boost hpp files also?
How is it in a case when boost is just extracted from a package on Linux and not installed by apt-get... command?
Do I need to install boost on Windows also?
How to refer to hpp files so that both VS IDE and g++ would find the files?
Thanks.
I have to figure out how to make it work, so I post it here if someone else needs a help:
To make IntelliSense work, the boost has to be on Windows. The VS can not be instructed to download additional include files from Linux. What it downloads from Linux is not user configurable in VS 2017, so we have to install or download boost files on Windows manually.
Add the path to VS in Configuration Properties->C/C++->General->Additional Include Directories. For example $(ProjectDir)../../boost_1_68_0/;
Add path to boost which is on Linux machine. For example: /usr/local/boost_1_68_0/;
Now you should be able to compile VS solution and IntelliSense should work.
If someone knows how to avoid installation of boost on Windows and use only boost installation on Linux, please let me know. I don't understand why VS does not allow to manually specify additional includes for a download.

How to use Chromium Embedded Framework with Visual Studio 2017 (C++)?

I would like to use CEF with VS 2017 using C++ (not C#, so CEFSharp won't work here). I can't quite understand how to do this. From what I have read, it seems like I need to build the source into a .sln file and then modify the existing code, however their site also says there are binaries available to download, which is confusing me.
How do I program in C++ using CEF and VS 2017?
Download CEF3 binaries, and extract archive to folder
Download and install CMake
Open CMake, and set:
Where is the source code: folder
Where to build the binaries: folder/build
Press Configure
Press Generate
Open solution in folder/build/cef.sln
Build Debug/Release
Reference in your project folder/build/libcef_dll_wrapper/[Debug|Release]/libcef_dll_wrapper.lib
Copy files to your bin folder:
folder/[Debug|Release]
folder/Resources

C++ OpenGL Project Setup using GLEW, assimp, SDL2 and CMake with CodeBlocks

I've done a whole tutorial about making a 3D Rendering Engine in OpenGL with Java and lwjgl and the guy who made the tutorial also wrote the engine in C++
To increase my knowledge about programming I wanted to take a look at the C++ version too. Also I believe (and I might be totally wrong) that I'm actually able to do a lot more with C++ than with java. The main problem I have is that I cannot get the engine running despite the included instructions and I would really appreciate if someone can help me out.
this is the engine i want to setup: https://github.com/BennyQBD/3DEngineCpp
I want to use CodeBlocks for this project since it was recommended and unlike Visual Studio it is free.. I also already downloaded glew, assimp and sdl and I installed CMake which are needed for this to run. Now I have to put that together according to this instruction here:
###Windows/MinGW###
- Make sure CMake is both installed and added to the system PATH.
- Open a Terminal and run:
```Shell
# install dependencies
# Install GLEW in %PROGRAMFILES%/GLEW or SET %GLEW_ROOT_DIR% to where GLEW is on your machine (Example: D:\PATH_TO_GLEW)
# Install SDL2 in %PROGRAMFILES%/SDL2 or SET %SDL2_ROOT_DIR% to where SDL2 is on your machine (Example: D:\PATH_TO_SDL2)
# Install ASSIMP in %PROGRAMFILES%/ASSIMP or SET %ASSIMP_ROOT_DIR% to where ASSIMP is on your machine (Example: D:\PATH_TO_ASSIMP)
cd build
# REPLACE "Visual Studio 12" with your preferred build toolchain (Maybe you want "Codeblocks - MinGW Makefiles")
# BTW VS 10 is VS 2010, VS 11 is VS 2012 and VS 12 is VS 2013, BLAME MicroSoft for the naming! LOL!
cmake -G "Visual Studio 12" ../
# open the generated SLN file (or cbp file if using CodeBlocks) and build!
```
- Copy the DLLs in /lib/_bin/ to /build/Debug/ and /build/Release/
- In Visual Studio, set the Startup project to 3DEngineCpp
- Move the res folder into the build folder
- Run
Major problem is, since I've only done java coding in eclipse I'm a bit confused..
What does he mean by "Open a Terminal and run: '''Shell" ?? and how am I supposed to install glew, sdl2 and assimp? what's cd build? and why do I need CMake, it isn't really mentioned what it does..?
Maybe someone can elaborate (step by step if possible) what I need to do in order to get this running, thanks a lot!
No guarantees my steps will work flawlessly as external dependencies in C++ is still very painful to deal with for me, but I'll give you some leads and hope you make some progress. Also, I've never used Code::Blocks, so I'm not sure if Visual Studio projects are compatible with it. This is the only way I know how to do things on Windows.
First, you'll need to install CMake. CMake is a utility that generates project files so that the project can be easily compiled on certain platforms. It generates Visual Studio project files on Windows, which will allow you to open the project in Visual Studio, and compile them from there.
In order to build the project, you'll have to sort out its dependencies first.
GLEW:
Download GLEW's sources and extract everything. It comes with Visual Studio project files
Open up Visual Studio with Administrator permissions
Open up GLEW's project
Build everything
Run the install "project" to get Visual Studio to install GLEW
Assimp:
Download Assimp's source from GitHub
Extract the project root directory somewhere. The root directory is the directory where CMakeLists.txt is in
Open CMake's GUI utility
Click Browse Source, and select that directory
Select an output directory by clicking Browse Build
Click Configure, when that's done click Generate. This will generate a Visual Studio project file for you
Open project with Visual Studio, build everything. Run install like you did before to install Assimp
SDL2: SDL's sources come with Visual Studio project files, so you can repeat the steps for GLEW to install it.
Now you can finally start attempting to get the engine to work. No guarantees that it'll work, but I'd try the same thing I suggested for Assimp as they're both CMake projects. Once the project files are generated, you can open it up in Visual Studio. Except this time, you won't really be installing it. You can modify the sources and run it like you would any other C++ project.

missing DLL file when i run my application on another machine?

I am using visual studio 2013 with ISLE 2013 to create a windows form application,
it is the first time i use this style,
I successfully built the application but the problem comes after i setup the application on another PC is says msvcp120.dll is missing!
I have searched the web for this problem and I could not find anything?
any ideas?
I am not a windows guy but I will try to answer, as I did some small research. I found information here. It says:
"This file is the dynamic linking library designed as a Microsoft C Runtime Library, usually comming with Microsoft® Visual Studio®. It is a collection of link libraries that contains instructions for the standard C library functions. It is used by almost all Windows programs compiled from C or C++ source code. This library is used for the applications written under Visual Studio."
So, I am guessing it is a microsoft thing. A runtime library that is required to run c/c++ projects built with visual studios. Download the .dll from a source online (just google) and include it into your project directory. If it helps, include that file in your installation file.
Until anybody who is working with windows and has any idea about that dll answers you question, this answer can help you to get started.
found the solution I should add the Visual C++ runtime library installer
Don't download single DLL's from which you know hardly anything from random sites.
From your Visual Studio 2013 installation directory, check C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\1033 and you'll see vcredist_x64.exe and vcredist_x86.exe files that need to be run on your target system.
Use the x64 variant for 64 bit apps. It will install MSVCP120.dll for one, and some other DLL's as well.
Msvcp120.dll is the dll for standard c++ library. When you develop an application using standard c++ in VS 2013, the application defaults to Msvcp120.dll(Msvcp110.dll in VS2012). The client computer should install Visual c++ 2013 Redistributable.
Some dependencies that are on your system because you have Visual Studio installed will not be on the target system. You will need to include them in your installer or install a redistributable package on the target machine.
As there are many options and listing them all here would be too much and also redundant, you may want to visit the Microsoft site for this task and read up on all those options before you decide which you chose.
You can download the .dll file from DLL Store and paste that file into the directory where you have installed the setup.
Hope it will help you.

Setup boost and use with Visual Studio 2010 Express

I know that similar questions you can find in web and, particularly in stackoverflow but I still need to write this question because i could no find any page where there is a step by step tutorial how to setup boost library and integrate it with visual studio 2010 express.
Even here: How to use Boost in Visual Studio 2010
there are steps (e.g. 3, 4) that I can't find the menus or so...
So please help me to be able to use boost with visual studio 2010 express on Win7.
For building:
Download Boost from here: http://www.boost.org/users/download/ and extract files
Double click on build.bat file
Press Win+R, type cmd and press enter. The cmd.exe will be invoked.
In cmd.exe type "cd the_directory_name_where_you_run_build.bat" and press enter
Then type "bjam --prefix=C:\Boost install"
See here the item 1.3 (Installation) for building and building details: http://en.highscore.de/cpp/boost/ Also this a very good Boost tutorial/book with lots of examples.
Then the rest is to set include directories and static link directories in MVS and that all. In order to do that in Solution Explorer right click on the solution name you want to compile, and go to Properties->Configuration Properties->VC++ Directories and for Include Directories and Library Directories add appropriate paths to header (.hpp) and static library (.lib) files. (Search them in C:\Boost!)
I meet some linking issue when I install boost with installer from "BoostPro Computing". And I solve it by compiling boost lib from source code. Here is the steps:
download boost from http://www.boost.org/users/history/version_1_52_0.html
unzip it
enter Visual Studio 2010 Express Command Prompt
cd to the unzipped boost dir
bootstrap.bat
.\b2
Done.
Here is my environment:
Win7 64bit
Visual Studio 2010 Express
boost 1_52_0
P.S. At the end of Boost build mentions the include directory and lib directory that should be added to corresponding paths so that Visual Studio could find them.
The link you found is a step-by-step guide..
If you can't do something like find the property manager, then I suggest you look at the help which will show you where it is..
For that particular case, the Property Manager can be found in the View menu, under 'Other Windows'