How to use two Qt5 versions on KDE Plasma to avoid conflict? - linux

I am using Opensuse Leap 42.3, with KDE Plasma 5.8.7 which uses Qt 5.6.2.
I would like to use the latest Qt version (5.10 as of asking this question) for development, and I've installed it in /usr/local/Qt5.10/.
I added Qt5.10 library path (/usr/local/Qt5.10/5.10.0/gcc_64/lib/) to my /etc/ld.so.conf but it caused a conflict with system's Qt version, which as a result anything using Qt libs (Dolphin, Kate, etc) won't work, and if logged out, cannot login, complaining about qdbus.
I tried to create symlinks in /usr/lib64 like this:
for f in /usr/local/Qt5.10/5.10.0/gcc_64/lib/libQt5*.so.5.10; do
ln -s $f /usr/lib;
done
But this too, made the same problem. I have also added a LD_LIBRARY_PATH entry in ~/.profile but with the same problem.
I can do export LD_LIBRARY_PATH="/usr/local/Qt5.10/5.10.0/gcc_64/lib/" in a terminal and run my Qt5.10 application, but this is not convenient.
What is the correct way of doing this?

It may not be convenient, but setting the path up as you launch seems to be the only way to avoid the issues you mention.
I also use KDE, and am playing with Qt 5.10 visualisation stuff on a system using Qt 5.9 and have experienced the hell of mashed library dependencies you mention.
Qt Creator seems to take care of that and in other environments (eg: KDevelop) you can add it to the path in the run/debug launch settings. And although not portable, you could also add it to the path for your desktop file...
The qtchooser utility might be useful although I admit I don't really understand how it's supposed to work.
Yes, I realise this is a low quality answer but I am interested in seeing a better solution too.

Related

Setting up ARM Toolchain in Qt Creator (Ardupilot project)

I'm starting a drone project based on Ardupilot and trying to build Ardupilot project using Qt Creator, following this instructions . I'm working with Ubuntu, BTW.
You've probably find this stupid (cause it probably is), but I'm not able to set up the compiler (in spite of having the instructions):
As suggested, I downloaded the compiler from here, and tried to follow the instructions but after choosing a custom compiler in 'Build & Run', the 'Make path' is driving me crazy and I have no idea of which path is that (in other words, the equivalent to the file 'make.exe' in Windows, see the image attached), since there doesn't seem to be anything similar in the compiler folder and it doesn't seem to refer to the Makefile of the project.
Hope anyone can help me, as you've surely noticed, I'm pretty new to big, real projects and also to Linux itself.
Thanks in advance,
Eduardo
PD:
Instructions provided (both Windows & Linux):
Linux: Which one is the 'Make path'?
The build directory should point to ardupilot/ArduCopter if you are building for Copter
In the example it was pointing to ardupilot
Compiler path: /opt/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc
The make file path: /usr/bin/make
First. What version of qt? If it's 5.7 then the 2015 toolkit won't work. If you're new to Linux then you should definitely stay with a prior version of qt 5.7 until someone has compiled a new toolkit that supports a c++11 compiler.
You don't have enough info on what you're doing to give a good answer though.
What do you need the program to do? If it's Qt3d on Arm then you have a big problem only 5.7 will do.
Hope this helps.

Qt Creator: add Qt module to project

So when I create a new Qt project inside Qt Creator I'm only asked for some simple details like location of the project, build targets, the main window class name (along with header, source and form file) and at the enda choice to add it to version control.
After I create the project I'm only given the qt core and gui modules. My question is how do I add other modules (such as network or opengl). I've looked and looked, yet I cannot find anything on how to add other Qt modules easily. I know I can edit the .pro file, but unfortunately I don't know all the modules in Qt, nevermind the name I'm supposed to put there. Adding external libraries is easy, but how come there's no (obvious) option to add Qt libraries?
Help would be much appreciated ^_^ Thanks!
Oh yeah... I'm running Arch Linux if that's any help.
Edit your .pro file. It should has one line like this:
QT += core gui
Append the desired modules in this line. To get the module's names, just remove the "Qt" part in this list. (e.g. QtSql turns "sql")
I can't find that either.
It seems that in older versions of the "New project" wizard you used to be able to specify which modules you wanted to use, but even then you were not able to alter your choice later. And this seems gone now, so your only choice is to manually edit the .pro file.
As others have pointed out, you simply #include the module you want in the source and add the name of the module in the .pro file to the QT variable.
However the actual documentation you need which no one else has mentioned is the qmake Project Files page. qmake is very powerful and it's well worth getting familiar with how it works and I think that's why they don't provide a complete GUI for it, as it can handle some very complex scenarios.
You have to read the documentation to add the modules.
Frankly speaking, I never really felt like that there needs to be a GUI for that.

