Background compile in VS2010 and C/C++ - c++

I use Visual Studio 2010 and Intel icc compiler for C development. I use C99 but editor is still showing C99 constructs as errors (compiling is fine). How to get rid of it?
Second question, is it possible to use Eclipse (CDT) with Intel compiler on Windows?

As mentioned in the responses to your post, the problem you're seeing is with your intellisense only.
You can turn off intellisense error reporting in VS2010:
Tools > Options > Text Editor > C/C++ > Advanced. Under IntelliSense, choose "Disable Error Reporting" and set it to "True".

Related

Getting error D8045 "cannot compile C file <file> with /clr option" even after turning off CLR option

This is in Visual Studio 2015.
I have a native C library that I'm using from my .NET Visual C++ code. I'm aware that I have to change the "Common Language Runtime Support" option to "No Common Language Runtime Support" on the property page for each .c file, per this question. However, even after I have turned that option off, I am still receiving error D8045 when I attempt to compile those files.
Is this a known issue in VS2015, or am I missing something?
It cleared up on its own eventually. I had restarted Visual Studio a few times and it kept happening, which is why I asked this question. I guess some cache somewhere wasn't being updated or got corrupt or something.

How to make Visual Studio IntelliSense (code completion) recognize Clang extension primitives

I would like to use __fp16 (a Clang language extension) in Visual Studio, but the code is highlighted red by the Visual Studio's code completion whenever I do so. I know that my version of Clang (5_0) supports this extension, and have successfully compiled code using __fp16, but I find that IntelliSense recognizing __fp16 as an error is inconvenient and makes finding errors more difficult. Is there any way for me to configure Visual Studio's IntelliSense so that it stops marking __fp16 as an error? Thank you.

Visual Studio Code not highlighting #if.. in C++

I try to get VS-Code working for my C++ project, but I have the problem that the syntax highlighting ignores preprocessor directives like #if/#else/#endif.
I have the extensions ms-vscode.cpptools (C/C++) and ext install code-gnu-global (Intellisense) installed.
"Go To Definition" shows the #define correctly.
#define ON_TARGET false results to the same highlighting
It should look like this:
VS Code can do it with Microsoft's C/C++ extension since v 0.15
from February 2018.
Visual Studio Code can't do such things out of the box as it is "just" an editor.
If you compile your code, it will work as expected.
For evaluating such defines you need an IDE, e.g. Visual Studio, CLion or you may achieve this with additional Plugins. (e.g. C/C++ Plugin)

Code Analysis Not Available in This Edition of the Compiler

I'm trying to run code analysis for the first time on my native C++ application. I'm developing using Visual Studio 2013 Ultimate and compiling using the Visual C++ Compiler Nov 2013 CTP (CTP_Nov2013), which is the latest (I believe) compiler from MS for C++11. When trying to run Code Analysis I receive the following warning:
warning D9040: ignoring option '/analyze'; Code Analysis warnings are not available in this edition of the compiler
So I'm wondering if it's because I'm using this new compiler that it's not able to run code analysis or what. But I couldn't find any answers by briefly Googling. The MSDN for Visual Studio says code analysis works for all version of VS except Express. Any help would be appreciated, and if it's a "No it doesn't work with that compiler" then that's fine. Just wondering. Thanks!
It seems to work only for x86 builds. If you're doing an x64 build, it won't be available.

error C1190: managed targeted code requires a '/clr' option

Found a lot on this error already, but my case does not get matched with any yet.
I am building a solution (having many projects) in debug mode, and one of them is throwing this error, I am using VS2010 and language is C++, .net version 4.0, earlier this project was compiled in vs2008 and then VS2010, and it was all ok, now I got a new machine which has just VS2010 installed and now facing this error.
Main thing to notice is:
Properties settings:
Project Configuration->General->/CLR is chosen
In C++->General-> No CLR support
I am having these settings since past, it's running all fine in my old machine in VS2010 only in the same debug mode.
What to do?
I am using Visual Studio 2013.
I had similar symptoms for a very simple C program. In the project properties I changed the General / Platform-Toolset setting from "Visual Studio 2010" to "Visual Studio 2013 v120" and that got rid of this error for me.
As the error indicates, precompiled headers are not compatible with /clr-compiled files.
You can disable precompiled headers for the cpp files that are compiled with /clr or for the whole project (C/C++ -> Precompiled Headers -> Precompiled Header : Not Using Precompiled Headers). I'm not sure what the difference is but both seem to work for me.
Doc is not exactly wrong, but I'm betting that's not what's going on here.
Do you by any chance have something like THIS:
#using namespace boost::asio;
...instead of something like THIS?
using namespace boost::asio;
Both "using" and "#using" have valid roles in Visual Studio-- but if you mean the pure C++ language keyword, be sure you are using the former! The latter is indeed used for managed code. See here:
https://msdn.microsoft.com/en-us/library/yab9swk4.aspx
Getting this wrong in Visual Studio 2015 has the following effects:
BUILD OUTPUT:
1>thingy.cpp(3): error C2006: '#using': expected a filename, found 'namespace'
1>thingy.cpp(3): fatal error C1190: managed targeted code requires a '/clr' option
Note that attempting to "satisfy" this in a fit of 4:00 AM frustration by removing the "namespace" keyword and quoting the value will result in only the second error.
(I think that's worth mentioning, because as both Visual Studio and the C++ language specification continue to change, people try all kinds of syntax that they know shouldn't work, and if it suddenly compiles, just assume the spec or the tools have changed in some way they haven't had time to keep up with-- especially if the error messages seem to have something to do with "features" they couldn't care less about, and don't use.)