20908

MS Visual Studio 2012: build statically linked exe

I'm using visual studio 2012 and C++ and I'm tying to build a fully static executable of my program. It uses OpenCV 2.4.6 and I wish to be able to run it on a machine without any OpenCV (or even the standard c++ library) installed. I tried to follow every guide on the argument but i couldn't get around it, so here I am.

Thanks for any input!

Answer1:

dont have 2.4.6 but should be exactly the same

    <li>build opencv with BUILD_SHARED_LIBS off</li> <li>set vs2012->project properties->c/c++->code generation->runtime library->multi-threaded(/MT)</li> <li>set linker input to following </li> </ul>
        opencv_core245.lib
        opencv_contrib245.lib
        opencv_features2d245.lib
        opencv_objdetect245.lib
        opencv_nonfree245.lib
        opencv_highgui245.lib
        opencv_flann245.lib
        opencv_imgproc245.lib
        opencv_video245.lib
        opencv_legacy245.lib
        opencv_gpu245.lib
        opencv_ml245.lib
        IlmImf.lib
        libjasper.lib
        libpng.lib
        libtiff.lib
        libjpeg.lib
        zlib.lib
        Vfw32.Lib
        comctl32.lib
    </pre>
        

Recommend

  • Can't open HTTP stream: Error opening file (../cap_ffmpeg_impl.hpp:529)
  • How to apply a partial derivative Gaussian kernel to an image with OpenCV?
  • Graceful pod termination
  • Deduce parent class of inherited method in C++
  • Using android opencv apps without downloading opencv sdk manager
  • iOS Cordova first plugin - plugin.xml to inject a feature
  • C++ Single function pointer for all template instances
  • Can I have a variable number of URI parameters or key-value pairs in Laravel 4?
  • Does Apportable support to build library binary (.a/.so)?
  • Hide HTML elements without javascript, only CSS
  • Jenkins: FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection
  • gspread or such: help me get cell coordinates (not value)
  • How do I exclude a dependency in provided scope when running in Maven test scope?
  • Transactional Create with Validation in ServiceStack Redis Client
  • d3 v4 drag and drop with TypeScript
  • Test if a set exists before trying to drop it
  • Why does access(2) check for real and not effective UID?
  • Switching to Release Build causes runtime error in Web Reference
  • Django: Count of Group Elements
  • Q promise. Difference between .when and .then
  • If I include Java 8 in my Android app does that affect which devices it will work on?
  • When to use `image` and when to use `Matrix` in Emgu CV?
  • Java Scanner input dilemma. Automatically inputs without allowing user to type
  • Illegal mix of collations for operation for date/time comparison
  • what is the difference between the asp.net mvc application and asp.net web application
  • QuartzCore.framework for Mono Develop
  • R: gsub and capture
  • Confusion with PayPal's monthly billing cycle
  • VB.net deserialize, JSON Conversion from type 'Dictionary(Of String,Object)' to type '
  • Transpose CSV data with awk (pivot transformation)
  • Use group_by to filter specific cases while keeping NAs
  • Matrix multiplication with MKL
  • log4net write single file for each call to log.info
  • Benchmarking RAM performance - UWP and C#
  • Acquiring multiple attributes from .xml file in c#
  • C# - Getting references of reference
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • Binding checkboxes to object values in AngularJs
  • java string with new operator and a literal