intergrating qt4 ,vtk and visual studio2010 - visual-studio-2010

I have an integrated visual studio (2010) and Qt(4 visual studio addin) combination and just recently decided to add VTK5.I have managed to compile VTK as per the numerous instructions everywhere .However i tried to build a simple example from the VTK website but i get the Dll errors below.I have added include paths in visual studio but just can't compile .please direct me on what i should do next .
GeneratedFiles\Debug\moc_QVTKWidget.cpp(73): warning C4273: 'staticMetaObjectExtraData' : inconsistent dll linkage
E:/libs/vtk/vtk-5.10.1/VTK5.10.1/GUISupport/Qt/QVTKWidget.h(76) : see previous definition of 'private: static QMetaObjectExtraData const QVTKWidget::staticMetaObjectExtraData'
GeneratedFiles\Debug\moc_QVTKWidget.cpp(77): error C2491: 'QVTKWidget::staticMetaObject' : definition of dllimport static data member not allowed

I have been able to build a working environment following this guide, it is really helpful and well explained (and, as the more important thing, it uses VS2010, QT 4 and VTK 5): http://guitarcplusplus.blogspot.it/2013/02/itk-vtk-qt-on-window-7-64bit-and-visual.html.

Related

__int64' followed by 'int64' is illegal

i have very old project who has been made in visual studio 2008 with windows xp 32 bit.
I am trying to run this project in windows 7 64 bit with visual studio 2017.
i dont know much details about the project.
i know that MFC MBCS pakage was use.
so now i am trying to compile it and got some compilation errors.
the main one is :
__int64' followed by 'int64' is illegal
in the stdint.h file.
the line that get the error is:
typedef long long int64_d
i check the project and there is no call or use of the stdint header.
i read that it can be because the code build with old version of c++ and now i try to compile with higher version then c++11.
any help will be very appraised.
Thank You!
Well i figure it out.
the problem was that i am using old libs and dlls(probably made by v100 toolset of VS 2010) ,
so i set the platform toolset to the same version of the visual studio that make those
libs and dlls - visual studio 2010 v100.
to do that go to :
right click on the project
properties
configuration properties
general
platform toolset
and set it to v100(or other version needed)
now it's work fine!

How to link Static CUDA Runtime in VS2012?

I have been trying to use the static CUDA Runtime included in CUDA 5.5, but facing some problems.
Following are the results of linking cudart_static.lib in different IDEs:
Visual Studio 2012:
Linker fails with the following error:
error LNK2038: mismatch detected for '_MSC_VER': value '1600'
doesn't match value '1700' in kernel.cu.obj
Seems like the static CUDA runtime has been compiled using VS2010.
Visual Studio 2010:
No Error. Links successfully.
Visual Studio 2008:
Links successfully with the following series of warnings:
cudart_static.lib(cuda_*.obj) : warning LNK4229: invalid directive '/FAILIFMISMATCH:_MSC_VER=1600' encountered; ignored
Also, in all the IDEs, when running in DEBUG configuration the linking fails with following error:
error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value
'0' doesn't match value '2' in kernel.cu.obj
Questions:
How to link the static CUDA runtime in Visual Studio 2012?
How to link the same in DEBUG configuration?
Regarding your first question:
1.How to link the static CUDA runtime in Visual Studio 2012?
From the release notes:
"The new static version of the cudart library shipped with the CUDA 5.5 Release
Candidate (RC) on Windows will not work with Microsoft Visual Studio 2008 (VC9.0) nor with Microsoft Visual Studio 2012 (VC 11.0). Starting with CUDA 5.5, the nvcc compiler will link against the static version of the cudart library by default, so
in order for the CUDA 5.5 RC to correctly work with Microsoft Visual Studio 2008 or 2012, please use the --cudart=shared option to nvcc to force linkage against the shared version of the cudart library. If an application is not relying on the nvcc
capability to automatically link to the cudart library, and is instead explicitly linking against cudart.lib, then that application will continue to link correctly as well."
Usage of the static library on windows for VS2012 and/or VS2008 is therefore unsupported at this time.
Regarding your second question:
2.How to link the same in DEBUG configuration?
The issue with debug mode has to do with how the cudart static library was built. Normal practice would be to include two static libraries, one for debug mode and one for release mode. As a workaround, you can try something like this (in VS 2010):
Project Pages...Configuration Properties...C,C++...Preprocessor...Preprocessor Definitions
Add "_ITERATOR_DEBUG_LEVEL=0"
Your mileage may vary.

