Get intellisense data for uncompiled projects - linux

I inherited a project setup from a previous programmer. He used to develop for linux, but instead of coding directly in ubuntu, he shared the drives with samba and used Visual Studio to edit the files.
Now I can't compile this project in Visual Studio directly obviously, so I can't get data for intellisense and such. Would it be possible to associate symbols without compiling?
I know that what I ask seems counter intuitive, but Vim plugin OmniCPP does not come with a compiler and yet, is able to provide code completition up to a certain degree.

The commercial addin Visual Assist X can help. How well it helps is dependent upon how much information it can get from the project (if one exists): things like source files, header files and include directories. If no project is being used, you can create a dummy project just as a container to associate source and header files (not for compiling).

Related

Visual Studio 2015 code map external dependencies

I have a native Win32 project written in C and wanted to visualize my project's dependencies from external DLLs. Visual Studio 2012 and 2013 let me generate a code map which would not only show all my functions and their dependencies from each other using arrows, but also all external libraries I used, which functions I used from those and which of my functions called which external functions etc..
Now, in Visual Studio 2015, this latter part seems to be missing. I can not get Visual Studio to show my project's external dependencies. I only see the internal ones. So here's my questions: Am I missing something? Do I have to activate a specific option in my project settings? Or are those external dependencies just not working in Visual Studio 2015 right now?
Steps to reproduce: Create a new non-empty Win32-project. In the Architecture menu, select Generate code map for solution. You will only see Win32Project1.exe in the middle of the screen. Meanwhile, Visual C# seems to be fine, showing the external dependencies. Create any C#-project for comparison.
Thank you for taking the time to post this! This looks like a regression, as in Visual Studio 2013 an Externals group with external dependencies is shown for C++.
I've logged a bug on Microsoft Connect so that you're able to track this externally:
https://connect.microsoft.com/VisualStudio/feedback/details/1694695
I have posted this workaround on the link that Bogdan Gavril listed and hope it helps someone. Unfortunately, it requires that you enable "CLR" support for your project. Basically, it appears that the VC++ linker and librarian is looking for a flag that indicates some type of managed code. At the very least, the code map is dependent on the mscorlib.dll reference injection. To make the CLR issue (which adds a lot of unnecessary bulk for native code) less a problem, simply create a new build configuration for use only when you need code maps with external dependencies. Make sure you've selected "CLR Support" on the general options of the project properties configuration page. Then, clean (probably not necessary) your solution and generate a code map. You will find the external dependencies as expected!
Zac

CMAKE changing Visual Studio Settings

I've been using CMAKE recently on Linux and Windows and I really like it. Its a great way of spinning up a project and organizing your builds. There are just a few things that are bugging me and I'm hoping to get help here.
Visual Studio Settings
Everytime CMAKE generates a project it will be a fresh solution and will not maintain any of the settings you applied to the Visual Studio project. I know that many things such as CMAKE_CXX_FLAGS, etc can change the properties. But what if I want to change settings such as "Suppress Startup Banner", "Environment", Enabling Microsoft Symbol Server, Enabling Native Code Debugging. How do I force CMAKE to set the options I want for fields like these?
Combining Debug/Release/Etc into one solution
It seems that with CMAKE you have to do separate generations for Debug/Release/etc. But in typical manually created Visual Studio projects you can combine the profiles and just change a project setting to get your new settings. Is it possible to generate a single solution file from CMAKE?
Okay so I scoured the CMAKE boards as well. Here are the answers I found.
Visual Studio Settings
For this one CMAKE can't modify the *.user files at all. However what was proposed was to make a user file template and then use CMAKE to supply all the paths and such that you are concerned with. This worked very well for me.
Combining Debug/Release/Etc into one solution
To change various settings on a per configuration basis. It seems like it is best to use fields like CMAKE_CXX_FLAGS_ and most importantly generator expressions. Generator expressions allow you to test for the build type and then generate whatever include, libraries, etc that you need.
Take a look at "Generator Expressions" here

Better LESS compiler options for Visual Studio?

