Blepo Download

Contents: Downloading the library -- Setting up your system -- Getting started with Visual Studio 2008/2010 -- Getting started with Visual C++ 6.0

Downloading the library

Latest Blepo version available for download:

Previous versions

Setting up your system

Once you have downloaded the code and unzipped it, you will need to do the following to set up your system.

  1. The DLLs in the external/bin directory must be in your path.
  2. The NASM assembler, which is used to compile the assembly code, must be in your executable path. The name of this file is nasm.exe and it resides in the external/bin directory. On some systems you will not need to perform any additional step, since modifying your Path environment variable enables the compiler to find it. Oftentimes, however, the compiler does not think to look in the executable path for this executable (for some inexplicable reason), in which case you will have to copy the nasm.exe file to an existing directory in your path, such as C:/Windows/System32 (32-bit machine) and/or C:/Windows/SysWOW64 (64-bit machine).

In addition, if you wish to capture images from a camera (e.g., USB webcam, Data Translation DT3120, or IEEE 1394), you will need to install the appropriate driver(s). For IEEE1394, you need to set it to use the CMU driver by following the instructions in Capture/CaptureIEEE1394.h. If you have any trouble, see the help in blepo/external/doc/IEEE1394. After installing the driver, you may test your camera using Blepo code or the CMU test application in blepo/external/bin/1394CameraDemo.exe

Getting started with Visual Studio 2008/2010

Once you have performed these steps, open demo/Demo.sln in Visual Studio, compile the code, and run. This solution is a good starting point for learning how to build an executable using the library.

