How to get start using z3 - c++

I am new to z3. I downloaded the latest version from github and followed the instructions to build using visual studio on windows.
Now, i have to use the z3 c++ APIs in a visual studio project. I imported the code example provided in the package into a new vs project to test it but it can't recognize the z3 header file. Seems that there is some thing missed.
Can anyone guide me in how to use z3 in a vs project?

As usual for shared libraries, you have to add the folder that contains *.h to your include paths and the folder that contains *.dll and *.lib files to your library paths. Finally, add *.lib to the libraries the linker will link. There are heaps of other questions and solutions for that on stackoverflow, see for instance How to include libraries in Visual Studio 2012?.

Related

How can I add/import chibios library for embedded project in visual studio?

I want to use ch.h file from chibios in my project. The embedded project is created and is using HAL drivers for stm32. I want to find a way to add or import chibios library to the current project.
My question is that
how can I add these embedded libraries with lots of dependencies by visualGDB in visual studio?
Do I need to create .lib files of chibios?
What are the differences between C/C++ paths and linker paths?
Adding .a and .h files is enough or do I have to look for other files?
There are 3 ways that I followed and it wasn't successful.
I followed the link to add the paths.
The files that added to projects are libch.a and ch.h. It is called other header files inside ch.h. Then, I added the other header paths to C/C++ "additional include directories" too. After I added the third header file, I got the error "redefinition".
The second way, I wanted to use vcpkg, a library manager. But the chibios library wasn't available in vcpkg.
One another way is to add libraries in standard libraries without adding any paths. But how can I find standard libraries? If the location is in the compiler (gcc-arm-none-eabi), the chibios package was added, but it still wasn't detected in visual studio.
I really appreciate it if you know any tutorials or ways to add chibios in the visual studio

cannot see the file 'SDL2.lib'

