I am trying to compile the code originally written in Visual studio 6 to VS 10.
I read in one of the MSDN article that 'atlmfc' has been removed from VS10. what is the alternative for atlmfc in VS10 ?
error is pointing to atlchecked.h file.
error C2664: 'AfxCrtErrorCheck' : cannot convert parameter 1 from 'char *' to 'errno_t'
1> There is no context in which this conversion is possible
.
.
program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlcomcli.h(2235): error C2065: 'cVal' : undeclared identifier
These errors are in all the header files like atlcomcli.h, oaidl.h.
part 1) I guess that whatever is included in #ifdef has not been recognized in VS10, I might need to give correct path or include relevant header file. Surprisingly no solution on the net so far. If I compare with other solution it doesnt seem to be a problem since path is correct. I am picking all the atlmfc files from visual studio 10 version.
part 2) as Scott said code change is required but here the problem it points to is
#ifdef _AFX
#define ATLMFC_CRT_ERRORCHECK(expr) AFX_CRT_ERRORCHECK(expr)
#else
#define ATLMFC_CRT_ERRORCHECK(expr) ATL_CRT_ERRORCHECK(expr)
#endif
One of the article on the net says - http://msdn.microsoft.com/en-us/library/bb531344.aspx
"#ifdefs in the MFC header files are removed." What does that mean ? if that is removed any alternative for that in Visual studio 10 ?
Also can i directly convert VS6 code to VS10 or should i convert it to VS8 first and then migrate it to VS10 ? Pls help.
'atlmfc' is a folder name in the VC directory. It has not been removed in the versions of VC that cost money but it is removed in the "express" version, which is free. You must have a paid-for version of VC to use the MFC and ATL libraries.
I think VS10 will open and convert your VS6 project, although the result will still require you to make code changes.
Well, direct conversion from visual studio 6 to VS10 is not possible. Why will microsoft allow that ? :)
we have to go through VS5 and then VS10.
also the conversion is gonna be extraordinarily difficult with lot of code changes.
http://www.devx.com/cplus/10MinuteSolution/28908
Related
I am attempting to compile a .cpp file on Visual Studio 2019 Preview 1 and the file windows.h is not present on the system. What do I have to do to make this file available to Visual Studio? The file being compiled contains include <windows.h>.
windows.h usually comes from Windows SDK installation. Like you discovered, some projects might even require a certain version of Windows SDK. Therefore, when such compilation errors happen, the first thing to do is to read carefully the source code documentation, which might indicate what is needed to install in advance.
Visual Studio 2017/2019 become more modular than previous releases, so missing a component is expected, and you can always go back to VS installer to find the suitable components to install.
My C++/MFC code compiles fine with VS 2013 but when I have compiled with VS 2015 I get this error:
C:\VS\VC\atlmfc\include\atlwinverapi.h(710):
error C3861: 'LCMapStringEx': identifier not found
I don't use LCMapString anywhere in my code, so I don't know where this come from?
I had the same problem. For me the cause was this: Part of the project had _WIN32_WINNT set in such a way that XP was supported, other files didn't have this define. So the MFC headers were included with different values for the supported platform leading to this strange error.
The definition is guarded for the minimum target windows version.
This guard uses one of your definitions or NTDDI_VERSION (which is created from the other definition within (sdkddkver.h).
Correcting the version details of _WIN32_WINNT, WINVER solved the issue.
Go to:
Properties->Configuration properties->C/C++->Preprocessor->Preprocessor
Definitions and check what macros are defined.
changing them to
NTDDI_VERSION= 0x06030000
WINVER=0x0A00
_WIN32_WINNT=0x0A00
solved my problem.
Here 0A00 is for windows10.Refer below link
https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx
In StdAfx.h define the following macros:
//For Windows 10
NTDDI_VERSION 0x0A000000
#define WINVER 0x0A00
#define _WIN32_IE 0x0A00
Also refer below MSDN links for WINVER & NTDDI_VERSION according to your environment.
https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=vs-2019
https://learn.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers
I Solved the problem. I had to manually delete all the obj files generated by the previous compiler, as the clean and rebuild option in VS 2015 seems that did not remove them correctly.
Correcting the version details of _WIN32_WINNT, _WIN32_WINNT solved the issue.
you can see the similar thread here.
Compile Errors upgrading ATL project from vs2010 to vs2013
(WINVER or _WIN32_WINNT)
I faced similar issue when I migrated project from Visual Studio 2005 to Visual Studio 2015.
Open the Vcxproj in notepad or any of your favorite editors and then search for <PreprocessorDefinitions> tag in my case I removed the WINVER=0x0501, when I removed it started working.
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.
I have been trying to run OpenCV through MVS 2012 with no succeess.
Here is an error i get:
1>LINK : fatal error LNK1104: cannot open file 'opencv_core242d.lib' 1> 1>Build FAILED.
Could someone provide me a tutorial? or how can i solve this problem?
I've written a blog post on Using OpenCV 2.4.2 with Visual Studio 2012 on Windows 7 (64-bit). With the step by step instructions provided, I think it should be pretty easy for you to get it done. Feel free to comment if you have any doubts.
Since OpenCV 2.4 does not work well with Visual Studio 2012. I think that's why you always got problems. Actually, it used me a lot of time to make all things work. So I wrote a very simple tutorial about how to use OpenCV 2.43 in Visual Studio 2012. Please check it. Good luck. If you still have questions, ask me again.
http://answers.opencv.org/question/6495/visual-studio-2012-and-rtlfreeheap-error/#6603
Some basic steps...
use cmake to create the .sln or the solution file ...make sure you choose right the compiler in cmake properly...use the address of the cmake file (CMakelist.txt) in the folder containing opencv files..
click on the .sln file (this will be found in the target folder whose path you have set in cmake to contain the build..) and open with VS2012
VS2012 will build your libraries and dlls...add the path of the dlls to the system variable PATH...put the path of the libs in the IDE..and the include files also..
restart VS2012 to make the changes in PATH variable to reflect
You have 2 options - one is to use the precompiled libraries and link them into your VS2012 projects.
The other is to use CMake to make the the right .SLN and .PRJX files so you can simply open them .SLN in VS2012 and compile everything for yourself.
Both have been discussed here, however, to add to the first option, you need to manually edit the top level CMAKElist.txt file with the following lines
if( MSVC ) # VS2012 doesn't support correctly the tuples yet
add_definitions( /D _VARIADIC_MAX=10 )
endif()
Before generating your solution files. This ensures that you don't have problems with the VARIADIC length issue with :tuple - which Visual studio 2012 has issues with.
there may be 2 option to solve your error:
1) You may use opencv 2.4.2 that may have some problems to connect with visual studio 2012
so use newer version of opencv
2) You need to restart your visual studio 2012 so that it can reconfigure its Setting as per requirements.
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)