How to add header file of MITK in my CPP program of VS 2010? - visual-studio-2010

I have compiled and build using CMAke and VS 2010. But now I want to try some basic program using MITk library, but I can't find where is the header file, DLL, Lib file? Same as like in OpenCv when we compile and build it, then in install folder we have bin folder that contain DLL file, Lib folder contain lib file and include folder contain header file of CPP program.
So, where is the header file of MITK build library ?
If anybody have idea then suggest to me.

It seems you want to use MITK as a toolkit. As the documentation suggests, you can (must?) use cmake. The generated VS2010 .sln file will handle all the include and library files for you. Use the .bat file if there's one.
There's probably a way to use it without cmake, but I'm pretty sure it's a bad idea.

Related

Compiling C++ files during runtime using Visual Studio compiler

I'm trying figure out how to compile C++ code from an executable during runtime using Visual Studio compiler under Windows.
I'll be using Visual Studio IDE to build main project into an executable and use CreateProcess to compile other C++ files and create a DLL to later load/use/unload this DLL.
I understand that one way of doing this requires setting environment variables(mainly PATH, INCLUDE and LIB) and there's a .bat file called "vcvarsall.bat" which does this.
The part I'm stuck with is the argument(s) passed to this batch file. I see that first argument is the platform with some of the options being x86, amd64, arm, etc. But how do I programmatically figure out which one of these arguments I should be using considering main executable could've been built with any one of these?
You can prepare a regular solutionfor this purpose, containing one project with a single file, and use it to compile your file easily.
Now, all you need is to reame your file to the file name in the project and compile a solution with command line. Alternatively, you can also edit the project and replace the existing filename with your file name.
To do so you need to resolve the environment variable %DevEnvDir% and run the folowing command with the platform name (x64, win32 etc.) and configuration name(Release or Debug)
like this:
%DevEnvDir%\devenv.com \path\to\yoursolution.sln /ReBuild "Release|x64"

OpenCV 3.0 missing Libraries

I am trying to install OpenCV 3.0 Aplha. I'm following these instructions
http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html
After I download and extract the package, I am supposed to have all the pre-built libraries in the folder :opencv\build\x86\vc12\lib but I don't see them in this folder. This folder only has opencv_ts300.lib and opencv_world300.lib. All the other libraries seems to be missing. Also the bin folder doesn't have the dlls. But statlib folder does seems to have all the static libraries.
I also tried to build the libraries from source, and as per the instructions after building the OpeCVALL.sln in visual studio, I am supposed to have the libraries in the x86\vc12 but the libraries doesn't seem to be building in this folder. After digging through the folders I see that the opencv libraries are found in bin/debug and bin/release folders. I thought I would use these for linking in visual studio but I am not finding the header files in build/include folder
I don't see any of these issues with Opencv 2.49. Any help in debugging this issue with 3.0 would be highly appreciated.
Summary: After I build from source/ or pre-built package, I am able to run the sample applications. But I am not finding the headers and libraries to create a visual studio project from scratch.
Okay I figured out what is going wrong here...
Build INSTALL project manually from the OpenCV.sln by right clicking - > build. This will create the libraries in build/install/x86/vc12 folder. This is where lib,bin and staticlib folders are now residing. Also the include files are in build/install/include.
Library files : located in your cmake folder's lib/debug(or release) folder
DLL files : located in cmake folder's bin/debug(or release) folder
Header files : located in opencv3's build/include folder

Visual Studio 2010 can't see /bin library of OpenCV

I'm trying to use OpenCv 2.2 in Visual Studio 2010.
I've configured everything by instruction:
http://opencv.willowgarage.com/wiki/VisualC%2B%2B
and by instruction from the book:
So I've added all /lib and /include paths.
When I build project, it compiles and before starting app, VS displays an error message that opencv_core220d.dll is missing.
This file is in C:/OpenCV2.2/bin as all .dll files. If I add this file to my working directory - it will be fine. Then VS displays error about every .dll file that I added in Linker-Input configuration ( but with .lib extension ).
So, if I add all .dlls file that I've added as .lib in Linker configuration - to my working directory, project will start.
But why? Why VC doesn't see OpenCV2.2/bin folder? Where is this pointed?
Because it doesn't know to look there by default. However, it does know to check the current directory for the DLLs.
You can tell it where to look by adding C:/OpenCV2.2/bin to your Path variable, or if you would rather not muck up your global Path you can set the Environment variable local to the C++ project.
I think that is the syntax for appending to the Path in VS2010, but I'm not sure, so Google it if that doesn't work :)

How do I use libcurl in Visual C++ 2010?

Hey guys, I was wondering if you would be able to help me use libcurl within Visual Studio to resolve the errors in the image below:
It looks like you need to update Visual Studio's configuration to include the directories where you've installed cURL. VS has directories for both Include files and libraries -- if memory serves, you'll have to add both.
I too ran into same issue. The problem is, i was pointing in additinal lib dirs to lib/LIB-Debug instead lib/DLL-Debug. Also the lib to add is libcurld_imp.lib and not libcurld.lib. Also you need to copy libcurld.dll into executable file location. I see that there are lib/LIB-Debug dir and lib file but dont know what they are for. You have to do use DLL-Release, libcurl_imp.lib etc for release mode.

Compiling OpenCV

I opened up the solution file in the [InstallDir]\_make\opencv.vs2005 and modified one of the .cpp files in the highgui library.
While compiling, Visual Studio throws the error -
Unable to start progam
C:/Users/../AppData/Local/Temp/opencv.build/cv_Debug.Win32/cv.dll
The system cannot find the file specified.
I think I am missing something in it. What is the stepped procedure to change and recompile OpenCV library using Visual Studio.
I would appreciate any help!
Thank You..
Unless you downloaded the visual-studio specific version of the open cv distribution files, you need to follow the instructions on the OpenCV wiki, that is
download cmake
have cmake generate makefiles/solutions
build using the generated files
I guess you want to customize a function. You can do this, without recompiling OpenCV from scratch. You can simply copy the .cpp source file locally in your current working directory, and add it(click n drag or add existing file) in the "Source Files" in your project. You might need to copy some other headers as well. You will find everything in the opencv archive. (opencv/modules/highgui/src)

Resources