Setting Qt Environment PATH ??

I need some help here with figuring out how the hell you even suppose to direct or set the environment directory paths for Qt for EVERYTHING. Not just for development, but for running built applications that depend on Qt and it's core files to run correctly.

At the moment, all the directory environments are… you can pretty much say fucked-up ? and set to the wrong PATHs. I was having issue with an older version of Qt5 and I had to remove it completely, or think I have completely removed, I do seem to have other mixed versions of Qt installed, but I've no idea how to deal with them without THEM removing other package files from my system that are important. [I'm using Linux btw] Because when I want to go to remove them through my package maintainer it wants to remove system important package files, which is completely stupid if you ask me. But anyway, I had installed Qt55 from a package maintainer which I had opted and selected it to install into

/opt/qt55

so as not to confuse me which one I want to be using, and not to conflict with current installed other packages of Qt4. Anyway, some applications I have that rely on Qt and it's core files aren't contained in Qt4 for whatever reason… package maintainer removed them or whatever and wasn't included by default.

The current set directories from the previous Qt5 I had tried to install from before is set to;

I do not want qt4 ones being used by the system and applications by default, and if there's a command in which I can use to disable them then that would help, unless I can find a way to remove them without removing system critical packages at the same time. That last two there, qt5-x86_64-linux-gnu and qt5, I think those ones were from the previous old version of qt5 I tried to get working from before which didn't.

I just need to get the system to use opt-qt55 and not the old versions that are installed. One application in particular that I use on a regular basis [OBS - Open Broadcaster Source] I cannot fully use because it relies on a Qt core file QCoreApplication, and any attempt to use said features in software I use causes it to segfault because it doesn't have access to QCoreApplication, and Qt4 doesn't have it anywhere in it's installed directories, only in Qt55. I have had a chat with the developer of OBS, and they say that it's built using latest version of Qt with version 5.5.

I felt the need coming here to ask how to even change the Environment PATH in Qt, because I cannot believe how retardedly stupidly hard it is to correct the environment PATHs that doesn't give clear cut directions on how to change it manually if something isn't set right.

Hi! First of all if you want to change environment variables on Linux the places to look at are usually /etc/profile, /etc/profile.d and ~/.bashrc but this might be different for your Linux distribution. Next point is: If you have a program (OBS you said) that needs to dynamically load shared objects than you'll need to know where that particular binary looks for these objects. This problem is called dynamic linking thus involves your system's dynamic linker and does not only depend on your environment variables.

@Wieland I expected such a typical response as this, my distribution is Linux Mint, and there is nothing in /etc/profile or /etc/profile.d nor ~/.bashrc so that can be ruled out that they are not in there. Qt has its own profile somewhere else where it stores its environment variable. I know for a fact that it's stored somewhere else as those things you mentioned there does not exist, all that exists is the bare-bones skeletal files for .profile and .bashrc.

as I mention before OBS is looking for Qt core files, and I know for a fact that it's trying in the old Qt4 environment PATH, but such files do not exist as mentioned before. When I did a GDB backtrace, it points to these directories here /usr/lib/x86_64-linux-gnu/qt4, /usr/lib/x86_64-linux-gnu/qt5 while looking for QCoreApplication kernel/qcoreapplication.cpp: No such file or directory.

What I need instead since I know for a fact that since I've got a proper install at /opt/qt55 setup with all the files for programs that need it, I need to make applications look to that directory instead for all the Qt core files to load from. But this still doesn't change the fact that I need to manually correct the env PATH to what I mentioned before, and need to know where QtChooser stores or gets that information from, but obviously it's not picking up from the stuff you mentioned.

That there is somewhat helpful, but doesn't completely narrow down which config file it mainly reads from. Also I couldn't quite help but catch a minor error relating to default.conf when I ran qtpaths it throws me this error qtpaths: could not open config file '/usr/lib/x86_64-linux-gnu/qtchooser//default.conf': No such file or directory a typo in the path directory, I've no idea how that ever happened, but something went wrong, not sure how to correct that mistake.

Pretty much done this already before yes, the package maintainer that I had installed for qt55 installed under /opt/qt55 and I do find that it being installed at that path directory makes for much easier and cleaner handling when need to fix or check something in the paths there, compares to trying to scour source problems when installed under /usr/lib/x86_64-linux-gnu and it having multiple places where it installs to.

IMAO trying to be smarter then your package manager and the package maintainers is a stupid idea. Anyway, if you really want to force all your executables on your computer to look for shared objects in /opt/Qt/blah then this has nothing to do with the PATH variable or Qt Chooser but it's about your dynamic linker (like I already mentioned in my first posting). I don't know how it's done in your Linux distro but in every "normal" distro (LSB compliant) ld's configuration is in /etc/ld.so.conf.d/.

@Wieland you might not think it's a smart idea to do it the way I'm doing it, but to me it is a smarter and cleaner way for doing it, and yes it does have something to do with the PATH variable and Qtchooser, the paths point to the older version I don't want to use by default. I came here for simple answers where it stores that information not to be told what's good or bad with second guesses. So far the information you've provided hasn't been all that helpful with some definitive answers that gives insights of where Qt stores it's PATH environment that it reads from. None of the information provided doesn't point in the said direction where they may be stored.

What is the standard environment PATHs for Qt and everything it uses? You say to dynamically link the ones I want to use, but I need to know the default environment PATHs so I can point applications to it. Qt is such a bloody mess, that it makes itself so difficult to manage and configure the littlest of things.

Calm down. You keep asking for where "Qt stores its PATH variables". This doesn't make sense so I have to guess what you mean. Sorry that I couldn't help you to fix the system you broke. If you neither have the expertise to repair it by yourself nor to ask questions that make sense then you should consider to reinstall your computer.

@Wieland Calm down? I am calm btw, it's just getting really annoying where I can't get simple straight answers that are not too vague, and what's so difficult to understand about the question? The Qt environment PATH of where it's stored and read from or the part where applications can't fully run properly because it can't find everything it needs in the old versions environment PATH?

FTR: I do have the expertise to repair it myself, but I need a given direction that shows me where to look.

If I wanted to do a system reinstall I would of done it ages ago, but I'm not interested, and it's not something I broke, the whole Qt package itself came broke, blame the maintainer of the package provider https://launchpad.net/~beineri/+archive/ubuntu/opt-qt551 that's where I got the qt55 from in the first place.

qt55-env.sh that comes with Qt55 package is suppose to correct and change the environment PATH for Qt, but it doesn't work, it didn't fully properly change the environment PATH.

**EDIT:: You can forget it now..... eventually figured it out and fixed it on my own after messing around trying out a few things. Would of probably gotten if faster if seeking help here didn't suck so bloody much with vague answers.

Short answer: There is no such thing as "standard environment PATHs for Qt and everything it uses.

Long answer: Please note the following:

The environment variables set by QtChooser is for building applications, not for running applications. QtChooser is not the tool you're interested in, since it does not affect how applications load Qt.

The place where an application searches for Qt is determined by one or more of these things: (i) how the application itself was built and packaged, (ii) ldconfig, and/or (iii) distro-specific settings. Qt has no control over any of these 3 factors.

Qt itself does not require any environment variables. Your system is the one that requires environment variables.

You would have better luck if you had asked the Linux Mint community, since your problem is a question of "How does this system help applications find the libraries they need?".

You say to dynamically link the ones I want to use, but I need to know the default environment PATHs so I can point applications to it.

@Wieland suggested that you use ldconfig. You don't need to know or set any PATHs to follow it.