Page 1 of 1

IntelliSense in Visual Studio 2010?

Posted: Wed Oct 27, 2010 7:00 am
by sirflimflam
I finally decided to get back into DS development after a brief stint a while back. I set up my project to build and work in Visual Studio 2010. One thing always botheres me though, and I'm not sure how to deal with it.

I'm getting intellisense errors all over the place, and it's really kinda making my code look ugly with little red squiggles everywhere. I had this same problem with Visual Studio 2008 a while back when I did this before and tried to ignore it, but it's just bugging me. I've noticed in like every tutorial in setting up devkitArm in Visual Studio, their screenshots never have this problem.

This is what happens.
Image

Basically, the error is that visual studio can't find the files and therefore can't parse them for intellisense. Then every single function I use in these headers, it'll draw a red line under because as far as visual studio is concerned, I'm using non-existent functions.

So I went into devkitarm and included the directories these files exist in. It worked. The files were found and I have intellisense to some degree, but now instead of telling me the functions don't exist, it underlines all the parameters I enter into the functions, because as far as intellisense is concerned, every single function in these headers has no parameters.

It's purely aesthetic, but really annoying to see my code covered in "errors".

Does anyone know how I might go about fixing this? Thanks guys.

Re: IntelliSense in Visual Studio 2010?

Posted: Wed Oct 27, 2010 4:57 pm
by Izhido
Aaaaaaaaaaaaaaa... black background in Visual Studio code window AAAAAAAAAAAAAAAAAGGGGGGHHHH!!! :(

Seriously, now... a problem that Visual Studio users face when coding with external compilers and tools, is that, even then, Intellisense still uses the syntax and conventions that their own compilers generate. You can see that when looking at code intended to be multiplatform, that uses #ifdef WIN32 macros and such... while your own compiler will obey whatever rules you put in your makefile, Intellisense won't care about them. What's worse, even if you remove the Windows-specific macros and stuff from the Project Properties page, you will still see code being grayed out inside a #ifndef WIN32 / #endif block. Mindblowing, at the very least.

It looks like the Intellisense behavior is, for all practical purposes, "burned into" its own code. Sorry.

Re: IntelliSense in Visual Studio 2010?

Posted: Wed Oct 27, 2010 6:07 pm
by elhobbs
I am not sure this is the case. there are pre-processor definitions for makefile projects that are used by intellisense. they are on the project properties under "Configurations Properties" in the "NMake" section under "Intellisense". Like you said you do need to remove the default WIN32 stuff, but you also need to make sure you add in ARM9 and/or ARM7.

Re: IntelliSense in Visual Studio 2010?

Posted: Wed Oct 27, 2010 9:45 pm
by sirflimflam
The thing that gets me is whenever I see tutorials on setting up Visual Studio for devkitARM, they don't seem to have this issue. I'm not sure if they're doing something they're just not mentioning in these tutorials or what. I could disable intellisense error checking in the program settings, but that's an extreme I didn't want to have to do until I know that I've exhausted all other possibilities.

As for the black background, I usually don't run black =) I have a dark theme, but I was merely testing something with the black. It fits the VS2010's color theme better than bright white. I've been using it that way for several years though.

Re: IntelliSense in Visual Studio 2010?

Posted: Fri Oct 29, 2010 12:38 am
by WinterMute
It's actually really, really bad with VS2010, I *had* to disable the Intellisense error checking which wasn't necessary with VS6 or VS2008 Express. It has a lot of trouble with gcc specific code and the newlib headers seem to be spectacularly problematic.

Re: IntelliSense in Visual Studio 2010?

Posted: Sat Oct 30, 2010 8:53 am
by sirflimflam
So it seems I'm out of luck then. Oh well, I'll just disable error checking when I work with it. It could always be worse. :)

Thanks anyway, guys. I appreciate it.

Re: IntelliSense in Visual Studio 2010?

Posted: Sun Feb 05, 2012 1:54 pm
by halofreak1990
Sorry to resurrect an old topic, but I felt I had to provide my two cents.

A lot of the Intellisense errors come from the

Code: Select all

__attribute((__packed__))
statements at struct definitions.
An easy fix for those is to go to ndstypes.h and change the line

Code: Select all

#define PACKED __attribute__ ((__packed__))
into

Code: Select all

#if _MSC_VER
#define PACKED
#else
#define PACKED __attribute__ ((__packed__))
#endif
In doing so, Visual studio will define PACKED as empty, while the NDS toolchain will see the proper statements.
You will then need to find all

Code: Select all

__attribute((__packed__))
statements and replace them with PACKED

Unfortunately, this doesn't fix all errors; VS2010 can't find stdbool.h, for example,, but it's a start.

fixing the "identifier 'deprecated' is undefined" errors is roughy the same as for the PACKED statements; replace

Code: Select all

__attribute__((deprecated))
with DEPRECATED
in all headers, and add

Code: Select all

#if _MSC_VER
#define DEPRECATED
#else
#define DEPRECATED __attribute__ ((deprecated))
#endif
to ndstypes.h

This leaves me with just 4 Intellisence errors, of which one is the lack of stdbool.h, another for _ansi.h, and two are for "C" linkage errors.