c++ compiler issues - MinGW and visual studio c - visual-c++

several issues with both compilers.
Firstly, I've manually installed MinGW c++ compiler - the automated install was failing to download anything - exactly according to the instructions on the MinGW website, including adding C:\MinGW\bin to PATH system-wide, and restarted afterwars. However, g++ only launches if I cd to C:\MinGW\bin first. Secondly, when I do that, I get an error 'no include path in which to search for iostream', and when I look in c:\MinGW\bin\include (where all the header files seem to be', iostream.h is not there.
Finally, I tried downloading visual studio c++ from MS's website, which gives me the installer package vc_web.exe - but when I run this, it fails to download anything. My internet connection is otherwise fine so I can't think of any reason for this.
Any help would be much appreciated, thanks
-confused

As for Visual C++ Express, you can try the offline installer (which doesn't need an internet connection) http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express-iso
And regarding g++, it'll be easier for you to download an IDE that includes g++ and that sets everything up for you, I recommend CodeLite but there's also Code::Blocks

Related

vscode crashes on Arch linux when opening file/folder

Installation vscode
I'm running Arch Linux (Manjaro) and installed vscode with:
sudo pacman -S code
but then a simple .NET core program resulted in
--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
It seems like the official Microsoft build should be obtained via the snap store:
sudo snap install code --classic
And the program looks normal. I can install plug-ins, create a new file et cetera.
Problem
However, I cannot open any files or projects. Doing so results in vscode crashing. I read that code --disable-gpu could solve this problem, but doesn't do so for me.
Any ideas
what may cause this crash?
or how to get the pacman vscode working?
Logs
$ code --verbose
Gtk-Message: 22:59:19.805: Failed to load module "canberra-gtk-module"
Gtk-Message: 22:59:19.805: Failed to load module "canberra-gtk-module"
(code:33833): GdkPixbuf-WARNING **: 22:59:19.817: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory
This likely means that your installation is broken.
Try running the command
gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
[33863:1104/225919.911481:ERROR:appcenter_api.cc(52)] expecting appcenter url prefix
[main 2020-11-04T21:59:19.960Z] Sending env to running instance...
[main 2020-11-04T21:59:20.041Z] Sent env to running instance. Terminating...
[main 2020-11-04T21:59:20.041Z] Lifecycle#kill()
where the recommended gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache results in bash: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache: No such file or directory
I'm running Arch Linux (Manjaro) and installed vscode with:
sudo pacman -S code
but then a simple .NET core program resulted in
--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------
I had the same issue trying to get the debugger to work and I spent hours on finding the reason for this. What I found out is that the debugger only works with officially signed Microsoft binaries of VSCode. So you have to make a distinction here:
The package code contains the open source version of visual studio code, a build wich anyone can make using the provided sources by Microsoft. The program which you get here is therefore not signed by MS!
The package visual-studio-code-bin provided by the AUR contains a officially signed version by MS. If you use this package, the debugger works as expected.
I do not know wether snap - which I personally never used at all - provides this kind of package, so I can not tell anything about that, but using the said package from the user repository solved the problem for me reliably.
Try this one (which I installed just yesterday under the recent manjaro distribution and it worked fine) and see if this solves your problem with opening files and folders.

cargo-clone and cargo-edit don’t build on my Windows 10 PC

I installed Visual Studio C++ and Rust. Most things work fine, but building cargo-edit and cargo-clone fail. The error code hints at cmake missing but it's one of the items built ok. Windows 10 specific issue.
Thanks to help from the IRC #rust-beginners channel I found out that I needed to install cmake from cmake.org. Make sure you have it add itself to the path and restart your command prompt.
Cmake download

What kind of libraries should my program install as system libraries?

I am building an audio processing application in Qt and an installer through Inno Setup. Recently, a co-worker testing the application had difficulty running it because "VCOMP100.DLL" was missing. We had been through a few versions already and had not gotten the error, but I will include it in the installer anyways. However, my version of vcomp100.dll was in my system files - did that mean I should install it there? And so I wondered:
What kinds of libraries should my installer try to install in the system directory? On one hand, duplicated data is wasted data, but on the other hand, I'm nervous about messing with system files. I have ~5 types of libraries:
Very basic C/C++ runtime libraries (msvcp100, msvcr100)
Unicode support libraries (icudt51, icuin51, icuuc51)
OpenGL as part of Qt (libEGL, libGLESv2)
Qt-specific libraries (Qt5Core, Qt5Gui, Qt5Widgets)
Sound processing libraries (soxr, libsndfile, portaudio)
Can you explain what to install where, but more importantly, why?
Do not install these files directly.
Use bundled installers from companies which produce that libraries.
For example instead of copying msvcp100, msvcr100 use Microsoft Visual C++ 2010 Redistributable Package (x86 or 64bit: http://www.microsoft.com/en-us/download/details.aspx?id=5555) to install VC++ runtime files.
There may be another dependencies in your libraries and this package install everything required.
The installers can be run silently and it is more user friendly. If the runtime is already installed there is no problem if it is overwritten.
Check these topics for more info:
How to make vcredist_x86 reinstall only if not yet installed?
InnoSetup - Check if visual studio 2010 crt redist is installed, if not then run installer
I suppose this should be the same for Qt.

linux, freepascal, fp-ide: No debugger support availble. How to enable debugger?

How to enable debugger in fp-ide? I read somewhere that I should compile fp-ide from sources, but I don't know how to do this. Can someone help me?
Get the generic linux tar installer (fpc-2.6.0.x86_64-linux.tar) for FPC from http://www.freepascal.org/down/x86_64/linux-hungary.var It comes with a precompiled IDE with integrated debugger support and it works fine at least on 12.04 LTS.
I wasn't able to find a PPA for fp-ide, but I can describe how the CLI IDE is compiled on Arch Linux as documented in the repository. Do note that compiling will not enable the debugger in the CLI, as it seems to be an incompatibility between gdb and fp (fp-ide) according to e.g. this bug report in Debian. On Arch Linux, the fpc package also doesn't support the debugger in fp by design (it is explicitly disabled using the NOGDB flag).
Anyhow, here goes the compilation process:
Make sure you have FreePascal installed already, as you need it to compile the IDE
Download the source tarball
Extract the tarball to a location of your convenience and cd into that directory
Execute the following code from within your shell:
pushd fpcsrc/compiler
fpcmake -Tall
popd
make build
make -j1 install
# in Arch, the switch "NOGDB=1" is present in both make lines
That should compile the IDE and install it (you can even try to integrate it in dpkg by using checkinstall instead of make install, but take a look at the Arch PKGBUILD to see an example of what might be needed).
But why do you use the command line IDE fp instead of lazarus? With lazarus you can also make console applications and it offers much more features (e.g. working debug support).

Building GSL (GNU Scientific Library) in Windows for use with VS2005

I'm trying to get GSL working in a windows environment for my team and I'm running into many problems.
My team develops in C++ in VS2005, and we'd like to use GSL. I've downloaded the GSL-1.15 tar.gz, and unzipped it, but i'm not really sure what to do from here - I believe only two compilers will build it properly.
On the GNU website, it says that a compiled version of GSL is available as part of Cygwin on windows, so I installed Cygwin, but again, I'm not really sure what to do from there.
Ideally, what I'm trying to get is a folder on my C:\ with a bunch of dll / libs that I can link to in VS2005 to use the GSL functions. I'm aware of GSL ports to VS (http://gladman.plushost.co.uk/oldsite/computing/gnu_scientific_library.php), but we can't rely on them as I would be dependent on the publisher releasing a port every time a new version of GSL is released.
Has anyone successfully gone through this process of building GSL and getting it to work with C++ in VS2005? I've done some google searches and haven't found anything that I understand.
Thank you.
With Cygwin
Install one or more of the GSL packages
gsl
gsl-apps
gsl-devel
gsl-doc
With MinGW
I have personally built GSL with MinGW using this incantation
wget ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz
tar xf gsl*
cd gsl*
./configure
# Warning, make takes about 7 min.
make
make install
ref

Resources