IntelliSense in Visual Studio 2010?

support for the ARM toolchain
Post Reply
sirflimflam
Posts: 3
Joined: Wed Oct 27, 2010 6:51 am

IntelliSense in Visual Studio 2010?

Post by sirflimflam » Wed Oct 27, 2010 7:00 am

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.

User avatar
Izhido
Posts: 107
Joined: Fri Oct 19, 2007 10:57 pm
Location: Costa Rica
Contact:

Re: IntelliSense in Visual Studio 2010?

Post by Izhido » Wed Oct 27, 2010 4:57 pm

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.

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: IntelliSense in Visual Studio 2010?

Post by elhobbs » Wed Oct 27, 2010 6:07 pm

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.

sirflimflam
Posts: 3
Joined: Wed Oct 27, 2010 6:51 am

Re: IntelliSense in Visual Studio 2010?

Post by sirflimflam » Wed Oct 27, 2010 9:45 pm

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.

WinterMute
Site Admin
Posts: 1986
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: IntelliSense in Visual Studio 2010?

Post by WinterMute » Fri Oct 29, 2010 12:38 am

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

sirflimflam
Posts: 3
Joined: Wed Oct 27, 2010 6:51 am

Re: IntelliSense in Visual Studio 2010?

Post by sirflimflam » Sat Oct 30, 2010 8:53 am

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.

halofreak1990
Posts: 3
Joined: Sun Feb 05, 2012 1:28 pm

Re: IntelliSense in Visual Studio 2010?

Post by halofreak1990 » Sun Feb 05, 2012 1:54 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests