Visual Studio: Intellisense Problems and Linux Compatibility - c++

Two somewhat unrelated questions:
Sometimes when I am working on a C++ project in Visual Studio 2008 Express, intellisense just does not want to "work" even though it really should. Auto completion box does not show and status bar says something along the lines of: "Intellisense: No further information is available".
Sometimes it can be fixed by either rebuilding the solution or re-opening the solution, and sometimes even that doesn't work. Is this a known problem? If so: are there any known fixes?
Is there any C++ IDE for Linux that has compatibility with MSVC++'s .sln files? I sometimes want to work on some project without having to go through the hassle of creating a new project and adding the files or manually creating a Make file.
edit:
To answer my own questions:
Apparently there's no real fix other than to try and delete the .ncb file. Alternative would be a different IDE or to use a commercial package replacing intellisense.
Code::Blocks seems to be able to open Visual Studio files. Or at least import them easily.
I posted these together as they both related to visual studio and I didn't deem them important enough to both deserve their own topic.
Do think the downvote is a little harsh though!

Intellisense failing is usually because of a "corrupt" ncb file. The usual solution is to delete it.
Reportly the next version VS 2010 will not be using ncb files anymore.

I've actually had some luckk opening .sln files using Monodevelop.

To avoid creating the Make files by hand try CMake

To answer your second question, there is no way to open .sln files in anything other than Visual Studio. They're a proprietary file type that (it seems) no one has any interest in writing a parser for.
You can however use Visual Studio to generate a makefile automatically. Just use the "Projects > Export Makefile" menu command in Visual Studio.

Related

No Auto Complete Visual Studio 2010

Im using MS visual studio 2010 PRoofessional version , and in both languages I'm using (C++ and UnrealScript with Nfringe ) there seems to be no auto complete , also with the nfringe there is no auto indentation either .
I was wondering how to fix this?
Most probably you accidentally switched into low-impact IntelliSense mode by pressing
CTRL+ALT+SPACE Just hit CTRL+ALT+SPACE to go back to the IntelliSense mode.
Are you writing a totally unmanaged C++ dll? There is no intellisense support for CLI/C++ projects in VS 2010
I have actually problems with C++ and Intellisense since VC6...
We now use Whole Tomatoes "Visual Assist" and it repairs Intellisense. :-) This single feature is the money worth.
When you open the solution file, do you get a warning about being unable to open the IntelliSense database? If so, that's the reason—UnrealEngine intentionally has a directory with the same name as the IntelliSense database to prevent its creation (Visual Studio can't create a file if a directory of the same name already exists). The engine code base is so large that having IntelliSense enabled slows everything to a crawl when you're editing code.
I'm also using Unreal Engine, and I met the same problem before, the solution was set the dirs by myself in VS project setting.
Open the property window of ur game project(e.g UDKGame), navigate to "NMake", "Include Search Path", and fill the needed header search path there.
You may copy the path list from the output of UnrealBuildTool.
The values u set here is only used by Visual Studio's IntelliSense, so there's no need to worry about build error.
This only works for C++, I'm not sure what's wrong with Unreal Script. I just updated to Visual Studio 2010 and has not installed the new nFringe.
Hope this answer is not too late

VS 2010 intellisense not working for upconverted project

We have a very big C++ solution with several projects for which intellisense works perfectly in Visual Studio 2008, but not at all in Visual Studio 2010 (not even for structs defined in the same file where they are used). I've verified that intellisense does work in VS 2010 for other projects on my machine. I've tried importing one of the problematic projects from a brand-new solution with no success. Re-building the project files from scratch seems promising, but it would require days of work to follow that path, with no guarantee of success at the end. Any alternative suggestions are welcome. The actual error message I get is:
"Intellisense: 'No additional information available'(See 'Troubleshooting IntelliSense in C++ Projects' for further help.)
I've tried that, but there's basically only one suggestion on the MSDN webpage, to make sure "stdafx.h" on the include path, but we're not using precompiled headers and don't include it from anywhere, so I'm pretty sure that's not the problem.
Have you deleted all of the generated database (.ncb and .sdf) files? Corrupted database files is the most likely cause of Visual Studio failing to display IntelliSense.
Intellisense was not included as a component of Visual Studio 2010 for C++/CLI. Unfortunately, it seems they are not going to support it soon either. This is an incredible detriment, as i find myself having to open VS2005 on occasion to simply find an object member.
Here is Microsoft's release on the subject:
http://blogs.msdn.com/b/vcblog/archive/2011/03/03/10136696.aspx

How to downgrade solution from Visual Studio 2010 to Visual Studio 2005?