How can a Linux source package be opened as a project in an IDE?

I am makeing a small mod to SMPlayer; the Linux version...
The make, sudo make install from the command line works, but I would like to have the project in an IDE.
I want to use CodeBlocks IDE, only because I've used it before, but if some other IDE is required, I can use that instead... (I use Codeblocks because it is simple, and that suits my current ability to handle an IDE)..
Is there some way to use SMPlayer's Makefile, or some such thing?
This depends on the IDE and has little to nothing to do with Linux.
Does your program come with something like cmake or another setup tool? That normally makes it much easier. For example in KDevelop you can import straight from CMakeLists.txt and Makefiles.
If all else fails it might be quite easy to do something like this (not knowing your specific IDE):
Add new Project
Set build directory and other necessary settings (like compiler and compiler flags)
Add the already existing files to it.
Press "Compile"-button.
This is obviously depending on the project structure, setup and size.
Code::Blocks has builtin support for Makefile projects. See the FAQ.
Also you could just use vim or emacs ;)

which GUI based C++ IDE is commonly used for gnome applications

which GUI based C++ IDE is commonly used for developing gnome applications?
I am asking specifically for the gnome-system-monitor because I would like to fiddle around with it. And I would like to do it with a nice GUI based C++ IDE.
I thought that Anjuta is the default IDE for gnome applications. But when I fetch the sources there are no files which are obviously project files.
EDIT: Here is what I did so far
# get the build dependencies for the gnome-system-monitor
sudo aptitude build-dep gnome-system-monitor
# get the sources for the gnome-system-monitor
mkdir example
cd example
apt-get source gnome-system-monitor
# build the gnome-system-monitor
cd gnome-system-monitor-2.28.0
sh configure
make
But nothing inside gnome-system-monitor-2.28.0 looks like a "project file".
I believe Glade is used, or at least was used at the time.
BTW, I'm not sure Gnome is C++. There are C++ wrappers, like gtkmm and glibmm, but I believe that core Gnome is written in C.
Simply "create project from existing sources" in Anjuta. Anjuta's "project files" do not contain a lot of information, instead the Makefile.am and configure.ac files are used.
I have no idea what the gnome-system-monitor developers use, but I've read that a lot of Gnome developers use emacs, which apparently also doesn't require "project files".

compiling actionscript in linux

I'm working on a website that requires a flash mp3 player. I have absolutely no idea the procedures from messing with flash/actionscript/flex etc., however I need to edit the flash very slightly (I need to add two lines of code). There are a multitude of tutorials out there for setting up a flash (or flex or whatever) development environment but, as my needs are so simple, I'd like to go a little more light-weight than that (also, many seem outdated). I guess what I'm saying is I'm looking for a simple way to recompile some existing actionscript (command line is a plus!). Does anyone have a trick up their sleeve to accomplish this?
Download the free/opensource Flex 3 SDK. This includes an ActionScript3 compiler. Run the compiler like this:
mxmlc MyAs3File.as
There's MTASC for ActionScript 2.
You can compile it online here: http://wonderfl.kayac.com/. No mess that way.
I also wanted to say that swftools has exactly what you need. There is a swfc compiler which will compile as2 files. I would really recommend updating the source though. AS3 is much faster than AS2 and there are a lot of tools out there for example mxmlc and fcsh included in the open source Flex sdk. If you are looking for a full blown IDE there is a linux version of Flash Builder that was released as an open source port ... there are a couple other ones out there as well.
General Linux
On linux you can get the source from swftools.org.
Debian / Ubuntu
On debian / ubuntu you can run
apt-get install swftools
Mac OS X
Not exactly 'linux' but on mac OS X if you have homebrew installed you can do:
brew install swftools
Great, but how do I compile the code?
One this is installed you should have a new utility that you can use to do:
as3compile MyAs3File.as
Gotchas
Please note this is not a 1:1 replacement for Adobe's compiler - there are some things that it does not support ( see documentation, FAQ, changelog at swftools.org ) but it worked well for compiling my simple actionscript.

Resources