How to Update GCC to include C++20 - visual-studio-code

This is likely a straightforward fix, but I need to upgrade my g++ compiler to include C++ 20 libraries such as <span> and <range> on Visual Studio Code but I am confused about how to do that.
From what I've looked up, to allow Visual Studio Code to compile with C++20 libraries, I need to run mingw-get update but I have no idea where I actually run that command to update the compiler for Visual Studio Code.

You need a recent version of GCC+MinGW-w64 that supports C++20.
You can get it via MSYS2's package manager pacman, or if you don't need MSYS2 you can get a standalone version from https://winlibs.com/.

Related

Forcing VS Code to install an extension without compatibility checking

I am using a custom build version of the Visual Studio Code. It seems some extensions are checking the exact build name and version of the vscode before installation and if it doesn't match, vscode throws an error:
Unable to install because, the extension '....' compatible with
current version '...' of VS Code is not found.
For example, the Remote - SSH extension on my current custom build throws:
Unable to install because, the extension 'ms-vscode-remote.remote-ssh'
compatible with current version '1.32.0' of VS Code is not found.
Is there a way to bypass the version checking and force vs-code to allow the installation?
Issues
There are two issues to concern:
The first one is a legal one. The Remote - SSH extension's license is very restrictive. From its license:
You may use a copy of the software with each validly licensed copy of Microsoft Visual Studio Code. You may not use the software if you do not have a license for Microsoft Visual Studio Code.
The second one is the extension's incompatibility. It seems that your custom build is based on VS Code version 1.32.0. However, the initial release of the SSH extension requires at least VS Code 1.35.0 or above. From the release notes of VS Code 1.35.0:
The Remote Development extensions are now available for VS Code Stable [...]
Conclusion
So even if you do not care about the legal issues and are able to force install the extension for your custom build it will probably not work since the extension requires a more recent release of VS Code.
More information on this topic can be found in the VSCodium documentation (A "free version" of VSCode). If you rely on the SSH extension and consider switching your custom build, there you will find a possible workaround to get the remote extensions working with VSCodium (I haven't tested it on my own).

Is it possible to specify the path to the libstdc++ in VS Code clangd extension?

I use VS Code as my main code editor for my C++ development. I am using the remote SSH extension by Microsoft to access my office workstation from home. For the C++ autocompletion and linting I use the clangd extension by LLVM. Company policy prevents users from having sudo access to workstations and libraries are often not at the latest version.
When I try to launch clangd I get the following error message:
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /my/path/to/clangd)
Which obviously means that the version of libstdc++ is too old for the version of clangd that I am using. This is easily fixable by adding to LD_LIBRARY_PATH the location of most recent gcc libraries (part of our compiler toolchain) and then launching VS Code.
However, now that I am working remotely I cannot do that because VS Code is installed onto my laptop and I am using the SSH extension to access the code on my office workstation. Looking on the man page for clangd I cannot see a way to specify the path to the libstdc++ that I want to use. Is there a way, other than adding the libraries to the LD_LIBRARY_PATH upon startup/login, to bypass this issue?
I found a way, albeit a little bit hacky.
Export the new LD_LIBRARY_PATH on .zprofile (or equivalent for your shell. I am using zsh). Make sure that there are no VSCode servers running in the host. If there are, make sure to remove them.
In the settings.json file add the following line, to tell VSCode that you want the shell to be a login, interactive shell:
"terminal.integrated.shellArgs.linux": ["-l", "-i"]
Job done. Clangd now finds the correct libraries.
Another way to do this is to use env in your settings.json as follows:
"clangd.path": "env",
"clangd.arguments": [
"LD_LIBRARY_PATH=<your_custom_path>",
"/path/to/my/clangd"
],

How can I configure the OpenDDS 3.13 with VS2017 community?

