memory problems when migrating to Visual Studio 2017 from 2015 - c++

i have a relative big C++ project which i can compile in vs2015 with no problems at all,
when i tried to compiled it in vs2017 i get the problem:
fatal error C1060: compiler is out of heap space
when monitoring the cl.exe process it gets to 3.5G and then crush with this message,
the compiled application is x64 but the compiler is by default 32bit
after some googling i added this flag:
set PreferredToolArchitecture=x64
devenv.exe
and its used the 64bit compiler which works but suck all my memory (30G+) and make compilation super slow... :(
why its happening and what can i do ? in vs2015 exactly same project was compiling at no time and almost no memory consumption at all (relatively)
thanks for any help!
(P.S i tried the /zm200 /zm1000 /zm2000 flags, doesnt seems to change anything)

Related

Missing MSVCP100.dll even with Runtime Library set to /MT

I created a program using Visual Studio 2010 and it runs fine on my computer, but on another machine it gives this error:
Now, I've done my research and I came up with at least 20 identical answers that all say the same thing: Configure your Runtime Library to /MT (or /MTd for debug) and rebuild. Great, only problem is that I already did just that and it still doesn't work...
Now, the alternative would be to force the users to install the Microsoft VS 2010 C++ Redistributable Package, but I'd very much like to avoid that. So any explanation as to why my solution is not working? Something weird worth mentioning is that my executable size doesn't seem to change even when I rebuild it with /MT, which makes no sense. Also, I'm not using any CLR support.
Thanks for your help.

MSVCP110D.dll and Visual Studio 2013

I am trying to run a program I compiled in Visual Studio 2013. However, I get the error
The program can't start because MSVCP110D.dll is missing from
your computer. Try reinstalling the program to fix this problem.
This is not a very helpful error. However, after some Googling, I found that it is (apparently) trying to load a standard c++ library dynamically, and that to get around this I need to specify the /MT option rather than the /MD option. This leaves me with a number of questions:
What exactly is that doing?
What are the benefits of /MD as opposed to /MT? I mean, there must be a reason that it is the default options...
How would I go about getting the looked for .dll and getting Visual Studio to use it? I downloaded this, but honestly don't know exactly how to use it.
Most importantly, how to I get that error to go away and my program to run?
Some additional info: I am compiling in Release mode using an x64 build.
The problem is that you are mixing different versions of Visual Studio by using Qt that was compiled using a different compiler. Remember that each version of Visual Studio will have its own runtime/CRT. The Qt dlls that were compiled with Visual Studio 2012 and will be dependent on the Visual Studio 2012 runtime. They will not use the 2013 runtime.
The solution to this problem is to recompile all of your code and dependent libraries/dlls with the same compiler.
Warning:
Some users will try to just install the dynamic runtime (or recompile dependent libraries with static CRT) from the other version of Visual Studio however this is not a solution to this problem mainly because each runtime has its own independent heap. Having separate heaps can and will lead to random crashes caused by allocating memory in one heap and then trying to free it in a different heap. Since the heaps do not share information about allocations or deallocations this leads to having corrupt heaps. From my experience the problem does not always cause an instant crash. The crash may or may not happen on the next allocation of the corrupt heap so debugging this situation can be very frustrating.

Why won't my C++/Win32 project work outside of Visual Studio?

I have a rather large project I'm working on in C++/Win32, and now that I'm nearing completion, I wanted to start testing it on other machines. My project works great in Visual Studio - either in Debug or Release mode. However, if I try to run either executable from its build directory (with all of the supporting files in place) they crash. I tried using the debug feature provided by visual studio, and it opened malloc.c, saying that a heap has been corrupted. If I had a memory leak or something somewhere, why wouldn't I be getting this error when I run my project from Visual Studio? I could use some pointers on how to debug what the problem might be.
I don't think that is due to memory leak. It has happened to me too when I tried to copy only the compiled executable but not depend libraries. So just check whether all depend libraries are available in other systems too.

Compile hunspell with Visual Studio

I need a spellcheck tool for my MS C++ (MFC) project. It looks like hunspell is a good choice. However, I found it difficult to compile with visual studio. Can someone help?
Here is what I have done:
I downloaded hunspell from sourceforge, the version is 1.2.14. Unzipped it.
Created an empty solution in visual studio and added the projects into it. The project files are under win_api directory.
Then I tried to compile it, and got a bunch of errors.
By the way, my operating system Vista (x64).
Please help.
Thanks for the reply.
Today, I tried it on a Windows XP (x86) system and it compiled without errors.
The error message with Vista x64 was: error c2552: non-aggregates cannot be initialized with initializer list. It is for file 'utf_info.cxx'. It's strange that XP x86 works fine.
It seems the version 1.2.12 works fine, for both 32 and 64-bit machines.
This appears to be a known bug.
There's now a patch available, which has been integrated into the CVS as of January 13, 2011. Make sure that you grab the latest copy of the source.

msvcp80d.dll not found while using TBB

I am using Intel TBB C++ for multithreading an application on visual studio 2008. When I run the executable I get a dialog saying "MSVCP80D.dll" was not found. There is so much on the net about this that it confuses me.
Please help.
EDIT: Based on answers, finally I was able to fix the "dll missing" problem. I had given a path to TBB lib of vc8 leading to dependency on vc8 dlls, which are used with visual studio 2005, not with 2008. (Using depends (http://www.dependencywalker.com/ ) it is easy to determine the run-time dependencies of an executable.) I changed by project to depend on vc9 dlls, not vc8 and then it worked fine.
Another thing to note is use of manifest files on windows. Manifest files describe dependencies. The manifest files must be generated while writing an application as it is necessary.
You can find them online at various places. Just scan it for a virus and put it in your program's path and everything should work fine. You may need more than one of the debug dlls, you can use depends32.exe to see what you are missing.
MSVC80D is VS 2005. As part of VS2008 you would have MSVC90D instead.
Your app is compiled with debug version. Debug version of VC runtime is not in path.
Try to generate release version.
Are you running the program on your development machine? If you are not, you might get this error. The "D" at the end of the filename means that the DLL is a debug DLL, and often not on computers without Visual Studio installed. You're not supposed to redistribute it (copy it around), either. You should compile a "release" version of your application and run that. If you really can't do that for some reason, and it's only one or two computers, then try installing the express version of visual studio on that computer.
If you are having this problem on your development machine, it can apparently be caused by a compiler/linker problem. Try doing a clean build ("clean", then "build" in Visual Studio).
Ok, after a lot of search, and by chance, I landed on this forum http://www.codeguru.com/forum/showthread.php?t=446789 which says something I interpret as "the version of TBB I am using does not support VS 2008".
But this still uncertain.