To create a new project to use Blepo,

  1. Create a project with File -> New -> Project. Enter the name of the project, then
  2. Make the project use the Blepo library.
  3. Change the project properties
    (Be sure that you are changing the properties of your project, not of Blepo:  look in the title bar of the Property Pages dialog)
    (Also, be sure that your changes affect both Debug and Release modes:  To do this, Configuration -> All Configurations):
  4. Include the Blepo header file (#include "blepo.h"). For the compiler to find this file, you will need to do one of the following:
  5. Now build the project and run.

Some common errors in VS2008/2010:

  1. Errors with project:
    1. 'nasmw.exe' is not recognized as an internal or external command, operable program or batch file.
      • Did you remember to copy nasmw.exe to c:/windows/system32 and/or c:/windows/SysWOW64? Of course, it should also work if you add c:/blepo/external/bin to your path (Be sure to restart Visual Studio), but sometimes this does not work for some unknown reason.
    2. error LNK2005: _sprintf already defined in msvcrtd.lib(MSVCR90D.dll)
      • You forgot to tell Visual Studio to ignore LIBCMT.lib
    3. Blepo.lib(jpegtran.obj) : error LNK2019: unresolved external symbol _jtransform_execute_transformation referenced in function _main
      Blepo.lib(jpegtran.obj) : error LNK2019: unresolved external symbol _jcopy_markers_execute referenced in function _main
      Blepo.lib(jpegtran.obj) : error LNK2019: unresolved external symbol _jtransform_adjust_parameters referenced in function _main
      Blepo.lib(jpegtran.obj) : error LNK2019: unresolved external symbol _jtransform_request_workspace referenced in function _main
      Blepo.lib(jpegtran.obj) : error LNK2019: unresolved external symbol _jcopy_markers_setup referenced in function _main
      Blepo.lib(jpegtran.obj) : error LNK2019: unresolved external symbol _write_stdout referenced in function _main
      Blepo.lib(jpegtran.obj) : error LNK2019: unresolved external symbol _read_stdin referenced in function _main
      Blepo.lib(jpegtran.obj) : error LNK2019: unresolved external symbol _read_scan_script referenced in function _parse_switches
      Blepo.lib(jpegtran.obj) : error LNK2019: unresolved external symbol _keymatch referenced in function _parse_switches
      • You forgot to tell Visual Studio to ignore LIBCMT.lib
    4. error C2664: 'void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)'
      • You forgot to set the project to "Use Multi-Byte Character Set"
    5. LINK : fatal error LNK1000: Internal error during IncrBuildImage
      • This also seems to be cause by forgetting to use multi-byte character set.
    6. mt.exe : general error c101008a: Failed to save the updated manifest to the file ".\Debug\Foo1.exe.embed.manifest". The parameter is incorrect.
      • The cause of this error is unknown; try Rebuild All.
    7. LINK : fatal error LNK1000: Internal error during IncrBuildImage
      • This is caused by a bug in the VS2008 linker. Either of these two solutions should work:
        1. disable incremental linking: Project -> Properties -> Configuration properties -> Linker -> General -> Enable incremental linking -> No.
        2. install VS2008 Service Pack 1
    8. nasm: error: more than one input file specified
      • Your Blepo path has a space in it (e.g., "My Documents").  This should be fixed now (as of version 0.6.8).
    9. afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
      • Did you forget to check 'MFC' when you created your project?  To fix this, you should either
        • start over (create a new project, but this time be sure to check 'MFC'), or
        • do the following:
          • In Project.Properties (be sure to select All Configurations), go to Configuration Properties.General, and change to 'Using MFC in a shared DLL'
          • Copy the stdafx.h from blepo's Demo directory to your project's directory.  Your stdafx.h might look something like this:  #include "targetver.h" whereas it should look more like this:  #include <afxwin.h> , among other lines.
    10. IntelliSense:  #error directive:  Please use the /MD switch for _AFXDLL builds (saw this on Windows 7 64-bit VS2010, but not sure what caused it)
      • In Project.Properties (select Debug), go to Configuration Properties.C/C++.Command Line, and under 'Additional options' type "/MDd" (without the quotes).  Now select Release, and under 'Additional options' type "/MD" (without the quotes).   This should fix the problem.  If you look under Configuration Properties.C/C++.Code Generation.Runtime Library, you should see 'Multi-threaded DLL (/MD)', but for some mysterious reason this flag does not show up in the Command Line.
    11. c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxv_w32.h(16): fatal error C1189: #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h>
      • Your stdafx.h was probably created without MFC.  You will need to start over or fix your stdafx.h (see previous).
    12. error LNK2001: unresolved external symbol "public: virtual __thiscall blepo::Figure::~Figure(void)"
      error LNK2001: unresolved external symbol "public: __thiscall blepo::Figure::Figure(char const *,int,int,bool,bool)"
      fatal error LNK1120: 2 unresolved externals
      • You are not linking with Blepo. Perhaps in VS2010 you made your project dependent on Blepo but forgot to add Blepo as a reference.  Another possibility is that the blepo directory that you added to your PATH environment variable has spaces in it, but you did not enclose it in double quotes.
    13. atlsd.lib(atltypes.obj) : error LNK2005: "public: __thiscall CPoint::CPoint(void)" (??0CPoint@@QAE@XZ) already defined
      • This error occurs when the project contains a reference to blepo at an old location, that is, when you have moved blepo on your hard drive so that the project can no longer find it. You should delete the obsolete reference to blepo, then add a new reference to blepo using the new location. If this does not work, then you will need to open the project file (with extension .vcxproj) in a text editor and manually delete the line containing the reference to the old blepo location. Then save this file, reload the project, and add the reference to blepo at the new location in the usual manner.
    14. more than one input file specified
      • After version 0.6.8, this problem should not occur. The Blepo.vcxproj file should have quotes around the input filename, e.g., "%(FullPath)". However, in one case, using VS2010 on Windows 7, the Blepo.vcxproj file the quotes had been removed somehow.
    15. When you compile your project and try to run it, you get a warning message saying the project is out of date, do you want to rebuild.  The cause of this is that some files in your project may not exist in the file system.  With Blepo 0.6.8, for example, the file Image/Algorithms/opencv/cv.h points to a non-existent file; and in Blepo's Demo project, the file DirectShowForDummies.h points to a non-existent file.  Of course, both of these files exist in a different place, but if you delete these bad pointers from the corresponding projects, the warning should go away.
       
  2. Errors with Blepo (should not occur unless you have made changes to the Blepo project):
    1. "Unable to load Haar classifier cascade" from FaceDetector.cpp
      • Solution: Right click Blepo, then Properties -> Configuration Properties -> C/C++-> Command Line, Add /FC. (This causes __FILE__ to store the absolute path of the filename.)
    2. WINVER not defined. Defaulting to 0x0600 (Windows Vista)
      • Solution: Right click Blepo, then Properties -> Configuration Properties -> C/C++-> Preprocessor ->
        Preprocessor definitions
        .  Add _WIN32_WINNT=0x500;
    3. warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead.
      • Solution: Right click Blepo, then Properties -> Configuration Properties -> C/C++-> Preprocessor ->
        Preprocessor definitions
        .  Add _CRT_SECURE_NO_WARNINGS
    4. cv.lib(cv100.dll) : warning LNK4006: __NULL_IMPORT_DESCRIPTOR already defined in 1394camera.lib(1394camera.dll); second definition ignored
      cv.lib(cv100.dll) : warning LNK4221: no public symbols found; archive member will be inaccessible
      ...
      • Solution: Right click Blepo, then Properties -> Configuration Properties -> Librarian ->
        Command line -> Additional options.
          Add /ignore:4006,4221
    5. c:\program files\microsoft visual studio9.0\vc\atlmfc\include\afxv_w32.h(169) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
      • This error means the Windows SDK has not been installed properly. This error occurred on an IBM Thinkpad with WinXP. The solution was to run the installer again, check/uncheck any arbitrary feature, then click update. This forces the installer to notice that the SDK is missing and therefore install it. (Note: The Windows SDK is in c:\program files\microsoft sdks\windows\v6.0a)
    6. c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h(237) : error C2146: syntax error : missing ';' before identifier 'PVOID64'
      c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h(237) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h(7819) : error C2146: syntax error : missing ';' before identifier 'Buffer'
      c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h(7819) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h(7819) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
      • This problem occurred once on a 32-bit XP machine (same error was reported on a 64-bit machine).  The cause of the error is not known, but the workaround was to manually insert the line
                #define POINTER_64 __ptr64
        in c:\program files\microsoft sdks\windows\v6.0a\include\winnt.h just before line 237:
                typedef void * POINTER_64 PVOID64;
      • This problem may no longer occur in Blepo 0.6.9 or above, since this line has now been inserted into external\Microsoft\DirectX\DXSDK\Include\basetsd.h.

Getting started with Visual C++ 6.0

Once you have performed the steps in "Setting up your system" above, you should be able to open Demo/Demo.dsw in Visual C++ 6.0, compile the code, and run. This workspace will be a good starting point for learning how to build an executable using the library.  However, you may first have to add the gsl (GNU scientific library) path to your include directory:

In addition,

To create a new project to use Blepo,

  1. Create a project with File -> New -> Project
  2. Make the project use the Blepo library.
  3. Include the Blepo header file (#include "blepo.h"). For the compiler to find this file, you will need to do one of the following:
  4. Since OpenCV (as of version 2.0) is no longer compatible with VS6.0, you will have to tell Blepo to use the old version of OpenCV.  Either
  5. Now build the project and run.

Some common errors in VS6.0:

  1. Errors with project:
    1. 'nasmw.exe' is not recognized as an internal or external command, operable program or batch file.
      • Did you remember to copy nasmw.exe to c:/windows/system32? Of course, it should also work if you add c:/blepo/external/bin to your path (Be sure to restart Visual Studio), but sometimes this does not work for some unknown reason.
      • Are you using multiple partitions? Visual Studio has been known to be unable to find nasmw even when it is in the c:/windows/system32 directory. The cause appears to be that the project files were on a different partition from the C: drive. A workaround is to compile all the .asm files by hand, outside Visual Studio. A batch script to make this easy can be found in the Quick directory.
    2. c:\stb\cvs-local\research\code\vc6\alpha1\external\opencv-2\cxoperations.hpp(190) : error C2556: 'int __cdecl cv::saturate_cast(float)' : overloaded function differs only by return type from 'unsigned short __cdecl cv::saturate_cast(float)'
      • This only occurs if you are using Visual C++ 6.0. The problem is that you are using OpenCV 2.1, which is incompatible with VC6.0. Solution:
        1. Select Project.Settings. Select your project (not Blepo), and select 'All configurations'.
        2. Then go to the C/C++ tab and select Preprocessor. Under Preprocessor definitions, append to the end a comma followed by BLEPO_I_AM_USING_VISUAL_CPP_60__
    3. fatal error C1083: Cannot open precompiled header file:
      • Do Rebuild All. As long as you have stdafx.h in your program, it should compile. However, it is recommended that you turn off precompiled headers: Project.Settings.All Configurations.C/C++.Precompiled Headers.Not using precompiled headers.
    4. LINK : fatal error LNK1104: cannot open file
      • Usually this occurs because your program is still executing, and therefore Visual Studio cannot write to the .exe file. Stop execution and try again.
      • On Windows 7, this strange behavior has been observed: The new program is stored in C:\Program Files (x86)\Microsoft Visual Studio\, but the subdirectory with the project name does not exist. What VS thinks it exists is a mystery. Solution: Save your project somewhere else.

Enjoy!