0

I have a C++ static library project that compiles without any errors, nor it shows any errors in the Error list window. So all seems to be working OK. Except that when I try to open the source (CTRL + left click on a library or library specific item), then the file of an incorrect version is opened. Why?

To elaborate. I have CUDA 9.1, CUDA 9.2 and CUDA 10.2 installed on my PC. My project has following CUDA Linker config:

  • Additional Libary Directories: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib\x64;%(AdditionalLibraryDirectories)

  • Additional Dependencies: cudart.lib;%(AdditionalDependencies)

In the CUDA linker's Command line I have:

"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe" -dlink -o x64\Debug\Core3.device-link.obj -Xcompiler "/EHsc /nologo /Zi " -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib\x64" cudart.lib

In the CUDA C/C++'s Command line I have:

enter image description here

So, it looks OK. But in the code, when I click on any of the includes - they point to 9.2 source. Example:

#include <cuda.h> 
#include "cuda_runtime.h"
#include <device_launch_parameters.h> 

the path is: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\ v9.2 \include

enter image description here enter image description here

Furthermore I have checked the environment variables. All good. Also checked which props files are used in .vcxproj file. Properties CUDA 10.2.props are used everywhere.

So my question is - why does the IntelliSence still thinks that I am using an older version of CUDA? And more importantly - how do I make him use a proper, 10.2 version?

EDIT 1: more information requested in comments. Include directories - defaults used.

enter image description here enter image description here enter image description here Variable check: enter image description here enter image description here

Alex
  • 4,607
  • 9
  • 61
  • 99
  • You did not show configured include dir - from your VS solution or directly your VS installation. Seems that one of these is pointing to 9.2 version. – Neywat Feb 24 '20 at 08:36
  • @Neywat could you elaborate on `or directly your VS installation`? Where should I check? Regarding the first - I have edited the post and attached Include Directories config, if that is what you meant. Defaults are used. – Alex Feb 24 '20 at 08:42
  • By ```VS installation```, I was refering to _options_ dialog > _VC++ Directories_. If your project don't override paths, then they are the same. For your project, does ```C/C++``` item or ```CUDA C/C++``` item have other include paths configured ? – Neywat Feb 24 '20 at 08:48
  • @Neywat by convention defaults are used in places that I have not mentioned in original post. :) As a proof - see edit. I have attached multiple pictures from the project settings, including these that you have asked about. Please check. **p.s. stackoverflow community/mods please don't ban me if there are too many pictures..** – Alex Feb 24 '20 at 08:55
  • 1
    Sorry for that, I was checking the obvious :). I suppose you tried to delete the intellisense database (saved my life couple of times). If you use precompiled headers, it can also cause strange behavior. – Neywat Feb 24 '20 at 09:12
  • @Neywat no I have not.. Just checked the internet - perhaps you meant the `.vs` folder? I will try this approach within a hour and then report back. :) – Alex Feb 24 '20 at 09:39
  • @Neywat hey, it worked! I have posted an answer. If you want to - you can post the answer instead and I will remove mine.. I just want this question to stay as there might be other people struggling with the same situation.. If you could add some useful information about the `intellisense` and/or the `.vs` folder then I and other people would be very glad. :) Thank you for help! – Alex Feb 24 '20 at 10:22
  • Thanks. Meanwhile I found 2 related questions : https://stackoverflow.com/questions/18289936/refreshing-the-auto-complete-intellisense-database-in-visual-studio and https://stackoverflow.com/questions/4830397/how-to-rebuild-vs2010-ide-intellisense. Maybe your question can be marqued as duplicate ? – Neywat Feb 25 '20 at 12:26
  • They have one thing in common - issue with the IntelliSense. The clues are different. Case 1 - auto-complete stops working after X number of code. case 2 - IS not working for one particular case. In my case - all code is highlighted and autocomplete works fine. Only the wrong sources are showed. While I agree that the problem is the same old IS (or VisualStudio?), the rest is different and therefore is not a duplicate.. – Alex Feb 26 '20 at 09:01

1 Answers1

0

@Neywat has suggested removing the IntelliSense folder and it worked.

I had to remove the whole .vs folder in solution directory though.

The question remains though - is this a known issue and is the Microsoft team aware of it? What are the recommendations in regards to .vs folder lifetime? Should we clean-it up from time to time?

Alex
  • 4,607
  • 9
  • 61
  • 99