I'm new to VS, coming from the Mac where I used the excellent CodeKit for LESS compiling. I've installed the Web Essentials add-on, so I have basic LESS support and compiling.
The major shortcoming with this plugin is when saving files that are imported into a main.less file, the main.less file does not compile unless I open it specifically and save it.
I'd prefer a solution like CodeKit, which would compile the parent file if any of the children are modified. Are there any other plugins, even commercial ones, which do this?
There's an option in Web Essentials to "compile all LESS files", which would almost do what I want, but it throws an error:
In WebEssentials there is an option (tools>Options>WebEssentials>Less) to Compile all files on Build, which you'll probably do before publishing anyway. You might want to add your votes to the UserVoice ticket for this issue.
BundleTransformer allows you to have ASP.NET do the transformations on the fly (at runtime), having it compile, minify and compress all in one go. You won't have to recompile your files inside Visual Studio itself. You can keep using WebEssentials for intellisense.
And then there is the Mindscape Web Workbench which provides similar functionality as Webessentials. Their Pro edition ($) can also compile files on save & build.
I personally prefer http://wearekiss.com/simpless You can use it even in Express edition since it's not integrated inside VS.
Just open the Simpless drag and drop the file and it will compile your file automatically when they has been modified from your VS (or any of editor).
Web Essential is also have suggest in someone answer.

Visual Studio 2012 speed big solution

Can you please advice how I can speed up a compiling, loading big solution (~50 projects).
I mean only VS 2012 studio or Windows settings, not hardware changes.
Thanks
Consider your need for 50 projects in one solution - having many projects that are referenced by each other is one of the main reasons for slowdowns.
One of the few valid reasons to have separate projects is because you need to deploy the generated assemblies separately. If this is not the case, consider combining projects - use folders for the logical separation.
The lower the number of projects, the faster your build will become.
In addition, if you change the builds to output to a specific shared directory and reference the DLLs instead of the projects, the number of unneeded re-compilations should go down drastically, though you will have to manage the build order yourself.
I use 100+ projects in a solution with Visual Studio 2012 Update 3, and it builds fast.
I agree with shared output directory comment by Oded, but I'd like to mention that project references work OK too.
Make sure that your \Users\\AppData\Local\Microsoft\WebsiteCache folder is empty. Somehow, this is a problem even with desktop-only solutions.
I have disabled Productivity Power Tools 2012, since they compile code in the background, a bit too much for my liking. Disable all plug-ins and extensions and see if it makes any difference.
Suppress excessive output messages to disk and to screen by reducing output verbosity
Use multicore with MSBuild.
As you code, try to limit dependencies between projects by using interfaces and abstract classes (C#).
Try fresh *.suo and fresh *.sdf files. (Make a backup of the user settings and DB, then remove them and try building again)
When all else fails, use ProcessMonitor or attach with another instance of Visual Studio to profile your Visual Studio while it's building.
Try excluding file system filters, such as antivirus, from your build. For example, some antiviruses have a way of skipping scanning in certain directories or by file names.

does every .exe file need a new project in Microsoft Visual C++?

My background is Linux and traditional makefiles. I have a project where the makefile builds several dozen executables I can then run to perform tests against the library being developed. This library is now ported to Windows.
My question: In Microsoft Visual C++, do I have to create a new project for every individual test .exe file? Or is there a way to create 1 project that will easily build all of the .exe files? E.g., test001.cpp becomes test001.exe, test002.cpp becomes test002.exe, etc.
I'm using Microsoft Visual C++ 2010 Express. Right now what I do is click on File->Add->New Project...->Win32 Console Application->... for every test executable. But it would be nicer if all these test files could be built without a new project for each one.
You need to have one project per executable, but you can have multiple projects per Visual Studio "solution".
When you build a solution, all of its projects get built. If you need the projects to be built in a specific order within the solution, you can easily set up dependencies.
If you're using Visual Studio in the normal fashion, then yes, each VS project (i.e. each .vcproj file) corresponds to exactly one output file (an executable, DLL, or static library).
You can also use Visual Studio with makefiles though, if you want. Just write your makefile as usual, except the C++ compiler is the cl.exe in the VS binaries directory, the linker is link.exe, and of course all of the command line flags are completely different. You can even set your VS project to use make instead of its built-in system, so you can still use the IDE for editing and debugging.

Resources