I have a huge Visual Studio 2010 solution. I work with Visual Studio 2005, so I want to convert the solution to the desired version. Basically, it's a portable C++ code so it should compile on Visual Studio 2005 too. Changing the version in the *.sln file doesn't help because the *.vcxproj format is completely different from the old *.vcproj format.
Recreating the solution by hand is not an option because of its size. Also there may be some non-default compiler flags, dependencies, etc. that I don't know of (and I can't look through ALL this XML junk that I don't understand).
There is already a related question on How Do I Downgrade a C++ Visual Studio 2008 Project to 2005. However, the utility suggested there supports at most Visual Studio 2008.
Any suggestions?
It really totally sucks, that every proprietary IDE today thinks it needs to create its own project file format.
"Dear IDE developers, just use Makefiles and create a nice GUI for it so that also people without Makefile knowledge can use it!" In VS6 it was at least possible to import/export Makefiles, but not today anymore. And it was possible to use nmake for automated builds. No IDE needed to be installed, just the toolchain which could be grabbed by a simple checkout without installation.
I use CMake now. It's free, it's cross-platform, it is well supported in free IDEs like KDevelop, QtCreator, etc. It can generate Makefiles and Visual Studio projects.
So you maintain only one project source, the CMakeLists.txt file and can work with any IDE. No pain with different versions of Visual Studio or with other proprietary project file formats.
This way you can generate or VS projects for developing and you can generate Makefiles for commandline builds using nmake like in the good old days.
BTW, it's much easier to change settings in a CMakeLists.txt than clicking through various GUI dialogs. But this is a matter of personal preferences.
In my work made a utility which utilized the EnvDTE.dll and scanned a vcproj-file and optionally all vcproj-files within a sln-file. It compared all settings with a "template" and would issue a warning or optionally update the setting to correct values. We used this utility so that settings would be verified to be correct and consistent throughout all projects. I haven't updated the utility to 2010 yet due to other priorities.
EnvDTE hasn't changed much from Visual Studio 2008 to Visual Studio 2010. Perhaps it is possible to create a simple utility which opens the vcxproj-file using DTE100 and saves it using DTE90, or earlier.
Easiest way is probably to create a new project in VS 2005, and use the add existing item dialog to add the code to the project. I'd suggest using 'Empty Project' as the project type, so you don't have a lot of rubbish autogenerated for you that you'll just delete anyway.
I haven't tried it, but this looks promising:
http://www.emmet-gray.com/Articles/ProjectConverter.htm
edit: Nope, not promising, sorry :-(

Visual Studio environment alternative

I use Visual C++ (7.1 and 8.0) on huge C++ project. The solution contains thousands of files. Visual Assist helps in jumping to function and class definitions. The problem is that it sometimes becomes too slow. I just can't edit a single letter without delay.
Is there some alternative to this environment? I mean something that may read .sln and .vcproj files, use MSVC debugger, compile with MSVC compiler or even use IncrediBuild if necessary. I don't need any sophisticated features. It should be possible to find and open a file by name and jump to function/class definition from place where it is used.
May be Vim with some plugins? Or something else?
It seems there is no alternative to MS Visual studio. I've added separate HDD for source files and it works much better.
Currently i left Visual studio because c++ support just sucks (still using Visual studio 2013 but only for C# projects)
i use NetBeans right now, and really enjoy the refactoring part.
The visual C++ compiler support can be added using a free plugin (VCC4N - Visual C++ Compiler For NetBeans)
good luck

Cygwin in Visual Studio

I'm trying to port an old program I wrote for class from KDev in Ubuntu to Windows Visual Studio 2008 using Cygwin as a personal learning exercise. I have the include path configured to include C:\cygwin\usr\include but it doesn't read the .h files properly.
Namely I'm curious as to how one would go about using unix sockets.h functionality in a Visual Studio environment using Cygwin. Has anybody ever got this working or have an easier way to go about doing this?
There are several ways to go about this that could be made to work, depending upon your exact goals. The simplest way is probably just to create a Visual Studio "makefile" project that fires off a custom build command to run a makefile you've built. But that keeps you away from a lot of the nice benefits of Visual Studio as an IDE, so I'm guessing that's not really what you're after.
If you want a more fully integrated solution, you're going to need to do two things. First of all, you're going to need to change out all of your include/library paths to avoid the Microsoft ones and go after the Cygwin ones instead. You can do this by selecting "Tools->Options" from the menu, then choosing "Projects and Solutions->VC++ Directories" from the tree on the left hand side of the window that comes up. You'll have options to change the search directories for executables, headers, libraries, etc. For what you're trying to do, I'd suggest removing everything and adding in just the cygwin directories.
Second, you'll have to tell Visual Studio to use the gcc/g++ compiler. This is a bit trickier. VS supports custom build rules for custom file types... but it seems to have C++ hardwired in for the Microsoft compiler. I don't really know a great way around that except to use your own custom file extension. You can try the standard unix extensions of .c (C files) and .cc (C++ files), but I suspect Visual Studio will automatically pick up on those. You may have to go with something totally foreign.
If you right click on your project in the Solution Explorer and select "Custom Build Rules" you'll be given an interface that will let you create your custom build rules for the file extension you've chosen. The interface is relatively straightforward from there.
This might not get you exactly what you wanted, but it's probably about as close as you're going to get with Visual Studio.
Simply speaking, don't do that. It would be just waste of time. I tried it several times, but always failed. Mostly, I was frustrated by many linking errors, and also was unable to use VS as a debugger.
You can use Visual Studio for editing and browsing source code. It is nice because VS provides the best C/C++ intellisense features (e.g., Auto completion, fast go to definition/declaration). But, it is very hard to use cygwin tool chains with Visual Studio 2008. Visual Studio 2008 is not designed to work with other tool chains. Specifically, you need to change (1) headers, (2) libraries, (3) compiler and (4) linker. However, it is generally very hard, or you need to trade off with the nice features of Visual Studio.
The strongest feature of Visual Studio is its debugging ability such as fully integrated debugging environment and very easy watch windows (e.g., you can see STL vector's element directly in watch windows). However, you can't do this if you would change fundamental tool chain (although I am very suspicious it is even possible to safely build with Visual Studio and cygwin tool chains).
Unfortunately, current Visual Studio 2008 is not for cygwin/MinGW.
This is an old question, but since it comes up first (for SO) on a Google search I wanted to share that it looks like the latest Visual Studio versions do support this.
For instructions, refer to this blog post:
https://blogs.msdn.microsoft.com/vcblog/2017/07/19/using-mingw-and-cygwin-with-visual-cpp-and-open-folder/