Sysprogs forums › Forums › VisualGDB › Fixing Intellisense
- This topic has 23 replies, 3 voices, and was last updated 6 years, 1 month ago by support.
-
AuthorPosts
-
August 11, 2018 at 17:27 #21646JulianH93Participant
Hello again,
I always have problems with the intellisense engine of VisualGDB. After I included the C++ STL library “filesystem” almost the whole project got red underlined. Is there a way to fix such sings up? Or is this a known issue?
It’s like the intellisense is somehow setting the __cplusplus macro wrong, so the #if in the filesystem-header fails:
#ifndef _GLIBCXX_FILESYSTEM
#define _GLIBCXX_FILESYSTEM 1#pragma GCC system_header
#if __cplusplus >= 201703L
#include <bits/fs_fwd.h>
#include <bits/fs_path.h>
#include <bits/fs_dir.h>
#include <bits/fs_ops.h>#define __cpp_lib_filesystem 201703
#endif // C++17
#endif // _GLIBCXX_FILESYSTEM
I don’t know why this is happening. The GCC Version on the target machine is 8.2 and everything is compiling fine.
August 11, 2018 at 23:42 #21648supportKeymasterHi,
Please ensure you are using the Clang IntelliSense provided by VisualGDB that is specifically optimized to handle GCC-specific code.
If you are not sure, please attach a screenshot of the entire VS window showing the problem.
If switching the IntelliSense engine doesn’t help, please let us know your project type (Make, CMake, MSBuild, QMake, etc) and we will provide more detailed diagnostic instructions.
August 13, 2018 at 15:36 #21662JulianH93ParticipantI don’t really know how I may capture the whole error in one image. So here are some pictures.
Where I suspect the error is in the filesystem-header, cause Intellisense isn’t parsing the header correctly:
I estimate after I included this header, Intellisense bugged up:
stdafx.h:
The cpp file:
IntelliSense Settings:
- This reply was modified 6 years, 3 months ago by JulianH93.
August 13, 2018 at 23:55 #21674supportKeymasterHi,
Thanks for the screenshots. Looks like the Clang IntelliSense is successfully initialized.
Please try locating the following file:
%LOCALAPPDATA%\VisualGDB\ToolchainProfiles\<host name>\com.sysprogs.toolchain.default-gcc-\IntelliSense.props
Does the __cplusplus value recorded there match what you expect? Are you using the correct “language standard” setting in VS Project Properties -> C/C++?
August 17, 2018 at 10:37 #21701JulianH93ParticipantNo, __cplusplus value does not hit my expecations.
The highest I could find are:
… <ItemGroup> <ClCompile Condition="'%(ClCompile.CPPLanguageStandard)' == 'CPP1Z'"> <PreprocessorDefinitions>%(ClCompile.PreprocessorDefinitions);__cpp_attributes=200809;__cpp_aggregate_nsdmi=201304;__cpp_static_assert=200410;__cpp_variadic_templates=200704;__cpp_variable_templates=201304;__GXX_EXPERIMENTAL_CXX0X__=1;__cpp_delegating_constructors=200604;__STDC_UTF_16__=1;__cpp_raw_strings=200710;__STRICT_ANSI__=1;__cplusplus=201500L;__cpp_ref_qualifiers=200710;__cpp_rvalue_reference=200610;__cpp_nsdmi=200809;__cpp_initializer_lists=200806;__cpp_lambdas=200907;__cpp_unicode_characters=200704;__cpp_decltype_auto=201304;__cpp_digit_separators=201309;__cpp_unicode_literals=200710;__cpp_sized_deallocation=201309;__cpp_range_based_for=200907;__cpp_return_type_deduction=201304;__cpp_decltype=200707;__cpp_inheriting_constructors=200802;__GNUC_STDC_INLINE__=1;__STDC_UTF_32__=1;__cpp_alias_templates=200704;__cpp_constexpr=201304;__cpp_generic_lambdas=201304;__cpp_user_defined_literals=200809;__cpp_init_captures=201304</PreprocessorDefinitions> </ClCompile> </ItemGroup> <ItemGroup> <ClCompile Condition="'%(ClCompile.CPPLanguageStandard)' == 'GNUPP1Z'"> <PreprocessorDefinitions>%(ClCompile.PreprocessorDefinitions);__cpp_attributes=200809;__cpp_aggregate_nsdmi=201304;__cpp_static_assert=200410;__cpp_variadic_templates=200704;__cpp_variable_templates=201304;__GXX_EXPERIMENTAL_CXX0X__=1;__cpp_delegating_constructors=200604;__STDC_UTF_16__=1;__cpp_raw_strings=200710;__cplusplus=201500L;__cpp_ref_qualifiers=200710;__cpp_rvalue_reference=200610;__cpp_nsdmi=200809;__cpp_initializer_lists=200806;__cpp_lambdas=200907;__cpp_unicode_characters=200704;__cpp_decltype_auto=201304;unix=1;__cpp_digit_separators=201309;__GLIBCXX_BITSIZE_INT_N_0=128;__cpp_unicode_literals=200710;__cpp_sized_deallocation=201309;linux=1;__cpp_range_based_for=200907;__cpp_return_type_deduction=201304;__cpp_decltype=200707;__cpp_inheriting_constructors=200802;__GNUC_STDC_INLINE__=1;__STDC_UTF_32__=1;__cpp_alias_templates=200704;__cpp_constexpr=201304;__GLIBCXX_TYPE_INT_N_0=__int128;__cpp_generic_lambdas=201304;__cpp_user_defined_literals=200809;__cpp_init_captures=201304</PreprocessorDefinitions> </ClCompile> </ItemGroup> I created the project before I installed the GCC 8.2 Toolchain on the target machine. Maybe I somehow have to reconfigure the VisualGDB settings?
August 17, 2018 at 18:15 #21710supportKeymasterHi,
Thanks for checking it – that explains what is going on. Looks like VisualGDB indeed cached the values from the previous compiler.
Please click “Regenerate MSBuild Files” on the MSBuild Settings page of VisualGDB Project Properties, or simply delete the IntelliSense.props file and reopen the project to regenerate the toolchain files.
August 24, 2018 at 16:30 #21761JulianH93ParticipantNow the __cplusplus values are set correctly, but nothing changed. Intellisense is still not working correctly.
August 24, 2018 at 19:30 #21763supportKeymasterHi,
OK, please try isolating one specific case of broken IntelliSense (e.g. some variable or function is not found) and check if it’s still related to the mismatching __cplusplus definition, or something else (e.g. missing hardware/software FP macros). If you need more detailed instructions on this, please let us know a specific example of an IntelliSense error and we will help you narrow it down.
September 14, 2018 at 08:01 #21975JulianH93ParticipantNow I replaced std::filesystem by boost::filesystem, but the errors are still there. Intellisense even can’t find #include <vector> in the stdafx.h (it’s the upper most header included, no more code before #include <vector>). In the meantime I switched my maschine, but the error still exists.
“stdafx.h”:
#pragma once#include <vector>
#include <string>
#include <cstdint>
#include <memory>
#include <iostream>
#include <mutex>
#include <thread>
#include <iomanip>
#include <atomic>
#include <ctime>
#include <queue>
#include <ctime>
#include <cstdio>
#include <unordered_map>
#include <chrono>
#include <fstream>
#include <utility>
#include <optional>
#include <boost/filesystem.hpp>
#include <boost/asio.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/program_options.hpp>
#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <linux/can.h>
#include <linux/can/raw.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>- This reply was modified 6 years, 2 months ago by JulianH93.
September 15, 2018 at 05:20 #21990supportKeymasterHi,
Strange. Could you please try locating the <vector> file manually (both on remote machine and locally in %LOCALAPPDATA%\VisualGDB) and check if the corresponding directory is listed on the IntelliSense Directories page?
September 15, 2018 at 11:25 #21992JulianH93Participantvector on Windows maschine is in: \VisualGDB\RemoteSourceCache\192.168.0.138\0000\include\c++\8\vector
vector on Linux maschine is in: /usr/include/c++/8/profile/vector
And here is the IntelliSense Directory:
right click on vector and try to open it:
It says: “vector couldnt’t be found in the actual source directory or in the build system path. Actual source path: “source to the root path of my project” Buildsystempath is empty.
September 16, 2018 at 18:43 #22000supportKeymasterHi,
The error message looks like something shown by Visual Studio itself, not VisualGDB. It might indicate that IntelliSense is not properly initialized for the source file you are editing.
Are you using the Clang IntelliSense? If not, does the problem get solved if you enable it? If yes, please share a screenshot of the entire VS window showing the source file you opened (including any navigation bars on top) so we could check which IntelliSense engine is handling it.
September 19, 2018 at 15:36 #22017b.timofteParticipantI had similar issue in the past . It looks like VisualGDB cannot handle Boost library template headers . I tried with REsharper c++ and was much better
See my thread with Boost and Xerces 🙂
- This reply was modified 6 years, 2 months ago by b.timofte.
September 19, 2018 at 17:17 #22019supportKeymasterHi,
This is likely caused by a missing setting, or an incompletely imported project. We can help you get it to work if you could share the details we requested.
September 19, 2018 at 17:17 #22020supportKeymasterHi,
This is likely caused by a missing setting, or an incompletely imported project. We can help you get it to work if you could share the details we requested.
-
AuthorPosts
- You must be logged in to reply to this topic.