This question is not a duplicate of cannot open file 'SDL2.lib' which discusses this same error but my problem is that I don't have an SDL2.lib file, if I can just see it I can make this work
I'm trying to set up the development environment for SDL2 by following Lazy Foo's tutorial.
Setting up SDL 2 on Visual Studio 2010 Ultimate
The tutorial is for Visual Studio 2010, I'm using Visual Studio Community Edition 2017. Is that a problem?
The problem starts when linking the libraries, there is no x86 or x64 folder inside the lib directory of SDL2's Windows Development libraries that I downloaded from SDL version 2.0.8 (stable).
So I specified it as lib/ instead of lib/x86 as it says in the tutorial.
These are the files inside the lib folder
$ ls
cmake/ libSDL2.dll.a libSDL2_test.a libSDL2main.a pkgconfig/
libSDL2.a libSDL2.la libSDL2_test.la libSDL2main.la
When building VS2017 is throwing an error saying that Cannot open file 'SDL2.lib'. Yeah, there is no such file. Do I need to do an additional step to get this file?
When I configured for CodeBlocks it works fine. What exactly am I doing wrong here? This may have an obvious answer but I'm not able to find it.
Library name `libSDL2.dll.a' indicates that it is not meant for use with VS C++ ( for dynamic link you need dll + lib, for static link you need only the lib ). You can construct a lib file from dll using dumpbin.exe and lib.exe. Your options are:
1) Download SDL source file in zip format from GitHub and create you own binaries.
2) Use vcpkg and install in just one command line ( recommended).
3) Download the SDL binaries from internet. ( you can have linker issues if the project configurations doesn't matches yours)

Point Cloud Library with Visual Studio 2017

I'm having trouble using Point Cloud Library with Microsoft Visual Studio 2017.
I have installed [PCL-1.8.1-AllInOne-msvc2017-win64.exe] and I've followed the steps mentioned
here. to link it to my Visual Studio 2017 project.
My problem is that Visual Studio is not finding the header nor the source files of the library I need.
The error I'm getting is as follows:
[fatal error C1083: Cannot open include file: 'pcl/io/pcd_io.h': No such file or directory]
To be more precise about my problem, I need to include three PCL header files in order to run thisIterative Closest Point Tutorial
I've followed the following steps to include the PCL into my project:
Added the include directories to my project at the Project Properties/Configuration Properties/VC++ Directories/Include Directories field - here I specified the path to my PCL/include directory and to all 3rd party include directories (PCL/3rdParty)
Added the library directories on the same settings page (Library Directories field) - hereI specified the path to my PCL/lib directory and to all non-header-only 3rd party libs (Boost, Flann, VTK)
Chose the libs to be used in the linker. In Project Properties/Configuration Properties/Linker/Input/Additional Dependencies field. I added all the libs required. As I'm trying to run it in debug mode for now, I've picked the "_debug.lib" library files.
Finally, I've added the PCL/bin folder to my system path variable.
Does anyone know if I'm missing something configuration-wise?
I've seen several old posts about incompatibility between older Point Cloud Libraries and older versions of Visual Studio. As far as I understood, the new versions are supposed to work well together, but it's not the case for me.
Installing pcl is tough because there are dozens of dependencies used along with pcl software. But with with vcpkg,a command line package manager, the installation becomes just like a one liner command.
Use Microsoft vcpkg to build a static or dynamic library for your project automatically. All the dependencies like boost,tiff,openssl,flann,szip,etc will be downloaded and installed by itself. After installing vcpkg type the following on Powershell.
.\vcpkg install pcl:x64-windows-static
The link you referenced is 3-4 years old. At the time, any binary build of PCL for Visual Studio 2012 or later was not provided, and thus. PCL needed to be built with target VS. And every include/library directory of PCL and any related library have to be manually added to setup the IDE. Since PCL is a large-scale collection of libraries, this made it difficult for its users to setup VS.
Now early 2018, binary builds of PCL for VS 2015/2017 and more automatic way to setup VS (e.g., adding library/include directories) using CMake are provided. Thus, installing PCL and creating a VS project using PCL does not take more than 10 minutes. I think you'd better follow the recommended way rather than setting VS by yourself.
the previous answer use vcpkg is good,but is better to use:
.\vcpkg install pcl:x64-windows
It can let you have fewer problems.
A small note for anyone who has issues with the install listed above, occasionally an install will get corrupted and not work. I got:
LINK : fatal error LNK1201
on a build, and the solution for that is find the downloaded item. This will be located in the vcpkg/downloads/ directory. Delete the item that was having issues and try the install again.

how to install boost/asio.hpp library for C++ visual studio 2015

Hello I am trying to install this library for use in one of my visual studio projects.
I know I have to go to \project properties-linker-general-additional library Directories but once I get there I don't know what to do.
I am stuck here :
Here's a step-by-step tutorial for installing, (optionally) building, and referencing boost in Windows: http://www.boost.org/doc/libs/1_61_0/more/getting_started/windows.html#get-boost
Obtain a copy of boost and put it to a folder boost_root (name as you please). If you haven't done it already, the easiest way is to get a precompiled zip from boost
Find the directory where your boost binaries are located. It usually is under the lib subdirectory, ie boost_root\libs.
Under the Additional library directory of visual studio (the one you mention in your post), enter the full or relative path to the boost dll directory, ie path_to_boost_root\boost_root\libs

Including Armadillo C++ library in a C++ project in Microsoft Visual Studio 2015

I'm trying to include the Armadillo C++ library, a linear algebra library, in a C++ project I'm working on, and I'm having a difficult time figuring out how to do so. I'm unfamiliar with how to add libraries to a project in general, so I've been searching for a resource that has step by step instructions, and the best one I could find didn't work for me (http://codeyarns.com/2013/11/15/how-to-use-armadillo-on-windows/). I followed all the instructions on the web page, and Visual Studio still complains when I put #include <armadillo> and using namespace arma in my code. Does anyone have any idea what I'm doing wrong?
I have put all the .lib and .dll files in a directory which is added to the PATH system environment variable
and then you just have to add the correct include and library directories in VS2015
and add the lib dependencies you have