Tag: Visual Studio
Visual Studio .NET 2005 + I.C.E. (Internal Compiler Error)
by HidekiAI on Aug.22, 2009, under Game Development
A while back, I wrote a BLog about Visual Studio 2005 and C# not being about to generate DLL Assembly with invalid user (at “http://www.codemonkeyninja.com/blog/?p=320″) – by the way, if you still have this problems after you regedt32 for wrong users, verify and make sure you can succeed if you right-click on Visual Studio and “Run as” Administrator, and if you succeed, this is the problem you are having.
Anyways, at work, I have been using Visual Studio .NET 2005, and off-and-on I would get an “Internal Compiler Error” via cl.exe and I’d make sure that I have the latest service packs installed for Visual Studio.
Just recently, I spent about 2 hrs trying to compile a third party source code (but that’s irrelevant of what I am compiling since this issue has happened in other sources) and I ran into an old MSDN knowledge-base bug where they have suggested disabling “Minimal Rebuild” (under “C/C++” -> “Code Generation” -> “Enable Minimal Rebuild”) to see if I.C.E. would go away.
By the way, this is for Native C++, but I usually turn it off for Mixed and /CLR based as well, just in case…
As mentioned, I do have the latest service packs for Visual Studio, and according to MSDN, this bug has been fixed.
Yet, just by disabling all the projects (for all the $(ConfigurationName) – select “All Configuration”) of Minimal Rebuild, the problem goes away. And yes, I’ve rebooted at least once, tried compiling it from both IDE and via command-line, called cl.exe from MSBuild, devenv.com, and even devenv.exe. Tried clean and rebuild, as well as “del /s /f /q *.pdb *.pch”, etc, etc.
I’ve never trusted minimal rebuilds, incremental linking, and even .PCH sometimes can give me griefs… These mechanisms are supposed to save me time, yet it ends up sometimes taking away the precious dev-time and is hardest to figure out…
P/S: Make sure to at least delete all your “*.pch” after disabling “Minimal Rebuild”.
Related posts
Visual Studio: C# Project Cannot Write DLL to OutputDir
by HidekiAI on Jun.12, 2009, under Technology Opinions
I usually prefer not to BLog about work or things I’ve discovered (or learned) at work because I believe it to be intellectual properties of my company I work for. But this is a BLog about an incident in which I’ve lost close to 8 work-hours that I believe is not really an I.P. issue.
My hard-drive had crashed about (less than) a month ago, and to avoid lost time and in hopes to immediately get back to work, I had our I.T. personal just re-image the “developer configuration” of the PXE which had XP SP2 and Visual Studio 8 (SP1) pre-installed.
After a while, I’ve started to notice that I’d constantly get “Internal Compiler Error” (ICE) when compiling header files that has templates, as well as having major difficulties with projects that are either C++/CLI /clr (Managed C++) or C# based projects.
It was quite common that I’d have to juggle back and forth between compiling from IDE and then try to compile the .SLN (or sometimes, specific .VCProj or .CSProj) from command line either via MSBuild or Devenv.com (don’t use Devenv.exe, it will hang sometimes) and things would move on after several minutes (of wasted time) futzing around with it.
In certain cases, some of the projects would fail because it could not find the Assembly References of the dependant project, and I’d sometimes get the error about “#using MyAssemblyFile” failure because the “MyAssemblyFile.DLL” could not be found.
These “MyAssemblyFile.DLL” was (as it turns out) commonly of C# based assembly files most of the time, which some of our Managed C++ referenced.
Related posts
Visual Studio 2010 and C++’0x
by HidekiAI on Jun.11, 2009, under Technology Opinions
Addendum (2009-10-30): If you haven’t watched this video, do so now. Microsoft has added 6th feature of C++ ’0x to VC++. In a nutshell, they had to add nullptr (the author calls it “null put-er” (so not to be confused with “null pointer”) and a new type nullptr_t. The part that gave me some warning signals were that Managed C++ (/CLR) already has nullptr as a keyword so if you wanted to have raw/unsafe pointer in your Managed C++ you’ll wonder how that would get affected, but watch the video, it’ll keep you in suspense!
As we already know, Microsoft is already preparing for Visual Studio 2010, which is supposed to support partial (if not most) of the C++ ’00. One of the best page to read when it comes to briefing yourself on what is to come is to read Bjarne Stroustrup‘s FAQ (from his point of views and opinions).
It seems that on 2010, additions made to VC is mainly to adopt towards templates, for those who’s been shying away from STL would probably not be excited, but evolution of C++ is now leaning towards more generalized utilities of common design patterns so that you wouldn’t have to reinvent the wheels (IMHO, that is what .NET is about as well).
One of the additions in which I am quite interested in that Microsoft has began support for is lambda. I think the best individuals who can explain what lambda is, are the ones who really know what they are doing, the ones who are involved in the design. So I want to first quote Stroustrup, then quote Microsoft. Combined together, you’ll get a clearer understanding of what it means.
A lambda expression is a mechanism for specifying a function object. The primary use for a lambda is to specify a simple action to be performed by some function. For example:
vector<int> v = {50, -10, 20, -30}; std::sort(v.begin(), v.end()); // the default sort // now v should be { -30, -10, 20, 50 } // sort by absolute value: std::sort(v.begin(), v.end(), [](int a, int b) { return abs(a)<abs(b); }); // now v should be { -10, 20, -30, 50 }The argument [&](int a, int b) { return abs(a)<abs(b); } is a “lambda” (or “lambda function” or “lambda expression”), which specifies an operation that given two integer arguments a and b returns the result of comparing their absolute values.
LinkedIn profile
Recent Comments