I am using ROS and C++ and ROS packages have a CMakeLists.txt in them. I would like to have a syntax highlighting for CMakeLists.txt in visual studio code.
Unfortunately, I searched on the internet but I can't find how to do this.
Could you help me?
Below is how to do it. It is quite straightforward (with an extension):
Open Visual Studio Code
CTRL+P - Launch VS Code Quick Open
ext install twxs.cmake - Install the extension "CMake For VisualStudio Code"
I hope this will help someone else.
p.s. It is always like that. I search for a long time, I don't find an answer. Then I post the question here and I immediately find the answer.
most easiest is to install cmake and CMake Language Support extensions. makes your life easier. you could search them and install in extension panel in vs code.
Related
I used to code on Visual Studio Code. Now, i'm trying to learn how to code on Visual Studio 2017 as it will be more beneficial for me. So far, it's so good.
But there is one thing which i miss on VS which is, in VSC, there was a neat extension, called Path Intellisense which autocompleted (or showed suggestions for) ./../file style file-paths. While coding in javascript (ExpressJS to be exact) i got no suggestions for file path autocomplete. Also, i didnt get any extensions to do so.
Those dot style file paths confuse me and i would really like an extension, or a workaround, in VS to help me with that. Are there any extensions for this?
E.g.
I know this has been asked for ImageMagick couple of times and many times for How to link stuff in VS but it seems I cannot link ImageMagick's libraries with my program in VS2013!!!
What is wrong with the way i am doing it!?
Include Directory Setting
Library Directory Setting
Library Setting
These codes compile fine under Unix-Like environments, but not windows'.
I have been on this for whole day, any help would be appreciated.
Try adding
CORE_RL_MagickCore_.lib
CORE_RL_Magick++_.lib
CORE_RL_MagickWand_.lib
Instead. This works in my visual studio 2013.
Other than this I can see no other reason why it shouldn't be working.
This is a new one for me. I have been asked, for legal reasons, to setup a laptop with Visual Studio, but to disable the ability to compile projects/solutions. The purpose is to enable browsing of the source code, but not allow building or executing it.
Yes, I know this is really a stupid question and unfortunately I can't get into too many details. I've asked about using alternative text editors, but I have been told no. So until I can prove it isn't possible (or that I have at least made a reasonable effort), I have to try and make this work. Notepad++ would be an excellent alternative, but that has been rejected.
This would be in Visual Studio 2010 or later. Is there any way that I can do this?
UPDATE
After trying Marius Bancila's suggestion of removing the compilers and MSBuild, I was surprised to find out that VS continued to work fine (except for building, of course). I did not expect that functionality like F12 (Go To Definition) would continue to work.
This may mean that there still remains the ability to build something somewhere somehow. But as it stands with MSBuild permanently deleted and the Visual Studio Build command not working, it'll take some effort to get around it (if a way in fact does exist).
You didn't say what projects should not be possible to build (VC++, VC#, VB.NET, F#, etc.). Starting with VS2010 they are all built using MSBuild. So if you delete MSBuild they will not be able to build from inside Visual Studio. However, one can still be able to build from the command line, so the only possibility I see is that you delete all the compilers that come with Visual Studio.
It's a little bit crazy, but if you really have to ...
Try deleting some important binaries after installing Visual Studio e.g. linker (link.exe) and compiler (cl.exe).
Use a text editor instead. Notepad++ even comes with color syntax highlighting.
You cannot prevent people from compiling the code. Visual Studio Express is available to anyone, and the compiler can be executed from the command line, without Visual Studio's help.
I've just attempted to use Firebreath and have followed their video tutorial for Windows and come across the error that says:
Check for working C compiler using Visual Studio 10 -- broken
And then says:
It fails with following output:
Change Dir:
And then lists the drive. This happens when running prep2010.cmd. I have found a post about it, but the forums won't let me log in and there is no answer. It's here: http://forum.firebreath.org/topic/274/?page=1#post-1117 and is exactly the same error, I believe. The last post talks about running prep2010 from inside the vs2010 command shell. What does that mean?
Has anyone else had this error or know how it is caused? I have no idea how to approach it.
Thankyou
I know this is really old.. but in case someone else has this problem, the solution for me was to install service pack 1 for visual studio 2010
As I said in the comment above, this is not "FireBreath" that is saying your compiler is broken; the prep command uses CMake to generate the project files, and it is from cmake that the error comes.
In your start menu where Visual Studio 2010 is there should be a "tools" or "utilities" subfolder and in there somewhere there is a "Visual Studio 2010 Command Prompt" link. That starts a command prompt with environment variables and path set up so that the vs2010 commands are all available. The error you're seeing is indicating that for whatever reason, CMake is unable to find visual studio 2010.
I don't know if using the vs2010 command prompt will help or not; it doesn't have any trouble finding vs2010 on any of my boxes. I can postulate that perhaps if you installed it to a nonstandard location, in a nonstandard way, or your registry got screwed up any of these things could potentially cause the issue that you are seeing. Also if you don't have vs2010 installed it would certainly cause this issue =]
I'd recommend first trying the vs2010 command prompt; if that doesn't work, you may have to try uninstalling and reinstalling vs2010. If that doesn't work, I'm out of ideas, and maybe someone who knows more about cmake will have a suggestion :-(
Service pack 1:
http://www.microsoft.com/en-us/download/details.aspx?id=23691
Configure cmake with generator: MSVC2010 x64
I also had MSCV 2010 x64 on windows 7 and installing service pack one also helped.
Also make sure that all your external dependancies are (x64) versions:
MSVC version:
http://visual-studio-2010.en.malavida.com/
Gl&HF
i'm searching for a way to change the language of the "Spell Checker"-Extension for Visual Studio 2010.
The problem is following:
I'm using the german language version of Visual Studio 2010. If I use the "Spell Checker"-Extension it checks the correctness in german language, while I'm coding in english.
So nearly every single word is underlinded as incorrect.
How can I change the checking language to english or how can I change the libary it used to check language?
Any Ideas?
I found a solution for the problem by myself.
If anybody like to know it:
First download the extension inside the Visual Studio extension-manager.
Second download the source of the extension and open it in Visual Studio (Visual Studio SDK has to be installed to open the project)
Third navigate to Spellchecker/Spelling/SpellingTaggers.cs and add the following line inside the CheckSpellings method of SpellingTaggers class under the textBox initialization:
textBox.Language = XmlLanguage.GetLanguage("en-US");
Next build the dll-Files with Visual Studio
And finally replace the dll-files with those in the directory of the Spell Checker Extension (it can be found under %HOME%\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Roman Golovin, Michael Lehenbauer, Noah Richards\Spell Checker\2.23 or something similar)
That's it!
If you want to use a language different from "en-US", change the Language Code.
There is a fork of spellchecker, that maybe will eventually be integrated into the main branch, that supports spellchecking in multiple languages here:
https://github.com/simonegli8/Spellchecker
Simon Egli
Remark:
Step 5 will not work in all cases. I think dlls are cached or something like this, so it would be better to uninstall spell checker from Visual Studio and reinstall the new compiled version of SpellChecker.vsix (could be found in SpellChecker.Implementation\bin...).
This worked for me.