DDS makes Intellisense stop working in Visual Studio 2015

3 posts / 0 new
Last post
Offline
Last seen: 4 years 9 months ago
Joined: 03/02/2018
Posts: 3
DDS makes Intellisense stop working in Visual Studio 2015

Background:

RTI 5.3.0, Professional

 

Basic IDL, 

struct Encoder {

unsigned long relativePosition;

unsigned long absolutePosition;

};

 Run it through rtiddsgen; pretty much all defaults except preprocessor disable.

C:\Program Files\rti_connext_dds-5.3.0\bin\rtiddsgen.bat C:\__\dds_intellisense_problem\Encoder.idl -ppDisable -language C++11 -create typefiles -create examplefiles -create makefiles -platform i86Win32VS2015 -stl

Rtiddsgen completes without errors. I end up with the boilerplate demo publisher and subscriber. Open the publisher & build it: no errors, one warning I don't think is related...

1>------ Build started: Project: Encoder_publisher, Configuration: Debug Win32 ------ 1>  Encoder_publisher.cxx 1>  EncoderPlugin.cxx 1>  Encoder.cxx 1>  Generating Code... 1>Encoder_publisher.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification 1>  Encoder_publisher-i86Win32VS2015.vcxproj -> C:\__\dds_intellisense_problem\.\objs\i86Win32VS2015_pub\Encoder_publisher.exe 1>  Encoder_publisher-i86Win32VS2015.vcxproj -> .\objs\i86Win32VS2015_pub\Encoder_publisher.pdb (Full PDB) ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

(I've also debugged the example; it runs as advertised/expected.)

 

The Problem

Now I go into any source file to edit code, and see that Intellisense is disabled. It no longer works for either custom code, or the auto-generated code, or DDS itself (I've attached a screenshot showing me attempting to type code, and the error message shown by VS2015).

Properly formed code will still compile, but is a real pain to have to do so many API manual lookups.

 

What I've Tried

  • Naturally I tried this with several different IDL files, same behavior regardless of the content.
  • Created a basic C++ project. Compiled and intellisense worked as expected. Added DDS library, include paths, and macros. Intellisense stopped working.
  • Visual studio points me to this: https://msdn.microsoft.com/en-us/library/ms235519.aspx. I tried adding stdafx per their suggestion - no effect. 

 

I am concerned that DDS may be leveraging certain macro-defined behavior that is too complex for intellisense to make sense of.

"IntelliSense is not fully supported when you reference a header file multiple times by using the #include directive, and the meaning of that header file changes because of various macro states that are defined through the #define directive. "

Is there any advise on what is going on here, recommendations to fix, or known workarounds?

(see attached screenshot)

 

 

 

 

 

manuelBaena's picture
Offline
Last seen: 2 years 4 months ago
Joined: 06/27/2017
Posts: 8

Hello,

This is a known issue related to the Visual Studio project properties that affects to the Debug configuration. Please note that this issue does not affect Debug DLL, Release DLL, and Release, so IntelliSense should work properly with those configurations.

The problem is related to an error in line 98 of the property files for your VS project. For example, using the IDL struct that you indicated in your messages, you should modify the files: Encoder_publisher-x64Win64VS2015.vcxproj and the file Encoder_subscriber-x64Win64VS2015.vcxproj.

In line 98 of those files you can find the following code:

<PreprocessorDefinitions>WIN32;RTI_WIN32;_DEBUG;_CONSOLE,RTI_STATIC;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

As you can see, in this line there is a wrong separator "," between _CONSOLE and RTI_STATIC. If you replace this separator with a ";", which is the right separator, the error should be fixed and IntelliSense should work properly again. This line should remain as follows:

<PreprocessorDefinitions>WIN32;RTI_WIN32;_DEBUG;_CONSOLE;RTI_STATIC;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>

After change this line, IntelliSense should work properly again. Could you please check if this fixes your issue?

Best regards,
Manuel

Offline
Last seen: 4 years 9 months ago
Joined: 03/02/2018
Posts: 3

Hi. 

Yes - that corrected my issue. Thanks for the help - much appreciated.

It makes sense now why my own projects exhibited the same issue. I created a separate "empty" VS2015 project, and added a bit of code to verify intellisense was itself ok. Then I added in DDS which broke intellisense. But when I say "added in DDS" what I really did was copy the #includes, #defines, and lib references from the demo project.

So by keeping the original #define setup with the wrong separator, that busted my own empty project as well. Naturally, fixing the separator fixed both the demo project and my custom project.

Anyway, Intellisense is happy now.

Thanks again!