Easier way to specify Additional Library locations in Visual studio 2013 - c++

When i build the boost library, with the vs 2013 developer prompt,
>bootstrap
>b2
it will generate the lib files in an subdirectory:
bin.v2
every library is now saved as follows(example):
<path>\boost_1_55_0\bin.v2_x64\libs\log\build\msvc-12.0\debug\address-model-64\architecture-x86\link-static\log-api-winnt\threading-multi\libboost_log_setup-vc120-mt-gd-1_55.lib
Now when i try to build an app which uses logging, i will get an linker error because the
file 'libboost_log_setup-vc120-mt-gd-1_55.lib'
could not be opened. Now, when i specify the location of this file in the linker properties of my project and rebuild it another file is missing:
libboost_system-vc120-mt-gd-1_55.lib
rinse and repeat and yet another dependency will pop up, libboost_date_time-vc120-mt-gd-1_55.lib and so on, is there a smart way to solve this problem? like building the boost libraries in a way that the boost build programm will put them in one single folder or can i configure visual studio to search recursively for the libs?

Someone else asked a question on how to build x64 libs with bjam: 64-bit version of Boost for 64-bit windows
the answer also contained the answer to this concrete question:
after the bootstrap command, the bjam command goes as follows:
bjam --toolset=msvc-12.0 --build-type=complete allthelibs
where --toolset=msvc-12.0 corresponds to visual studio 2013
and allthelibs will be the subfolder containing all the boostlibs

Related

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

Setting up Aquila for my c++ Project in Visual studio 2012

I want to use Aquila DSP to compute MFCC features in my project and trying to make it work.I followed this tutorial but after mingw32-make install on the source code pulled from Aquila's git repo, it generates only libAquila.a in lib folder. I tried changing my project's include and library dependencies using these generated files after install. Also tried adding FindAquila.cmake and tried building my project with cmake for VS 2012, still no luck. Keep getting "aquila/global.h" no such file or directory when I try to include "aquila/global.h".
I also tried building Aquila with cmake for VS 2012 and able to compile it and it generates .lib files as well, but not sure how to proceed with that.
If anyone knows how to make it work, it will be great help.
So, I made it work with Visual studio 2013. Now what I am doing is I am building Aquila with both Mingw and with VisualStudio. Mingw gives required include files and visual studio build gives required .lib files. I am building Aquila in VS 2013 with configuration type static lib (project properties >> General >> Configuration type) for both debug and release configuration and then I build the project.
For Mingw, first I use cmake GUI with mingw cmakefiles configuration and then run mingw32-make install in the build directory, which will put the include, lib and share files in the installation directory( usually C:\\Programme files\\Aquila.
Now I create a Folder Aquila and put include and share from above path and create a new folder lib with two subfolder debug and release. Here I put two .lib files in each folder (aquila.lib and Ooura_fft.lib) (debug libs in debug and release libs in release folder, they will be VS build folder). Once this is done, in my project setting, I add Additional include directories under C++ >> general, Addiotnal library path under linker >> general and names of libraries under linker >> input for both bebug and release configuration. After doing all these things, now the library works with my project.

How to set up [ ZeroMQ ] for use in a Visual Studio 2015 Enterprise?

While my primary domain of expertise is not Visual Studio 2015 setup / project configuration, I have experienced troubles on loading / configuring ZeroMQ project.
How to proceed correctly on loading a ZeroMQ Project?
Observed errors:
current build on github and even old "stable" versions cause cmake errors
ZeroMQ Installer does not support Visual Studio v14
Instructions would be awesome, as it seems that there is no other source of documentation for this situation on the internet.
Had the same problem a while ago. Here is what I did to solve this:
Download the right ZMQ version
The "download link" provided on the ZMQ website seems outdated.
To really get the current version you would have to use Git:
git clone https://github.com/zeromq/libzmq.git
Build with Visual Studio 2015
The repository comes with a pre-build Visual Studio project. You can find it in ...\libzmq\builds\msvc. To build for Visual Studio 2015 cd into vs2015 and open libzmq.sln.
You can choose if you want to compile static or dynamic libraries: DynRelease or StaticRelease for either Win32 or x64.
After that, run Build > Build solution to compile everything.
Setup project to use compiled libraries
After you created your project, go to the project's properties:
C++ > General > Additional Include Directories should point to the include path of the repository. If you want to use C++ style some additional files have to be placed in this directory. Alternatively you can take a look at https://github.com/zeromq/zmqpp.
Linker > General > Additional Library Directories should point to the built libraries. They should be located at ...\libzmq\bin\x64\Release\v140\dynamic\.
Linker > Input > Additional Dependencies should contain the name of the library you want to use. The default should be libzmq.lib, otherwise you will find the name in the bin directory.
The program depends on the libzmq.dll file you just built. This file has to be placed within your project's build directory. To achieve this, you can add the following command to Build Events > Post-Build Event > Command Line:
copy /Y "...\libzmq\bin\x64\Release\v140\dynamic\libzmq.dll" "$(OutDir)"
This will copy the .dll file to the destination directory on every build if it's missing.
Hope this helps =)