I'm using Visual Studio 2017. Below is the output from a Visual Studio Developer command prompt indicating the C++ version.
C:\ProgramsNotInstalled\OpenDDS-3.13>cl /?
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27024.1 for x86
Following that, I see the following output when running the configure --java command.
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.3
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
C:\ProgramsNotInstalled\OpenDDS-3.13>configure
ERROR: Could not detect Visual C++ version, try running this script from the Visual Studio Command Prompt.
Stopped at configure line 421.
C:\ProgramsNotInstalled\OpenDDS-3.13>configure --java
ERROR: Could not detect Visual C++ version, try running this script from the Visual Studio Command Prompt.
Stopped at configure line 421.
C:\ProgramsNotInstalled\OpenDDS-3.13>
I saw a similar question posed for DDS 3.12 on stack overflow but that answer has to do with language. That is clearly not the problem in my case, and I am running the configure script from the correct type of command prompt. This question is not a duplicate.
How to install OpenDDS 3.12 on windows system
Evidently, the configure script cannot always detect the compiler version automatically. I'm not good at reading perl scripts because I don't know perl well, but I found an option to help the script.
First determine the exact version of the C++ compiler by running this line:
cl /?
Now using the output of that, add the --compiler option to the command line.
configure --compiler=19.16.27024.1 --java
The instructions within the INSTALL file and README were not clear on that point. I ran configure --help to look at the command line options and that is how I learned that the script will try to autodetect the compiler. My guess is that the script is looking for a specific C++ compiler version or it is using a regex that isn't working well.
This is a small issue in the configure script of OpenDDS 3.13 which is caused by a change in the compiler version which was not known at release time. When you would pull github master (see https://github.com/objectcomputing/OpenDDS) this should work again, or wait until OpenDDS 3.14.

Building QGIS source code on Windows 7 - Not working

As mentioned here I've tried to build the QGIS on Windows 7.
There are two methods one using Visual Studio Express Edition installer and the second one using MinGW.
I've found both of them broken and don't know what to do next
In building using Visual Studio
The link to visual studio actually installs the version 2010 but documentation assumes it version 2009. So "set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\" path is not found.
Also I'm confused about the context of this line:
If the path to bison and flex contains blanks, you need to use the
short name for the directory (i.e. C:\Program Files should be
rewritten to C:\Progra~n, where n is the number as shown in `dir /x
C:``).
In Building using MinGW 4.2.1. MSYS link is not found(404) but when I try to build step by step I find XDR 4.0 not found(404) in this page
So what's the way to build it?
All I want is to change the title and startup photo of QGIS Desktop software.
Using another application I'm now able to change the title of running QGIS but don't know where to change the photo which shows "Loading plugins...".
The build instructions for Windows 7 are a tad long in the tooth, but they work for the most part. I did not try MinGW.
I immediately changed the VS90COMNTOOLS path to point to the Visual Studio 2010 directory and it seemed to work for me:
set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 10.0\Common7\Tools\
Regarding bison and flex configuration, I used the latest version of CMake (3.3.1 as of now) and didn't encounter any warnings/errors pertaining to bison or flex. Are you encountering any right now? If not, you should be able to proceed.

Running IBM Rhapsody animations without Visual Studio

I am relatively new to Rational Rhapsody, and SysML in general, so the errors are likely to be at my end.
I have been scouring Google (and SOF) looking for ways to run Rhapsody animations without Visual Studio. It was my impression that if Rhapsody had access to another IDE, say Eclipse, then the other IDE could deal with the animations. Is this correct, or is VS absolutely required to run animations and debugging tools in Rhapsody?
I have been getting a similar error to that of the user in How to fix Rational Rhapsody error :"Current value is "VC11", but no Visual Studio installation was not found in the directory ""."; my error is "VC10." However, I do not have, or plan to have, Visual Studio run the animations; I'd rather have the animations run using Eclipse, but this is not working either (the same "VC10" error occurs).
I also chatted with a contact at IBM and he suggested trying cygwin as a compiler, but under my circumstances, I cannot download that software.
Thanks in advance for the assistance.
The Rhapsody workflow:
Rhapsody generates code from your model. (UML => C++)
To compile the code you need a compiler. Rhapsody does not have its own compiler. If you are on Windows, you can use the VS or cygwin compiler. (C++ => EXE)
If you have enabled the animation instrumentation for your application, then if you start the application, it will connect (using TCP/IP) to a running Rhapsody instance. The animation will run in Rhapsody.
... is VS absolutely required to run animations and debugging tools in Rhapsody?
A compiler (eg. VS or cygwin) is absolutely required to compile the code that has been generated by Rhapsody. Rhapsody is required if you want to see animated state-charts or sequence-diagrams while your application is running.
See also: configure Rhapsody 8.x to use the VS 2013 compiler.
There are many different questions. I try to give you some clarifications.
To run your Rhapsody model with animation you need Rhapsody and a compiler. The compiler could be Visual Studio compiler or Cygwin gcc. Those frameworks are already provided by Rhapsody.
Visual Studio or Eclipse you only need to edit your code. This can easily be done with right klick on your configuration and change it to the corresponding IDE.
I guess you question is related to the VS Version. In the properties of your configuration you must adjust your Visual Studio version. Search for property with VCxx content. Can't remember the exact name of the property at the moment.