testing a boost example - boost

This is my first test using Boost (1.5.3). I made an example with FileSystem class.
I think I've installed successfully the binary distribution, i.e., run bootstrap.bat and b2.exe to create headers & libraries in the installed folder.
if I'm correct, there is no dll lib, just static libraries & header files which I've pointed to in VS2008 project configuration.
I go compile and got this:
Error 1 fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-gd-1_53.obj' test_filesystem test_filesystem
what type of error is this? I think the compiler already sees the required files & libs
Thanks
Edit 01:
I originally added the wrong lib name (lack of ".lib"), I've correted it but now it gets
"Error 15 fatal error LNK1104: cannot open file 'libboost_filesystem-vc90-mt-gd-1_53.lib' test_filesystem test_filesystem"
Do I put the library name correctly? -> libboost_filesystem-vc90-mt-gd-1_53.lib? I normally put library name like this, and I'm sure I've added the right path to this static lib

Ok,
I've now solved the problem. Partly, it is from the hint "boost links itself"
I installed boost 1.5.3 which includes all "libxx-vc100-xx-1_53.lib" and these libs are intended to use for VS2010 (vc10) compiler.
I didn't notice this and compiled my example in VS2008 (vc9) and boost/compiler something links automatically to vc9 libraries which are not available.
=> I solved it by compiling the same project in VS2010 and finally DONE

Related

missing payoffs.hpp and other .hpp from version