MySQL Connector C++ 64bit build from source in Visual Studio 2012

I am trying to build the mySQL Connector C++ from source in Visual Studio 2012 for the 64-bit architecture.
I understand that it depends on some boost header files and the C connector.
Running CMake produces a project file, but that project file doesn't compile because of a big list of very confusing errors which probably have to do something with the include files, and an even bigger list of warnings. The official site is of little help.
Could some one please list all the steps in successfully compiling the C++ Connector?
In order to build it you need to have the following:
You need to have installed either the MySQL server or the MySQL C Connector.
Have installed the Boost C++ libraries or have the source files for it. Please note that there is not need to build boost as you only need the header files.
Have CMake installed. When installing CMake it will ask you if you want it included in the PATH variable, you should select yes to make it easier later to use it.
Once you have all three available, open VS2012 x64 Native Tools Command Prompt and from the source root directory of the MySQL C++ Connector you need to issue the following:
set MYSQL_DIR=c:\PROGRA~1\MySQL\MYSQLC~1.1
cmake -G "Visual Studio 11 Win64" ^
-DBOOST_ROOT:STRING=C:\Users\user\DOWNLO~1\BOOST_~1\BOOST_~1 ^
-DMYSQL_LIB_DIR:STRING=c:\PROGRA~1\MySQL\MYSQLC~1.1\LIB
devenv.com MySQLCPPCONN.sln /build Release
The first command defines the MYSQL_DIR variable that points to the installation of the MySQL server or the MySQL C Connector.
The second command call cmake to prepare a VS project that will be 64bit. There seems to be a problem with the MYSQL_LIB_DIR variable and it does not get generated, so we need to define it manually. MYSQL_LIB_DIR has the value of MYSQL_DIR ending with a \LIB.
Third command is optional, it will build the project from command prompt without opening VS.
It is recommended that you use the DOS paths for the variables.
To do that, navigate to the directory you want to convert to DOS path and call for %I in (.) do echo %~sI. It will give you the converted path.
It's really tough task and I've spent lot of hours figuring this out.
There are two issues here:
C++ Connector and MySQL libraries they have provided have been generated with Visual Studio 2010. Hence we can not use them as it is under VS2012 (It gives version mismatch error)
They also have not specified exact compiler options under which they have compiled these libraries. If our compiler settings are different, we'll end up in lots and lots of (especially linker related) errors.
Considering these facts, the only way is to build ourselves these libraries. Building MySQL is quick but building connector is little complicated.
Here are steps I am sharing. In my case I wanted to link these libraries statically with my project so I built these libraries accordingly. You may want to make relevant changes wherever necessary as per your need.
Before continuing with these steps, please download and install CMake on your system.
Steps to build MySQL server:
Download MySQL source. Extract them. Go in extracted folder in command prompt.
Create BLD forder
Go in BLD folder through command prompt
Run
cmake .. -G "Visual Studio 11 2012 Win64"
It will create MySQL.sln
Open MySQL.sln in Visual Studio and build only 'mysqlclient' library (as only this would be needing by application)
This will build libraries in mysql-5.6.24\BLD\libmysql\< Configuration > folder which we link in our project.
Steps to build C++ connector:
Download mysql-connector-c++ source. Extract it. Go in extracted folder in command prompt.
Create BLD forder
Go in BLD folder through command prompt
Run this command (Make sure we've built MySQL server before this, in Release and Debug mode. Also make sure we've downloaded Boost sources)
cmake .. -DMYSQL_INCLUDE_DIR="..\..\mysql-5.6.24\include" -DMYSQL_LIB_DIR:STRING="..\mysql-5.6.24\BLD\libmysql\Release" -DBOOST_ROOT:STRING="..\Boost\boost_1_54_0" -DMYSQL_CLIENT_STATIC_LINKING=1 -G "Visual Studio 11 2012 Win64"
It will create MYSQLCPPCONN.sln
Open MYSQLCPPCONN.sln in Visual Studio and make changes to 'mysqlcppconn-static' project:
A. Under C/C++ -> General -> Additional Include Directories put this (for All Configurations)
nativeapi;..\;..\..\;..\cppconn;..\..\cppconn;..\..\..\mysql-5.6.24\include;..\..\..\mysql-5.6.24\BLD\include;..\..\..\Boost\boost_1_54_0
B. In Code Genaration, change Runtime Library to Multithreaded (Debug or non-Debug depends on configuration) and NOT DLL
C. Under Librarian -> All Options keep "Additional Options" and "Ignore Specific Default Libraries" to blank (for All Configurations)
D. Under Librarian -> General keep "Ignore Specific Default Libraries" to blank (for All Configurations)
Build only 'mysqlcppconn-static' library project (as only this would be needing by application to connect to MySQL server)
This would generate library in mysql-connector-c++-1.1.5\BLD\driver\< Configuration > folder which we link in our project.