C4272 Error when using QT3D library in visual Studio

i am using microsoft visual studio 2010 for developing an application. Additionally I am using the QT3D library as an external library.
The QT 3D library is sucessfuly installed and integrated with visual studio. I know this because I can compile and run the examples.
but when I try to write my own code, the visual studio compiler gives me the following error
c4272 : 'function' : is marked __declspec(dllimport); must specify native calling convention when importing a function.
The error message is received a few hundred times, for each of the member functions which are present in the classes in the library header files.
I suspect, that problem has something to do with the linking of the libraries. In the Additional include files the Path is given as follows
"$(QTDIR)\include";"$(QTDIR)\include\Qt3D";"$(QTDIR)\include\QtGui";"$(QTDIR)\include\QtCore";".moc\debug_shared";$(QTDIR)\mkspecs\win32-msvc2010;%(AdditionalIncludeDirectories)
When I iclude the header files, the auto complete option can detect these libraries.
the additional library file paths are given as follows.
$(QTDIR)\lib;C:/qt/5.0.1-x64/qtbase/lib;%(AdditionalLibraryDirectories)
any ideas?
Best Regards
tdk.

Compiling CUDA with Visual Studio 2010

I have used Visual Studio 2008 to compile and run CUDA applications before. I have switched to Visual Studio 2010 and Windows 7. I've been trying to get integration set up all morning, but haven't had complete success. I've downloaded the toolkit, installed Nsight, made sure the libraries/include/bin paths are set, checked the box to use a Build Customization of CUDA 3.2, and set the properties of the individual .cu file to be of type CUDA C/C++ instead of C/C++. I got an error about not supporting compiler v100, so I set the project platform to v90 and am downloading Visual Studio 2008 now. I was hoping that I wouldn't have to have two versions of visual studio installed, but oh well. Anyway, most of the syntax highlighting is enabled, some keywords like "int" is blue, comments are green, and strings are red. However, cuda-specific keywords like __ global__ aren't. Also, I've checked through the include directories and can't find cutil.h, so I'm wondering if there's anything else that wasn't included in the install of the 3.2 SDK (I have included cuda_runtime.h instead, but I don't know if this will solve my problems). Does anyone know how to fix this?
Edit: I have Visual Studio 2008 installed. When I try to compile, I get a giant list of errors, starting with 1>C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h(490): error : invalid redeclaration of type name "size_t", while most of the following errors have to deal with the size_t type. All of the errors are in included files, most of which I've never seen. Does anyone know what's going on? Or if there's a simple, step-by-step guide to getting VS2010 to use cuda?
Edit 2: Apparently I had one of the many current settings as 64-bit, and the others as 32-bit. Changing the active configuration, Cuda C/C++ Target Machine Platform, and Linker|Advanced Target Machine all to 32-bit or 64-bit allowed me to compile and run. I still don't have any idea how to fix the __ global__ and such syntax highlighting, but it's not that big of an issue.
You'll find a complete guide here:
How to Run CUDA In Visual Studio 2010
you can check if the source file that contains kernel is a CUDA/C file rather than a C/C++ file. (Solution Explorer -> File Properties)

Build the OpenCV 2.0 libraries from source using Visual Studio 2010 Beta and CMake

OpenCV 2.0a does not include pre-compiled OpenCV libraries for Visual Studio users. I am trying to build the libraries from source using Visual Studio 2010 Beta and CMake, but I am getting lot of errors.
I even tried generating the libs from dlls using dumpbin but the linker errors are still persisting. Please guide me to generate the static libs for VS2010.
If the build error you're seeing is related to:
'back_inserter': identifier not found
as is likely the case for the source files cvmodelest.cpp and cvhog.cpp, add the following include statement to each of those source files:
#include <iterator>
For more info about the 'back_inserter': identifier not found error, see this blog post.
It's kind of late, but I created a video tutorial for compiling and configuring OpenCV 2.1 with Visual Studio 2010.
Try this tutorial(dead) and this one out as well.
I tried this with VS 2010 and Windows 7.
See another StackOverflow thread. It's for VC++ 2008, but it may help.

Resources