Should I install toolchains in CLion? - clion

I just installed CLion on my Windows, and started a new project, but got some trouble setting up the environment.
When I tried to run the program, it says CMake executable not found
And I clicked the blue-colored message Configure, it jumps to Toolchains in settings.
Here, my question is, isn't the toolchain kind of minor things that link to another environment just for ease of use, not a must-do thing?
It says that I should make some toolchains with one of WSL, VS, MinGW, Cygwin. Here, one of these, VS is another IDE, which makes me confusing, because it seems against the purpose of installing CLion that it requires the installation of another IDE.
In summary, what's the purpose of toolchains? Should I install one of those for running C in CLion?

Related

Setting up QtCreator cross compiler for ARM on Windows

I need to develop Qt and command line software for the BeagleBone Black and Raspberry Pi-2. Ideally I wish to use QtCreator as I am accustomed to it, but in any case I need to use QtDesigner for GUI work.
I have spent days trawling through articles, going around in circles and getting nowhere.
The Raspberry Pi-2 has Raspbian/Jessie installed together with Qt 5.2.3. I can design, compile and run Qt desktop applications on this. Of course compilation is slow and not really usable for development work.
To try and keep matters simple, I downloaded qt-opensource-windows-x86-android-5.3.2.exe and installed that on my Windows 7 (64-bit) system. My belief is that this Qt install is the same version as the Qt on the Pi-2 and already contains the ARM7 library files required for cross-compiling. All that should be needed is a cross-compiler for Windows/ARM?
Windows/QtCreator complained in Tools > Options > Qt Versions about the Qt 5.3 for Android armv7 stating "No compiler can produce code for this Qt version...".
For a Windows/ARM cross-compiler I downloaded and installed Yagarto (yagarto-bu-2.23.1_gcc-4.7.2-c-c++_nl-1.20.0_gdb-7.5.1_eabi_20121222.exe). I figured I then just need to set the QtCreator compiler path in Tools > Options > Compilers and then things would start working. This is not the case.
Clearly I am missing something important and have managed to become confused by the number of not-quite-relevant articles I have read.
Is Yagarto the cross-compiler I need in this situation?
How do I define the compiler in QtCreator and get rid of the error?
Is there an easier way to set-up this stuff?
Thank you.
Details:
QtCreator 3.2.1 (Qt 5.3.2)
Windows 7 64-bit service pack 1
Edit:
I have just tried again using the GCC ARM Embedded ToolChain and GNU Make for Windows. The result is the same in that I cannot seem to configure the settings for QtCreator ARM7 and make it happy.

Building GCC's libstdc++ with debug symbols on Windows

I am developing an app with GCC, mostly on Windows, until I got a crash that couldn't be debugged with the MinGW toolchain build I have. I installed a Linux VM, and debugged it there, which was possible, because the libstdc++ had the symbols I required.
I'm sure the Linux build of libstdc++ was a release (optimized version), because this would be normal to be installed for all apps to use. Same with the Windows version. But how can the Linux version have the necessary debug symbols built in, or if I ask the question I really want an answer to: how can I build GCC's libstdc++ so that I can get a useful stacktrace out of it, and still have it optimized? (note: I am able to recompile GCC/MinGW, so that's not an issue)
I know visual studio has both debug and release versions, but never heard of something like that for Linux. The debug symbols are always in seperate packages as I remember.
Info: I was using Arch linux with the plain GCC packages installed (no special debug versions explicitly selected).
I'll answer this one myself: you need to configure with
--with-stdcxx-debug
This will place a in lib/bin and lib/debug a shared and import library, which contains debug info.

Build GTK with Windows SDK

how can I compile gtk (itself) with Windows SDK ?
Building in Visual Studio is still quite a lot of work. I've done it, but I don't have reproducible steps for you right now. However, if you have a Linux machine around and are willing to cross-compile I have written up directions on how to build GTK+ for Win32 by cross-compiling.
http://live.gnome.org/Cross%20compiling%20GTK%2B%20for%20Win32
It's also possible to build using MSYS in the command-line on Windows, but that's also a major pain in the ass to get setup. It's also really, really slow. Cross-compiling from Linux is, at a minimum, ten times faster. I'm not 100% sure but it seems to be because if you build using the standard build system then there is a lot of process spawning, which is quite expensive in Win32 compared to Linux.
However, if you want to go this way then install MSYS and pull down the source for glib, atk, cairo, pango, and gtk+.. then try to build using the standard Linux way:
1/ untar the source tarball
2/ in the source's root directory do: ./configure
3/ make
There will undoubtedly be other dependencies that you need to install, such as libpng and libjpeg.
Try the HexChat builds. They use Visual Studio 2010 and come with some prepared scripts and solutions to make your life much easier. Oh and you get binary downloads as well.
http://gtk.hexchat.org/
GTK can be compiled under Cygwin or Microsoft Visual C++.
Did you try this installation method? Look the Microsoft Windows section...
Hope it helps!

Installing Qt4 on Windows - do I need to fully install MinGW or just have local copies

That is, can I get away with DLLs in the install directory or does the installer need to ensure that MingW is fully installed?
If you install the Qt SDK, it will actually install its own MinGW tree.
This does not directly answer your question, but generally speaking, to ensure I have all the right dependencies when creating an installer, I do the following:
Use Depends, a Microsoft tool that shows what DLLs a Windows executable (.exe or another .dll) depends on. This will not show dynamically loaded DLLs though, such as QT plugins. I believe Depends is part of the Platform SDK (it used to be, anyway), which you should be able to download. See here for example.
Use a virtualization tool (like VirtualBox or VMWare) to install a fresh copy of Windows and your application. If it complains of missing DLLs on startup, you missed something in the install package.
You should be aware of any dependencies on the Visual C++ run-time. There are many different versions out there, and if your app depends on them, you need to install the correct version to the Windows\WinSxS directory. Microsoft provides a redistributable for each version of Visual C++ (including the express edition, which you can get for free). I only mention this because I noticed when installing Qt SDK that the VC++ redistributable was getting installed, so the Qt DLLs may have a dependency on the VC++ run-time.

Is it possible to compile Windows binaries on a Linux machine?

At my work, all of the project data resides on an NFS that is accessible from both Linux and Windows machines (using Samba). All of the work is done on Linux, but I'm toying with the idea of compiling some of tools for Windows so that I can debug with Visual Studio.
I already have a nice makefile that can build the code for both 32-bit or 64-bit Linux using different targets. Assuming I have Windows versions of all the external libraries somewhere on the NFS, and assuming the code is clean enough to compile under Windows, is it possible to compile and link my program for Windows using the existing makefile, on Linux? Ideally I'd like to call the makefile once and have it build all three of 32-bit Linux, 64-bit Linux and Windows.
An added plus would be the option to compile it with any Visual Studio metadata to make it easy to debug.
Yes, you can achieve that with MinGW for example.
However, you will probably have to adapt one or two options in your makefile.
There are a number of possibilities I can think of:
You might try running Visual Studio under Wine. If Visual Studio does not run, you may still be able to run the command-line tools.
Run a full installation of Windows in a Virtual Machine. I have done this with Linux on Windows, but not the other way around, but I am certain that it is possible.
Use VNC to access a separate Windows PC from the Linux PC
Use a cross-build of GCC instead of Visual Studio
You need a cross-compilation package. You can also use the Wine lib.

Resources