Visual Studio - find out why Visual Studio tries to link to class X? [duplicate]

This is what I have done:
Download the 1.54 zip file from the boost website
Extracted/copied it to C:\Program Files (x86)\Boost
Inside Visual Studio I have set the include libraries to: C:\Program Files (x86)\Boost\boost_1_54_0\boost_1_54_0\
(This seems to work fine for getting the compiler to accept the libraries)
Now the bit i'm having problems with- linker:
Inside Visual Studio I have set the linker include directories to: C:\Program Files (x86)\Boost\boost_1_54_0\boost_1_54_0\libs\
When I compile my project I get:
fatal error LNK1104: cannot open file 'libboost_date_time-iw-mt-sgd-1_54.lib'
EDIT Have built the boost binaries using the answer below. However I now have these files:
libboost_date_time-vc110-1_54.lib
libboost_date_time-vc110-gd-1_54.lib
libboost_date_time-vc110-mt-1_54.lib
libboost_date_time-vc110-mt-gd-1_54.lib
libboost_date_time-vc110-mt-s-1_54.lib
libboost_date_time-vc110-mt-sgd-1_54.lib
libboost_date_time-vc110-s-1_54.lib
libboost_date_time-vc110-sgd-1_54.lib
but still no
'libboost_date_time-iw-mt-sgd-1_54.lib'
EDIT: Think I have found the problem:
http://lists.boost.org/Archives/boost/2004/08/70114.php
OK, here's the problem: originally we had one Intel toolset:
"intel-win32" which created the library suffix "iw" (note no version
number!), and this is what the auto-link header currently searches
for.
However people have started adding versioned Intel toolsets, which
means that we now produce an ad-hoc mixture of library names, some
with compiler-version suffixes and some without, the autolink code
could handle either form, but as it's not psychic it can't handle
both :-(
Solution is to #define BOOST_ALL_NO_LIB
On a 64bit system you should build boost in Program Files, not Program Files(x86) the boost automatic library include does not handle the redirection correctly. Alternatively you can manually manage the library inclusion... but I would highly recommend against it.
Also a reminder that you need to build boost in all the flavors and bitnesses you are going to use. See How to use Boost in Visual Studio 2010 for a good example of how to do so.
In an administrator visual studio command prompt go to the boost directory
run bootstrap.bat
run b2 --toolset=msvc-10.0 --build-type=complete architecture=x86 address-model=64
wait for b2 to finish building
EDIT:
As it turns out the iw in that library refers to the intel compiler... to use that with boost and visual studio you'll need to follow the directions from Intel.