When building the Windows C++ version of quantlib 1.9.1, I get this error of missing payoffs.hpp. When I browse to the directories, I see payoffs.cpp, but not payoffs.hpp:
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'ql/instruments/payoffs.hpp': No such file or directory FittedBondCurve c:\users\administrator\google drive\quantlib-1.9.1\ql\cashflows\conundrumpricer.hpp 27
I also get this for #include <ql/instruments/swap.hpp> [and possibly others]. I am able to build the windows quantlib library ok. Just not the examples.
I just checked the QuantLib 1.9.1 release available from the project downloads (did you get your version from there?) and the files you're looking for are contained in the release zip and tarball. Also, it's pretty weird that you could compile the library without them, so I'd double check if they're there. If they really aren't—well, hard to know how they got displaced; anyway, you can download the release again and replace them. If that doesn't fix the problem (or if they're already there after all), it's possible that you have to fix the include path for the example you're trying to compile. Does it include the QuantLib directory?

Visual studio and dlib: "cannot open include file: 'zlib.h': No such file or directory"

For my thesis I want to use Dlib's face_landmark_detection, but I keep running into these errors (for both Visual studio 2013 as well as 2015):
"cannot open include file: 'zlib.h': No such file or directory"
and
"'F77_INT': undeclared identifier".
It repeats itself so I have 36 errors based on these two problems.
My supervisor has given me some steps to follow to set up the project:
add dlib-master and dlib-master\examples to VC++ directories -> include directories
add dlib-master\dlib\external\libjpeg and dlib-master\dlib\entropy_decoder to C/C++ -> General -> Additional include directories
add all folders and items from dlib-master\dlib\external (cblas, libjpeg, libpng and zlib) to the project source folder
add the dlib source file (from dlib-master\dlib\all) and add face_landmark_detection (from dlib-master\examples) to the project source folder.
and according to him this has worked on every other computer so far, but on my laptop it just won't. We checked to project, but zlib.h is in the zlib folder in the project. Does anyone here have an idea on what might be going wrong?
If I didn't give enough info, please ask. I don't know what else might be needed to solve this.
I have just come about this same problem and wanted to post my solution since I have found so much conflicting documentation on the subject.
The folder containing the dlib folder as well as the libpng, libjpeg, and zlib folders from dlib/external need to be added to the additional include directories list in the solution settings.
dlib/all/source.cpp as well as the source files for libpng, libjpeg, and zlib also need to be added to the project.
Note that CBLAS should not be added to the project in any way, because it needs Fortran to compile, and it is very difficult to get this to compile from Visual Studio.
Finally, make sure to add DLIB_PNG_SUPPORT and DLIB_JPEG_SUPPORT as preprocessor defines in the project settings.
I also attempted to use a cmake generated solution, however, for some reason it had trouble with png support.
It is probably easiest to use CMake to configure your project which uses dlib. It avoids setting all those paths manually. During CMake configure step you can disable usage of libraries like zlib which you don't have/want/need. Here is an example CMakeLists.txt which works for me:
cmake_minimum_required(VERSION 2.6)
PROJECT(DatasetClassifier CXX C)
set(dlib_DIR "" CACHE PATH "Path to dlib") # http://dlib.net/
include(${dlib_DIR}/dlib/cmake)
ADD_EXECUTABLE(DatasetClassifier DatasetClassifier.cpp)
TARGET_LINK_LIBRARIES(DatasetClassifier ${dlib_LIBRARIES})

Unusual VS2010 Link Error LNK1104: cannot open file 'libssh2d.lib'

I am trying to work with libssh2 libraries in VS2010. I am getting a weird error of LNK1104: cannot open file 'libssh2d.lib'. I have clearly included the libraries in the Project Properties->Linker->General->Additional Library Directories.
There are couple of other additional libraries with the one above, and they get included without an issue except this.
Also the Linker->Input->Additional Dependencies has that file name 'libssh2d.lib' specified in it.
Any inputs as to why am I still seeing that error? Thanks.
I just needed to add "libssh2d.lib":
Linker->Input->Additional Dependencies.
Also "Debug_lib" was added in:
Linker->General->Additional Library Directories
This resolved the issue.

error LNK1104: cannot open file 'libboost_serialization-vc110-mt-gd-1_53.lib'

I use Boost serialization to create a simple XML file, but when debug, I got this error
"error LNK1104: cannot open file 'libboost_serialization-vc110-mt-gd-1_53.lib'"
I have tried to fixed my problem followed the answer in this question
but I can't find the folder "stage" in my Boost folder, I downloaded Boost from here
You need to build the boost libraries first.
Open a console and go to the root folder of boost. Then type
bootstrap
and then type
b2 variant=debug,release link=static runtime-link=static
for building debug and release configuration for static linking. You can find more information in the Getting Started Guide
In my case, I'm using boost 1.55, in which serialization is a pure template module. There are only some hpp files in the module folder. However, I still get the same error.
My solution is to
#define BOOST_ALL_NO_LIB
in the code. Now everything goes fine.

OpenCV debugging/step into issue

I have the following issue in OpenCV: I have built the openCV libraries with CMake and compiled the OpenCV solution and the corresponding .pdb files were generated. I have a project that uses OpenCV library and I want to step into a function(cvStereoRectify) that crashes. I have included the symbols in my project (the folder were .pdb files are located) and when it hits the breakpoint at that function and I hit "Step Into" the error is generated and it doesn't go into the OpenCV source function. At runtime, the Modules window shows that opencv_calib3d.dll (and others opencv_*.dll) says that "Cannot find or open the PDB file".
Can someone show me the right way to do this ??
Thanks in advance,
Tamash
In order to step into openCV code you have to copy the pdb and the dll files to the location of your project.
in order to do so , go to your project properties , on the post build step type the lines:
copy "C:\OpenCV2.31\CMake_Build\bin\Debug\*.dll"
copy "C:\OpenCV2.31\CMake_Build\bin\Debug\*.pdb"
If that doesn't work , you'll have to include the *h and *cpp directories of the openCV library on your project setting:
On additional include directories type :
C:\OpenCV2.3\infustracture\Dienet;C:\OpenCV2.31\opencv\build\include;C:\OpenCV2.31\opencv\build\include\opencv;C:\OpenCV2.31\opencv\build\include\opencv2;%(AdditionalIncludeDirectories)
Good luck

Resources